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

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

Issue 9215005: Revert 117824 - Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/about_handler.cc ('k') | chrome/renderer/chrome_render_view_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #endif 49 #endif
50 50
51 using WebKit::WebCache; 51 using WebKit::WebCache;
52 using WebKit::WebCrossOriginPreflightResultCache; 52 using WebKit::WebCrossOriginPreflightResultCache;
53 using WebKit::WebFontCache; 53 using WebKit::WebFontCache;
54 using WebKit::WebRuntimeFeatures; 54 using WebKit::WebRuntimeFeatures;
55 using content::RenderThread; 55 using content::RenderThread;
56 56
57 namespace { 57 namespace {
58 58
59 static const int kCacheStatsDelayMS = 2000; 59 static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */;
60 60
61 class RendererResourceDelegate : public content::ResourceDispatcherDelegate { 61 class RendererResourceDelegate : public content::ResourceDispatcherDelegate {
62 public: 62 public:
63 RendererResourceDelegate() 63 RendererResourceDelegate()
64 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 64 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
65 } 65 }
66 66
67 virtual webkit_glue::ResourceLoaderBridge::Peer* OnRequestComplete( 67 virtual webkit_glue::ResourceLoaderBridge::Peer* OnRequestComplete(
68 webkit_glue::ResourceLoaderBridge::Peer* current_peer, 68 webkit_glue::ResourceLoaderBridge::Peer* current_peer,
69 ResourceType::Type resource_type, 69 ResourceType::Type resource_type,
70 const net::URLRequestStatus& status) { 70 const net::URLRequestStatus& status) {
71 // Update the browser about our cache. 71 // Update the browser about our cache.
72 // Rate limit informing the host of our cache stats. 72 // Rate limit informing the host of our cache stats.
73 if (!weak_factory_.HasWeakPtrs()) { 73 if (!weak_factory_.HasWeakPtrs()) {
74 MessageLoop::current()->PostDelayedTask( 74 MessageLoop::current()->PostDelayedTask(
75 FROM_HERE, 75 FROM_HERE,
76 base::Bind(&RendererResourceDelegate::InformHostOfCacheStats, 76 base::Bind(&RendererResourceDelegate::InformHostOfCacheStats,
77 weak_factory_.GetWeakPtr()), 77 weak_factory_.GetWeakPtr()),
78 base::TimeDelta::FromMilliseconds(kCacheStatsDelayMS)); 78 kCacheStatsDelayMS);
79 } 79 }
80 80
81 if (status.status() != net::URLRequestStatus::CANCELED || 81 if (status.status() != net::URLRequestStatus::CANCELED ||
82 status.error() == net::ERR_ABORTED) { 82 status.error() == net::ERR_ABORTED) {
83 return NULL; 83 return NULL;
84 } 84 }
85 85
86 // Resource canceled with a specific error are filtered. 86 // Resource canceled with a specific error are filtered.
87 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest( 87 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest(
88 resource_type, current_peer, status.error()); 88 resource_type, current_peer, status.error());
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 if (clear_cache_pending_) { 386 if (clear_cache_pending_) {
387 clear_cache_pending_ = false; 387 clear_cache_pending_ = false;
388 WebCache::clear(); 388 WebCache::clear();
389 } 389 }
390 } 390 }
391 391
392 const RendererContentSettingRules* 392 const RendererContentSettingRules*
393 ChromeRenderProcessObserver::content_setting_rules() const { 393 ChromeRenderProcessObserver::content_setting_rules() const {
394 return &content_setting_rules_; 394 return &content_setting_rules_;
395 } 395 }
OLDNEW
« no previous file with comments | « chrome/renderer/about_handler.cc ('k') | chrome/renderer/chrome_render_view_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698