| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 ChromeNetworkDelegate( | 42 ChromeNetworkDelegate( |
| 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 always return false, for all |
| 53 void NeverThrottleRequests(); | 53 // instances of this object. |
| 54 static void NeverThrottleRequests(); |
| 54 | 55 |
| 55 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. | 56 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. |
| 56 // This method should be called on the UI thread. | 57 // This method should be called on the UI thread. |
| 57 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, | 58 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, |
| 58 PrefService* pref_service); | 59 PrefService* pref_service); |
| 59 | 60 |
| 60 // When called, all file:// URLs will now be accessible. If this is not | 61 // When called, all file:// URLs will now be accessible. If this is not |
| 61 // called, then some platforms restrict access to file:// paths. | 62 // called, then some platforms restrict access to file:// paths. |
| 62 static void AllowAccessToAllFiles(); | 63 static void AllowAccessToAllFiles(); |
| 63 | 64 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 109 |
| 109 scoped_refptr<extensions::EventRouterForwarder> event_router_; | 110 scoped_refptr<extensions::EventRouterForwarder> event_router_; |
| 110 void* profile_; | 111 void* profile_; |
| 111 scoped_refptr<CookieSettings> cookie_settings_; | 112 scoped_refptr<CookieSettings> cookie_settings_; |
| 112 | 113 |
| 113 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 114 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 114 | 115 |
| 115 // Weak, owned by our owner. | 116 // Weak, owned by our owner. |
| 116 BooleanPrefMember* enable_referrers_; | 117 BooleanPrefMember* enable_referrers_; |
| 117 | 118 |
| 118 // True if OnCanThrottleRequest should always return false. | |
| 119 bool never_throttle_requests_; | |
| 120 | |
| 121 // Weak, owned by our owner. | 119 // Weak, owned by our owner. |
| 122 const policy::URLBlacklistManager* url_blacklist_manager_; | 120 const policy::URLBlacklistManager* url_blacklist_manager_; |
| 123 | 121 |
| 124 // When true, allow access to all file:// URLs. | 122 // When true, allow access to all file:// URLs. |
| 125 static bool g_allow_file_access_; | 123 static bool g_allow_file_access_; |
| 126 | 124 |
| 125 // True if OnCanThrottleRequest should always return false. |
| 126 // |
| 127 // Note: This needs to be static as the instance of |
| 128 // ChromeNetworkDelegate used may change over time, and we need to |
| 129 // set this variable once at start-up time. It is effectively |
| 130 // static anyway since it is based on a command-line flag. |
| 131 static bool g_never_throttle_requests_; |
| 132 |
| 127 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. | 133 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. |
| 128 chrome_browser_net::CacheStats* cache_stats_; | 134 chrome_browser_net::CacheStats* cache_stats_; |
| 129 | 135 |
| 130 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 136 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 131 }; | 137 }; |
| 132 | 138 |
| 133 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 139 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |