OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 7057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7068 HttpStreamFactory::set_use_alternate_protocols(false); | 7068 HttpStreamFactory::set_use_alternate_protocols(false); |
7069 } | 7069 } |
7070 | 7070 |
7071 class CapturingProxyResolver : public ProxyResolver { | 7071 class CapturingProxyResolver : public ProxyResolver { |
7072 public: | 7072 public: |
7073 CapturingProxyResolver() : ProxyResolver(false /* expects_pac_bytes */) {} | 7073 CapturingProxyResolver() : ProxyResolver(false /* expects_pac_bytes */) {} |
7074 virtual ~CapturingProxyResolver() {} | 7074 virtual ~CapturingProxyResolver() {} |
7075 | 7075 |
7076 virtual int GetProxyForURL(const GURL& url, | 7076 virtual int GetProxyForURL(const GURL& url, |
7077 ProxyInfo* results, | 7077 ProxyInfo* results, |
7078 OldCompletionCallback* callback, | 7078 const CompletionCallback& callback, |
7079 RequestHandle* request, | 7079 RequestHandle* request, |
7080 const BoundNetLog& net_log) { | 7080 const BoundNetLog& net_log) { |
7081 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP, | 7081 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP, |
7082 HostPortPair("myproxy", 80)); | 7082 HostPortPair("myproxy", 80)); |
7083 results->UseProxyServer(proxy_server); | 7083 results->UseProxyServer(proxy_server); |
7084 resolved_.push_back(url); | 7084 resolved_.push_back(url); |
7085 return OK; | 7085 return OK; |
7086 } | 7086 } |
7087 | 7087 |
7088 virtual void CancelRequest(RequestHandle request) { | 7088 virtual void CancelRequest(RequestHandle request) { |
7089 NOTREACHED(); | 7089 NOTREACHED(); |
7090 } | 7090 } |
7091 | 7091 |
7092 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE { | 7092 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE { |
7093 NOTREACHED(); | 7093 NOTREACHED(); |
7094 return LOAD_STATE_IDLE; | 7094 return LOAD_STATE_IDLE; |
7095 } | 7095 } |
7096 | 7096 |
7097 virtual LoadState GetLoadStateThreadSafe( | 7097 virtual LoadState GetLoadStateThreadSafe( |
7098 RequestHandle request) const OVERRIDE { | 7098 RequestHandle request) const OVERRIDE { |
7099 NOTREACHED(); | 7099 NOTREACHED(); |
7100 return LOAD_STATE_IDLE; | 7100 return LOAD_STATE_IDLE; |
7101 } | 7101 } |
7102 | 7102 |
7103 virtual void CancelSetPacScript() { | 7103 virtual void CancelSetPacScript() { |
7104 NOTREACHED(); | 7104 NOTREACHED(); |
7105 } | 7105 } |
7106 | 7106 |
7107 virtual int SetPacScript(const scoped_refptr<ProxyResolverScriptData>&, | 7107 virtual int SetPacScript(const scoped_refptr<ProxyResolverScriptData>&, |
7108 OldCompletionCallback* /*callback*/) { | 7108 const CompletionCallback& /*callback*/) { |
7109 return OK; | 7109 return OK; |
7110 } | 7110 } |
7111 | 7111 |
7112 const std::vector<GURL>& resolved() const { return resolved_; } | 7112 const std::vector<GURL>& resolved() const { return resolved_; } |
7113 | 7113 |
7114 private: | 7114 private: |
7115 std::vector<GURL> resolved_; | 7115 std::vector<GURL> resolved_; |
7116 | 7116 |
7117 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); | 7117 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); |
7118 }; | 7118 }; |
(...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9452 session->spdy_session_pool()->HasSession(host_port_proxy_pair_b)); | 9452 session->spdy_session_pool()->HasSession(host_port_proxy_pair_b)); |
9453 | 9453 |
9454 HttpStreamFactory::set_next_protos(std::vector<std::string>()); | 9454 HttpStreamFactory::set_next_protos(std::vector<std::string>()); |
9455 ClientSocketPoolManager::set_max_sockets_per_pool(old_max_sockets_per_pool); | 9455 ClientSocketPoolManager::set_max_sockets_per_pool(old_max_sockets_per_pool); |
9456 ClientSocketPoolManager::set_max_sockets_per_proxy_server( | 9456 ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
9457 old_max_sockets_per_proxy_server); | 9457 old_max_sockets_per_proxy_server); |
9458 ClientSocketPoolManager::set_max_sockets_per_group(old_max_sockets_per_group); | 9458 ClientSocketPoolManager::set_max_sockets_per_group(old_max_sockets_per_group); |
9459 } | 9459 } |
9460 | 9460 |
9461 } // namespace net | 9461 } // namespace net |
OLD | NEW |