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

Unified Diff: chrome/browser/net/chrome_network_delegate.h

Issue 10854069: Fix a bad inversion of logic (see OnCanThrottleRequest) and a bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comment. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.h
diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h
index a5fb87d9c3c0d530485d72685e6d53af960ea928..1d4166ebf31a4f05c4dbea642e79722d0cf97268 100644
--- a/chrome/browser/net/chrome_network_delegate.h
+++ b/chrome/browser/net/chrome_network_delegate.h
@@ -49,8 +49,9 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
chrome_browser_net::CacheStats* cache_stats);
virtual ~ChromeNetworkDelegate();
- // Causes |OnCanThrottleRequest| to never return true.
- void NeverThrottleRequests();
+ // Causes |OnCanThrottleRequest| to always return false, for all
+ // instances of this object.
+ static void NeverThrottleRequests();
// Binds |enable_referrers| to |pref_service| and moves it to the IO thread.
// This method should be called on the UI thread.
@@ -115,15 +116,20 @@ class ChromeNetworkDelegate : public net::NetworkDelegate {
// Weak, owned by our owner.
BooleanPrefMember* enable_referrers_;
- // True if OnCanThrottleRequest should always return false.
- bool never_throttle_requests_;
-
// Weak, owned by our owner.
const policy::URLBlacklistManager* url_blacklist_manager_;
// When true, allow access to all file:// URLs.
static bool g_allow_file_access_;
+ // True if OnCanThrottleRequest should always return false.
+ //
+ // Note: This needs to be static as the instance of
+ // ChromeNetworkDelegate used may change over time, and we need to
+ // set this variable once at start-up time. It is effectively
+ // static anyway since it is based on a command-line flag.
+ static bool g_never_throttle_requests_;
+
// Pointer to IOThread global, should outlive ChromeNetworkDelegate.
chrome_browser_net::CacheStats* cache_stats_;
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698