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