| 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" |
| 11 #include "net/base/network_delegate.h" | 11 #include "net/base/network_delegate.h" |
| 12 | 12 |
| 13 class CookieSettings; | 13 class CookieSettings; |
| 14 class ExtensionInfoMap; | 14 class ExtensionInfoMap; |
| 15 class ManagedModeURLFilter; |
| 15 class PrefService; | 16 class PrefService; |
| 16 template<class T> class PrefMember; | 17 template<class T> class PrefMember; |
| 17 | 18 |
| 18 typedef PrefMember<bool> BooleanPrefMember; | 19 typedef PrefMember<bool> BooleanPrefMember; |
| 19 | 20 |
| 20 namespace chrome_browser_net { | 21 namespace chrome_browser_net { |
| 21 class CacheStats; | 22 class CacheStats; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace extensions { | 25 namespace extensions { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 36 // If |profile| is NULL, events will be broadcasted to all profiles, | 37 // If |profile| is NULL, events will be broadcasted to all profiles, |
| 37 // otherwise they will only be sent to the specified profile. | 38 // otherwise they will only be sent to the specified profile. |
| 38 // |enable_referrers| should be initialized on the UI thread (see below) | 39 // |enable_referrers| should be initialized on the UI thread (see below) |
| 39 // beforehand. This object's owner is responsible for cleaning it up at | 40 // beforehand. This object's owner is responsible for cleaning it up at |
| 40 // shutdown. If |cookie_settings| is NULL, all cookies are enabled, | 41 // shutdown. If |cookie_settings| is NULL, all cookies are enabled, |
| 41 // otherwise, the settings are enforced on all observed network requests. | 42 // otherwise, the settings are enforced on all observed network requests. |
| 42 ChromeNetworkDelegate( | 43 ChromeNetworkDelegate( |
| 43 extensions::EventRouterForwarder* event_router, | 44 extensions::EventRouterForwarder* event_router, |
| 44 ExtensionInfoMap* extension_info_map, | 45 ExtensionInfoMap* extension_info_map, |
| 45 const policy::URLBlacklistManager* url_blacklist_manager, | 46 const policy::URLBlacklistManager* url_blacklist_manager, |
| 47 const ManagedModeURLFilter* managed_mode_url_filter, |
| 46 void* profile, | 48 void* profile, |
| 47 CookieSettings* cookie_settings, | 49 CookieSettings* cookie_settings, |
| 48 BooleanPrefMember* enable_referrers, | 50 BooleanPrefMember* enable_referrers, |
| 49 chrome_browser_net::CacheStats* cache_stats); | 51 chrome_browser_net::CacheStats* cache_stats); |
| 50 virtual ~ChromeNetworkDelegate(); | 52 virtual ~ChromeNetworkDelegate(); |
| 51 | 53 |
| 52 // Causes |OnCanThrottleRequest| to always return false, for all | 54 // Causes |OnCanThrottleRequest| to always return false, for all |
| 53 // instances of this object. | 55 // instances of this object. |
| 54 static void NeverThrottleRequests(); | 56 static void NeverThrottleRequests(); |
| 55 | 57 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 scoped_refptr<CookieSettings> cookie_settings_; | 116 scoped_refptr<CookieSettings> cookie_settings_; |
| 115 | 117 |
| 116 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 118 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 117 | 119 |
| 118 // Weak, owned by our owner. | 120 // Weak, owned by our owner. |
| 119 BooleanPrefMember* enable_referrers_; | 121 BooleanPrefMember* enable_referrers_; |
| 120 | 122 |
| 121 // Weak, owned by our owner. | 123 // Weak, owned by our owner. |
| 122 const policy::URLBlacklistManager* url_blacklist_manager_; | 124 const policy::URLBlacklistManager* url_blacklist_manager_; |
| 123 | 125 |
| 126 // Weak pointer. The owner of this object needs to make sure that the |
| 127 // |managed_mode_url_filter_| outlives it. |
| 128 const ManagedModeURLFilter* managed_mode_url_filter_; |
| 129 |
| 124 // When true, allow access to all file:// URLs. | 130 // When true, allow access to all file:// URLs. |
| 125 static bool g_allow_file_access_; | 131 static bool g_allow_file_access_; |
| 126 | 132 |
| 127 // True if OnCanThrottleRequest should always return false. | 133 // True if OnCanThrottleRequest should always return false. |
| 128 // | 134 // |
| 129 // Note: This needs to be static as the instance of | 135 // Note: This needs to be static as the instance of |
| 130 // ChromeNetworkDelegate used may change over time, and we need to | 136 // ChromeNetworkDelegate used may change over time, and we need to |
| 131 // set this variable once at start-up time. It is effectively | 137 // set this variable once at start-up time. It is effectively |
| 132 // static anyway since it is based on a command-line flag. | 138 // static anyway since it is based on a command-line flag. |
| 133 static bool g_never_throttle_requests_; | 139 static bool g_never_throttle_requests_; |
| 134 | 140 |
| 135 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. | 141 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. |
| 136 chrome_browser_net::CacheStats* cache_stats_; | 142 chrome_browser_net::CacheStats* cache_stats_; |
| 137 | 143 |
| 138 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 144 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 139 }; | 145 }; |
| 140 | 146 |
| 141 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 147 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |