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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.h

Issue 10828333: Merge 150928 - Fix a bad inversion of logic (see OnCanThrottleRequest) and a bug (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/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 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 24 matching lines...) Expand all
35 // otherwise, the settings are enforced on all observed network requests. 35 // otherwise, the settings are enforced on all observed network requests.
36 ChromeNetworkDelegate( 36 ChromeNetworkDelegate(
37 ExtensionEventRouterForwarder* event_router, 37 ExtensionEventRouterForwarder* event_router,
38 ExtensionInfoMap* extension_info_map, 38 ExtensionInfoMap* extension_info_map,
39 const policy::URLBlacklistManager* url_blacklist_manager, 39 const policy::URLBlacklistManager* url_blacklist_manager,
40 void* profile, 40 void* profile,
41 CookieSettings* cookie_settings, 41 CookieSettings* cookie_settings,
42 BooleanPrefMember* enable_referrers); 42 BooleanPrefMember* enable_referrers);
43 virtual ~ChromeNetworkDelegate(); 43 virtual ~ChromeNetworkDelegate();
44 44
45 // Causes |OnCanThrottleRequest| to never return true. 45 // Causes |OnCanThrottleRequest| to always return false, for all
46 void NeverThrottleRequests(); 46 // instances of this object.
47 static void NeverThrottleRequests();
47 48
48 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. 49 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread.
49 // This method should be called on the UI thread. 50 // This method should be called on the UI thread.
50 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, 51 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers,
51 PrefService* pref_service); 52 PrefService* pref_service);
52 53
53 // When called, all file:// URLs will now be accessible. If this is not 54 // When called, all file:// URLs will now be accessible. If this is not
54 // called, then some platforms restrict access to file:// paths. 55 // called, then some platforms restrict access to file:// paths.
55 static void AllowAccessToAllFiles(); 56 static void AllowAccessToAllFiles();
56 57
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 100
100 scoped_refptr<ExtensionEventRouterForwarder> event_router_; 101 scoped_refptr<ExtensionEventRouterForwarder> event_router_;
101 void* profile_; 102 void* profile_;
102 scoped_refptr<CookieSettings> cookie_settings_; 103 scoped_refptr<CookieSettings> cookie_settings_;
103 104
104 scoped_refptr<ExtensionInfoMap> extension_info_map_; 105 scoped_refptr<ExtensionInfoMap> extension_info_map_;
105 106
106 // Weak, owned by our owner. 107 // Weak, owned by our owner.
107 BooleanPrefMember* enable_referrers_; 108 BooleanPrefMember* enable_referrers_;
108 109
109 // True if OnCanThrottleRequest should always return false.
110 bool never_throttle_requests_;
111
112 // Weak, owned by our owner. 110 // Weak, owned by our owner.
113 const policy::URLBlacklistManager* url_blacklist_manager_; 111 const policy::URLBlacklistManager* url_blacklist_manager_;
114 112
115 // When true, allow access to all file:// URLs. 113 // When true, allow access to all file:// URLs.
116 static bool g_allow_file_access_; 114 static bool g_allow_file_access_;
117 115
116 // True if OnCanThrottleRequest should always return false.
117 //
118 // Note: This needs to be static as the instance of
119 // ChromeNetworkDelegate used may change over time, and we need to
120 // set this variable once at start-up time. It is effectively
121 // static anyway since it is based on a command-line flag.
122 static bool g_never_throttle_requests_;
123
118 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 124 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
119 }; 125 };
120 126
121 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 127 #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