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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.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) 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 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 extensions::EventRouterForwarder* event_router, 43 extensions::EventRouterForwarder* event_router,
44 ExtensionInfoMap* extension_info_map, 44 ExtensionInfoMap* extension_info_map,
45 const policy::URLBlacklistManager* url_blacklist_manager, 45 const policy::URLBlacklistManager* url_blacklist_manager,
46 void* profile, 46 void* profile,
47 CookieSettings* cookie_settings, 47 CookieSettings* cookie_settings,
48 BooleanPrefMember* enable_referrers, 48 BooleanPrefMember* enable_referrers,
49 chrome_browser_net::CacheStats* cache_stats); 49 chrome_browser_net::CacheStats* cache_stats);
50 virtual ~ChromeNetworkDelegate(); 50 virtual ~ChromeNetworkDelegate();
51 51
52 // Causes |OnCanThrottleRequest| to never return true. 52 // Causes |OnCanThrottleRequest| to never return true.
53 void NeverThrottleRequests(); 53 void NeverThrottleRequests();
eroman 2012/08/09 19:04:32 Seems this should be a static method now
Jói 2012/08/09 21:27:40 Done, committing now.
54 54
55 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. 55 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread.
56 // This method should be called on the UI thread. 56 // This method should be called on the UI thread.
57 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, 57 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers,
58 PrefService* pref_service); 58 PrefService* pref_service);
59 59
60 // When called, all file:// URLs will now be accessible. If this is not 60 // When called, all file:// URLs will now be accessible. If this is not
61 // called, then some platforms restrict access to file:// paths. 61 // called, then some platforms restrict access to file:// paths.
62 static void AllowAccessToAllFiles(); 62 static void AllowAccessToAllFiles();
63 63
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 scoped_refptr<extensions::EventRouterForwarder> event_router_; 109 scoped_refptr<extensions::EventRouterForwarder> event_router_;
110 void* profile_; 110 void* profile_;
111 scoped_refptr<CookieSettings> cookie_settings_; 111 scoped_refptr<CookieSettings> cookie_settings_;
112 112
113 scoped_refptr<ExtensionInfoMap> extension_info_map_; 113 scoped_refptr<ExtensionInfoMap> extension_info_map_;
114 114
115 // Weak, owned by our owner. 115 // Weak, owned by our owner.
116 BooleanPrefMember* enable_referrers_; 116 BooleanPrefMember* enable_referrers_;
117 117
118 // True if OnCanThrottleRequest should always return false.
119 bool never_throttle_requests_;
120
121 // Weak, owned by our owner. 118 // Weak, owned by our owner.
122 const policy::URLBlacklistManager* url_blacklist_manager_; 119 const policy::URLBlacklistManager* url_blacklist_manager_;
123 120
124 // When true, allow access to all file:// URLs. 121 // When true, allow access to all file:// URLs.
125 static bool g_allow_file_access_; 122 static bool g_allow_file_access_;
126 123
124 // True if OnCanThrottleRequest should always return false.
125 //
126 // Note: This needs to be static as the instance of
127 // ChromeNetworkDelegate used may change over time, and we need to
128 // set this variable once at start-up time. It is effectively
129 // static anyway since it is based on a command-line flag.
130 static bool g_never_throttle_requests_;
131
127 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. 132 // Pointer to IOThread global, should outlive ChromeNetworkDelegate.
128 chrome_browser_net::CacheStats* cache_stats_; 133 chrome_browser_net::CacheStats* cache_stats_;
129 134
130 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 135 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
131 }; 136 };
132 137
133 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 138 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW
« 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