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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 BooleanPrefMember* force_safe_search, | 129 BooleanPrefMember* force_safe_search, |
130 BooleanPrefMember* force_google_safe_search, | 130 BooleanPrefMember* force_google_safe_search, |
131 BooleanPrefMember* force_youtube_safety_mode, | 131 BooleanPrefMember* force_youtube_safety_mode, |
132 PrefService* pref_service); | 132 PrefService* pref_service); |
133 | 133 |
134 // When called, all file:// URLs will now be accessible. If this is not | 134 // When called, all file:// URLs will now be accessible. If this is not |
135 // called, then some platforms restrict access to file:// paths. | 135 // called, then some platforms restrict access to file:// paths. |
136 static void AllowAccessToAllFiles(); | 136 static void AllowAccessToAllFiles(); |
137 | 137 |
138 private: | 138 private: |
139 friend class ChromeNetworkDelegateThrottlingTest; | 139 friend class ChromeNetworkDelegateTest; |
Mike West
2015/03/26 21:11:59
I shouldn't have changed this back. :/
| |
140 | 140 |
141 // NetworkDelegate implementation. | 141 // NetworkDelegate implementation. |
142 int OnBeforeURLRequest(net::URLRequest* request, | 142 int OnBeforeURLRequest(net::URLRequest* request, |
143 const net::CompletionCallback& callback, | 143 const net::CompletionCallback& callback, |
144 GURL* new_url) override; | 144 GURL* new_url) override; |
145 int OnBeforeSendHeaders(net::URLRequest* request, | 145 int OnBeforeSendHeaders(net::URLRequest* request, |
146 const net::CompletionCallback& callback, | 146 const net::CompletionCallback& callback, |
147 net::HttpRequestHeaders* headers) override; | 147 net::HttpRequestHeaders* headers) override; |
148 void OnSendHeaders(net::URLRequest* request, | 148 void OnSendHeaders(net::URLRequest* request, |
149 const net::HttpRequestHeaders& headers) override; | 149 const net::HttpRequestHeaders& headers) override; |
(...skipping 19 matching lines...) Expand all Loading... | |
169 const net::CookieList& cookie_list) override; | 169 const net::CookieList& cookie_list) override; |
170 bool OnCanSetCookie(const net::URLRequest& request, | 170 bool OnCanSetCookie(const net::URLRequest& request, |
171 const std::string& cookie_line, | 171 const std::string& cookie_line, |
172 net::CookieOptions* options) override; | 172 net::CookieOptions* options) override; |
173 bool OnCanAccessFile(const net::URLRequest& request, | 173 bool OnCanAccessFile(const net::URLRequest& request, |
174 const base::FilePath& path) const override; | 174 const base::FilePath& path) const override; |
175 bool OnCanThrottleRequest(const net::URLRequest& request) const override; | 175 bool OnCanThrottleRequest(const net::URLRequest& request) const override; |
176 bool OnCanEnablePrivacyMode( | 176 bool OnCanEnablePrivacyMode( |
177 const GURL& url, | 177 const GURL& url, |
178 const GURL& first_party_for_cookies) const override; | 178 const GURL& first_party_for_cookies) const override; |
179 bool OnFirstPartyOnlyCookieExperimentEnabled() const override; | |
180 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 179 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
181 const net::URLRequest& request, | 180 const net::URLRequest& request, |
182 const GURL& target_url, | 181 const GURL& target_url, |
183 const GURL& referrer_url) const override; | 182 const GURL& referrer_url) const override; |
184 | 183 |
185 void AccumulateContentLength( | 184 void AccumulateContentLength( |
186 int64 received_payload_byte_count, | 185 int64 received_payload_byte_count, |
187 int64 original_payload_byte_count); | 186 int64 original_payload_byte_count); |
188 | 187 |
189 scoped_ptr<ChromeExtensionsNetworkDelegate> extensions_delegate_; | 188 scoped_ptr<ChromeExtensionsNetworkDelegate> extensions_delegate_; |
(...skipping 21 matching lines...) Expand all Loading... | |
211 static bool g_allow_file_access_; | 210 static bool g_allow_file_access_; |
212 | 211 |
213 // True if OnCanThrottleRequest should always return false. | 212 // True if OnCanThrottleRequest should always return false. |
214 // | 213 // |
215 // Note: This needs to be static as the instance of | 214 // Note: This needs to be static as the instance of |
216 // ChromeNetworkDelegate used may change over time, and we need to | 215 // ChromeNetworkDelegate used may change over time, and we need to |
217 // set this variable once at start-up time. It is effectively | 216 // set this variable once at start-up time. It is effectively |
218 // static anyway since it is based on a command-line flag. | 217 // static anyway since it is based on a command-line flag. |
219 static bool g_never_throttle_requests_; | 218 static bool g_never_throttle_requests_; |
220 | 219 |
221 bool experimental_web_platform_features_enabled_; | |
222 | |
223 bool first_request_; | 220 bool first_request_; |
224 | 221 |
225 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 222 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
226 }; | 223 }; |
227 | 224 |
228 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 225 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
OLD | NEW |