| 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 ExtensionEventRouterForwarder; | 14 class ExtensionEventRouterForwarder; |
| 15 class ExtensionInfoMap; | 15 class ExtensionInfoMap; |
| 16 class PrefService; | 16 class PrefService; |
| 17 template<class T> class PrefMember; | 17 template<class T> class PrefMember; |
| 18 | 18 |
| 19 typedef PrefMember<bool> BooleanPrefMember; | 19 typedef PrefMember<bool> BooleanPrefMember; |
| 20 | 20 |
| 21 namespace chrome_browser_net { |
| 22 class CacheStats; |
| 23 } |
| 24 |
| 21 namespace policy { | 25 namespace policy { |
| 22 class URLBlacklistManager; | 26 class URLBlacklistManager; |
| 23 } | 27 } |
| 24 | 28 |
| 25 // ChromeNetworkDelegate is the central point from within the chrome code to | 29 // ChromeNetworkDelegate is the central point from within the chrome code to |
| 26 // add hooks into the network stack. | 30 // add hooks into the network stack. |
| 27 class ChromeNetworkDelegate : public net::NetworkDelegate { | 31 class ChromeNetworkDelegate : public net::NetworkDelegate { |
| 28 public: | 32 public: |
| 29 // If |profile| is NULL, events will be broadcasted to all profiles, | 33 // If |profile| is NULL, events will be broadcasted to all profiles, |
| 30 // otherwise they will only be sent to the specified profile. | 34 // otherwise they will only be sent to the specified profile. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual bool OnCanSetCookie(const net::URLRequest& request, | 92 virtual bool OnCanSetCookie(const net::URLRequest& request, |
| 89 const std::string& cookie_line, | 93 const std::string& cookie_line, |
| 90 net::CookieOptions* options) OVERRIDE; | 94 net::CookieOptions* options) OVERRIDE; |
| 91 virtual bool OnCanAccessFile(const net::URLRequest& request, | 95 virtual bool OnCanAccessFile(const net::URLRequest& request, |
| 92 const FilePath& path) const OVERRIDE; | 96 const FilePath& path) const OVERRIDE; |
| 93 virtual bool OnCanThrottleRequest( | 97 virtual bool OnCanThrottleRequest( |
| 94 const net::URLRequest& request) const OVERRIDE; | 98 const net::URLRequest& request) const OVERRIDE; |
| 95 virtual int OnBeforeSocketStreamConnect( | 99 virtual int OnBeforeSocketStreamConnect( |
| 96 net::SocketStream* stream, | 100 net::SocketStream* stream, |
| 97 const net::CompletionCallback& callback) OVERRIDE; | 101 const net::CompletionCallback& callback) OVERRIDE; |
| 102 virtual void OnCacheWaitStateChange(const net::URLRequest& request, |
| 103 CacheWaitState state) OVERRIDE; |
| 98 | 104 |
| 99 scoped_refptr<ExtensionEventRouterForwarder> event_router_; | 105 scoped_refptr<ExtensionEventRouterForwarder> event_router_; |
| 100 void* profile_; | 106 void* profile_; |
| 101 scoped_refptr<CookieSettings> cookie_settings_; | 107 scoped_refptr<CookieSettings> cookie_settings_; |
| 102 | 108 |
| 103 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 109 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 104 | 110 |
| 105 // Weak, owned by our owner. | 111 // Weak, owned by our owner. |
| 106 BooleanPrefMember* enable_referrers_; | 112 BooleanPrefMember* enable_referrers_; |
| 107 | 113 |
| 108 // True if OnCanThrottleRequest should always return false. | 114 // True if OnCanThrottleRequest should always return false. |
| 109 bool never_throttle_requests_; | 115 bool never_throttle_requests_; |
| 110 | 116 |
| 111 // Weak, owned by our owner. | 117 // Weak, owned by our owner. |
| 112 const policy::URLBlacklistManager* url_blacklist_manager_; | 118 const policy::URLBlacklistManager* url_blacklist_manager_; |
| 113 | 119 |
| 114 // When true, allow access to all file:// URLs. | 120 // When true, allow access to all file:// URLs. |
| 115 static bool g_allow_file_access_; | 121 static bool g_allow_file_access_; |
| 116 | 122 |
| 123 chrome_browser_net::CacheStats* cache_stats_; |
| 124 |
| 117 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 125 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 118 }; | 126 }; |
| 119 | 127 |
| 120 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 128 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |