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 45 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. | 56 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. |
57 // This method should be called on the UI thread. | 57 // This method should be called on the UI thread. |
58 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, | 58 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, |
59 PrefService* pref_service); | 59 PrefService* pref_service); |
60 | 60 |
61 // 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 |
62 // called, then some platforms restrict access to file:// paths. | 62 // called, then some platforms restrict access to file:// paths. |
63 static void AllowAccessToAllFiles(); | 63 static void AllowAccessToAllFiles(); |
64 | 64 |
65 private: | 65 private: |
| 66 friend class ChromeNetworkDelegateTest; |
| 67 |
66 // NetworkDelegate implementation. | 68 // NetworkDelegate implementation. |
67 virtual int OnBeforeURLRequest(net::URLRequest* request, | 69 virtual int OnBeforeURLRequest(net::URLRequest* request, |
68 const net::CompletionCallback& callback, | 70 const net::CompletionCallback& callback, |
69 GURL* new_url) OVERRIDE; | 71 GURL* new_url) OVERRIDE; |
70 virtual int OnBeforeSendHeaders(net::URLRequest* request, | 72 virtual int OnBeforeSendHeaders(net::URLRequest* request, |
71 const net::CompletionCallback& callback, | 73 const net::CompletionCallback& callback, |
72 net::HttpRequestHeaders* headers) OVERRIDE; | 74 net::HttpRequestHeaders* headers) OVERRIDE; |
73 virtual void OnSendHeaders(net::URLRequest* request, | 75 virtual void OnSendHeaders(net::URLRequest* request, |
74 const net::HttpRequestHeaders& headers) OVERRIDE; | 76 const net::HttpRequestHeaders& headers) OVERRIDE; |
75 virtual int OnHeadersReceived( | 77 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. | 132 // static anyway since it is based on a command-line flag. |
131 static bool g_never_throttle_requests_; | 133 static bool g_never_throttle_requests_; |
132 | 134 |
133 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. | 135 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. |
134 chrome_browser_net::CacheStats* cache_stats_; | 136 chrome_browser_net::CacheStats* cache_stats_; |
135 | 137 |
136 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 138 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
137 }; | 139 }; |
138 | 140 |
139 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 141 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
OLD | NEW |