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 #include "base/gtest_prod_util.h" | |
eroman
2012/08/14 16:41:07
Is this necessary?
Jói
2012/08/14 22:17:10
Nope, thanks for catching that. For a while I was
| |
12 | 13 |
13 class CookieSettings; | 14 class CookieSettings; |
14 class ExtensionInfoMap; | 15 class ExtensionInfoMap; |
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; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. | 57 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. |
57 // This method should be called on the UI thread. | 58 // This method should be called on the UI thread. |
58 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, | 59 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, |
59 PrefService* pref_service); | 60 PrefService* pref_service); |
60 | 61 |
61 // When called, all file:// URLs will now be accessible. If this is not | 62 // When called, all file:// URLs will now be accessible. If this is not |
62 // called, then some platforms restrict access to file:// paths. | 63 // called, then some platforms restrict access to file:// paths. |
63 static void AllowAccessToAllFiles(); | 64 static void AllowAccessToAllFiles(); |
64 | 65 |
65 private: | 66 private: |
67 friend class ChromeNetworkDelegateTest; | |
68 | |
66 // NetworkDelegate implementation. | 69 // NetworkDelegate implementation. |
67 virtual int OnBeforeURLRequest(net::URLRequest* request, | 70 virtual int OnBeforeURLRequest(net::URLRequest* request, |
68 const net::CompletionCallback& callback, | 71 const net::CompletionCallback& callback, |
69 GURL* new_url) OVERRIDE; | 72 GURL* new_url) OVERRIDE; |
70 virtual int OnBeforeSendHeaders(net::URLRequest* request, | 73 virtual int OnBeforeSendHeaders(net::URLRequest* request, |
71 const net::CompletionCallback& callback, | 74 const net::CompletionCallback& callback, |
72 net::HttpRequestHeaders* headers) OVERRIDE; | 75 net::HttpRequestHeaders* headers) OVERRIDE; |
73 virtual void OnSendHeaders(net::URLRequest* request, | 76 virtual void OnSendHeaders(net::URLRequest* request, |
74 const net::HttpRequestHeaders& headers) OVERRIDE; | 77 const net::HttpRequestHeaders& headers) OVERRIDE; |
75 virtual int OnHeadersReceived( | 78 virtual int OnHeadersReceived( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 // static anyway since it is based on a command-line flag. | 133 // static anyway since it is based on a command-line flag. |
131 static bool g_never_throttle_requests_; | 134 static bool g_never_throttle_requests_; |
132 | 135 |
133 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. | 136 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. |
134 chrome_browser_net::CacheStats* cache_stats_; | 137 chrome_browser_net::CacheStats* cache_stats_; |
135 | 138 |
136 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 139 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
137 }; | 140 }; |
138 | 141 |
139 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 142 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
OLD | NEW |