Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 663333002: Standardize usage of virtual/override/final in chrome/renderer/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/chrome_render_process_observer.h" 5 #include "chrome/renderer/chrome_render_process_observer.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/allocator/allocator_extension.h" 10 #include "base/allocator/allocator_extension.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 namespace { 60 namespace {
61 61
62 const int kCacheStatsDelayMS = 2000; 62 const int kCacheStatsDelayMS = 2000;
63 63
64 class RendererResourceDelegate : public content::ResourceDispatcherDelegate { 64 class RendererResourceDelegate : public content::ResourceDispatcherDelegate {
65 public: 65 public:
66 RendererResourceDelegate() 66 RendererResourceDelegate()
67 : weak_factory_(this) { 67 : weak_factory_(this) {
68 } 68 }
69 69
70 virtual content::RequestPeer* OnRequestComplete( 70 content::RequestPeer* OnRequestComplete(content::RequestPeer* current_peer,
71 content::RequestPeer* current_peer, 71 content::ResourceType resource_type,
72 content::ResourceType resource_type, 72 int error_code) override {
73 int error_code) override {
74 // Update the browser about our cache. 73 // Update the browser about our cache.
75 // Rate limit informing the host of our cache stats. 74 // Rate limit informing the host of our cache stats.
76 if (!weak_factory_.HasWeakPtrs()) { 75 if (!weak_factory_.HasWeakPtrs()) {
77 base::MessageLoop::current()->PostDelayedTask( 76 base::MessageLoop::current()->PostDelayedTask(
78 FROM_HERE, 77 FROM_HERE,
79 base::Bind(&RendererResourceDelegate::InformHostOfCacheStats, 78 base::Bind(&RendererResourceDelegate::InformHostOfCacheStats,
80 weak_factory_.GetWeakPtr()), 79 weak_factory_.GetWeakPtr()),
81 base::TimeDelta::FromMilliseconds(kCacheStatsDelayMS)); 80 base::TimeDelta::FromMilliseconds(kCacheStatsDelayMS));
82 } 81 }
83 82
84 if (error_code == net::ERR_ABORTED) { 83 if (error_code == net::ERR_ABORTED) {
85 return NULL; 84 return NULL;
86 } 85 }
87 86
88 // Resource canceled with a specific error are filtered. 87 // Resource canceled with a specific error are filtered.
89 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest( 88 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest(
90 resource_type, current_peer, error_code); 89 resource_type, current_peer, error_code);
91 } 90 }
92 91
93 virtual content::RequestPeer* OnReceivedResponse( 92 content::RequestPeer* OnReceivedResponse(content::RequestPeer* current_peer,
94 content::RequestPeer* current_peer, 93 const std::string& mime_type,
95 const std::string& mime_type, 94 const GURL& url) override {
96 const GURL& url) override {
97 #if defined(ENABLE_EXTENSIONS) 95 #if defined(ENABLE_EXTENSIONS)
98 return ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( 96 return ExtensionLocalizationPeer::CreateExtensionLocalizationPeer(
99 current_peer, RenderThread::Get(), mime_type, url); 97 current_peer, RenderThread::Get(), mime_type, url);
100 #else 98 #else
101 return NULL; 99 return NULL;
102 #endif 100 #endif
103 } 101 }
104 102
105 private: 103 private:
106 void InformHostOfCacheStats() { 104 void InformHostOfCacheStats() {
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 372 }
375 373
376 void ChromeRenderProcessObserver::OnGetV8HeapStats() { 374 void ChromeRenderProcessObserver::OnGetV8HeapStats() {
377 HeapStatisticsCollector::Instance()->InitiateCollection(); 375 HeapStatisticsCollector::Instance()->InitiateCollection();
378 } 376 }
379 377
380 const RendererContentSettingRules* 378 const RendererContentSettingRules*
381 ChromeRenderProcessObserver::content_setting_rules() const { 379 ChromeRenderProcessObserver::content_setting_rules() const {
382 return &content_setting_rules_; 380 return &content_setting_rules_;
383 } 381 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_process_observer.h ('k') | chrome/renderer/chrome_render_view_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698