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 #include "net/proxy/proxy_service.h" | 5 #include "net/proxy/proxy_service.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 void OnFallback(const ProxyServer& bad_proxy, int net_error) override {} | 216 void OnFallback(const ProxyServer& bad_proxy, int net_error) override {} |
217 void OnBeforeTunnelRequest(const HostPortPair& proxy_server, | 217 void OnBeforeTunnelRequest(const HostPortPair& proxy_server, |
218 HttpRequestHeaders* extra_headers) override {} | 218 HttpRequestHeaders* extra_headers) override {} |
219 void OnTunnelHeadersReceived( | 219 void OnTunnelHeadersReceived( |
220 const HostPortPair& origin, | 220 const HostPortPair& origin, |
221 const HostPortPair& proxy_server, | 221 const HostPortPair& proxy_server, |
222 const HttpResponseHeaders& response_headers) override {} | 222 const HttpResponseHeaders& response_headers) override {} |
223 bool IsTrustedSpdyProxy(const net::ProxyServer& proxy_server) override { | 223 bool IsTrustedSpdyProxy(const net::ProxyServer& proxy_server) override { |
224 return true; | 224 return true; |
225 } | 225 } |
| 226 void GetAlternativeProxy( |
| 227 const GURL& url, |
| 228 const ProxyServer& resolved_proxy_server, |
| 229 ProxyServer* alternative_proxy_server) const override {} |
| 230 void OnAlternativeProxyBroken( |
| 231 const ProxyServer& alternative_proxy_server) override {} |
226 | 232 |
227 private: | 233 private: |
228 bool on_resolve_proxy_called_; | 234 bool on_resolve_proxy_called_; |
229 bool add_proxy_; | 235 bool add_proxy_; |
230 bool remove_proxy_; | 236 bool remove_proxy_; |
231 std::string method_; | 237 std::string method_; |
232 const ProxyService* proxy_service_; | 238 const ProxyService* proxy_service_; |
233 }; | 239 }; |
234 | 240 |
235 // A test network delegate that exercises the OnProxyFallback callback. | 241 // A test network delegate that exercises the OnProxyFallback callback. |
(...skipping 17 matching lines...) Expand all Loading... |
253 } | 259 } |
254 void OnBeforeTunnelRequest(const HostPortPair& proxy_server, | 260 void OnBeforeTunnelRequest(const HostPortPair& proxy_server, |
255 HttpRequestHeaders* extra_headers) override {} | 261 HttpRequestHeaders* extra_headers) override {} |
256 void OnTunnelHeadersReceived( | 262 void OnTunnelHeadersReceived( |
257 const HostPortPair& origin, | 263 const HostPortPair& origin, |
258 const HostPortPair& proxy_server, | 264 const HostPortPair& proxy_server, |
259 const HttpResponseHeaders& response_headers) override {} | 265 const HttpResponseHeaders& response_headers) override {} |
260 bool IsTrustedSpdyProxy(const net::ProxyServer& proxy_server) override { | 266 bool IsTrustedSpdyProxy(const net::ProxyServer& proxy_server) override { |
261 return true; | 267 return true; |
262 } | 268 } |
| 269 void GetAlternativeProxy( |
| 270 const GURL& url, |
| 271 const ProxyServer& resolved_proxy_server, |
| 272 ProxyServer* alternative_proxy_server) const override {} |
| 273 void OnAlternativeProxyBroken( |
| 274 const ProxyServer& alternative_proxy_server) override {} |
263 | 275 |
264 bool on_proxy_fallback_called() const { | 276 bool on_proxy_fallback_called() const { |
265 return on_proxy_fallback_called_; | 277 return on_proxy_fallback_called_; |
266 } | 278 } |
267 | 279 |
268 const ProxyServer& proxy_server() const { | 280 const ProxyServer& proxy_server() const { |
269 return proxy_server_; | 281 return proxy_server_; |
270 } | 282 } |
271 | 283 |
272 int proxy_fallback_net_error() const { | 284 int proxy_fallback_net_error() const { |
(...skipping 3380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3653 GURL(test.sanitized_url_unstripped), | 3665 GURL(test.sanitized_url_unstripped), |
3654 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::UNSAFE)); | 3666 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::UNSAFE)); |
3655 | 3667 |
3656 EXPECT_EQ( | 3668 EXPECT_EQ( |
3657 GURL(test.sanitized_url), | 3669 GURL(test.sanitized_url), |
3658 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::SAFE)); | 3670 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::SAFE)); |
3659 } | 3671 } |
3660 } | 3672 } |
3661 | 3673 |
3662 } // namespace net | 3674 } // namespace net |
OLD | NEW |