| 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 "jingle/glue/proxy_resolving_client_socket.h" | 5 #include "jingle/glue/proxy_resolving_client_socket.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
| 16 #include "net/base/ip_address.h" | 16 #include "net/base/ip_address.h" |
| 17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 18 #include "net/http/http_auth_controller.h" | 18 #include "net/http/http_auth_controller.h" |
| 19 #include "net/http/http_network_session.h" | 19 #include "net/http/http_network_session.h" |
| 20 #include "net/http/http_transaction_factory.h" |
| 20 #include "net/http/proxy_client_socket.h" | 21 #include "net/http/proxy_client_socket.h" |
| 21 #include "net/log/net_log_source_type.h" | 22 #include "net/log/net_log_source_type.h" |
| 22 #include "net/socket/client_socket_handle.h" | 23 #include "net/socket/client_socket_handle.h" |
| 23 #include "net/socket/client_socket_pool_manager.h" | 24 #include "net/socket/client_socket_pool_manager.h" |
| 24 #include "net/url_request/url_request_context.h" | 25 #include "net/url_request/url_request_context.h" |
| 25 #include "net/url_request/url_request_context_getter.h" | 26 #include "net/url_request/url_request_context_getter.h" |
| 26 | 27 |
| 27 namespace jingle_glue { | 28 namespace jingle_glue { |
| 28 | 29 |
| 29 ProxyResolvingClientSocket::ProxyResolvingClientSocket( | 30 ProxyResolvingClientSocket::ProxyResolvingClientSocket( |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 session_params.testing_fixed_https_port = | 89 session_params.testing_fixed_https_port = |
| 89 reference_params->testing_fixed_https_port; | 90 reference_params->testing_fixed_https_port; |
| 90 session_params.enable_http2 = reference_params->enable_http2; | 91 session_params.enable_http2 = reference_params->enable_http2; |
| 91 session_params.enable_http2_alternative_service_with_different_host = | 92 session_params.enable_http2_alternative_service_with_different_host = |
| 92 reference_params->enable_http2_alternative_service_with_different_host; | 93 reference_params->enable_http2_alternative_service_with_different_host; |
| 93 session_params.enable_quic_alternative_service_with_different_host = | 94 session_params.enable_quic_alternative_service_with_different_host = |
| 94 reference_params->enable_quic_alternative_service_with_different_host; | 95 reference_params->enable_quic_alternative_service_with_different_host; |
| 95 } | 96 } |
| 96 | 97 |
| 97 network_session_.reset(new net::HttpNetworkSession(session_params)); | 98 network_session_.reset(new net::HttpNetworkSession(session_params)); |
| 99 |
| 100 net::HttpAuthCache* other_auth_cache = |
| 101 request_context->http_transaction_factory() |
| 102 ->GetSession() |
| 103 ->http_auth_cache(); |
| 104 DCHECK(other_auth_cache); |
| 105 network_session_->http_auth_cache()->UpdateAllFrom(*other_auth_cache); |
| 98 } | 106 } |
| 99 | 107 |
| 100 ProxyResolvingClientSocket::~ProxyResolvingClientSocket() { | 108 ProxyResolvingClientSocket::~ProxyResolvingClientSocket() { |
| 101 Disconnect(); | 109 Disconnect(); |
| 102 } | 110 } |
| 103 | 111 |
| 104 int ProxyResolvingClientSocket::Read(net::IOBuffer* buf, int buf_len, | 112 int ProxyResolvingClientSocket::Read(net::IOBuffer* buf, int buf_len, |
| 105 const net::CompletionCallback& callback) { | 113 const net::CompletionCallback& callback) { |
| 106 if (transport_.get() && transport_->socket()) | 114 if (transport_.get() && transport_->socket()) |
| 107 return transport_->socket()->Read(buf, buf_len, callback); | 115 return transport_->socket()->Read(buf, buf_len, callback); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 return 0; | 431 return 0; |
| 424 } | 432 } |
| 425 | 433 |
| 426 void ProxyResolvingClientSocket::CloseTransportSocket() { | 434 void ProxyResolvingClientSocket::CloseTransportSocket() { |
| 427 if (transport_.get() && transport_->socket()) | 435 if (transport_.get() && transport_->socket()) |
| 428 transport_->socket()->Disconnect(); | 436 transport_->socket()->Disconnect(); |
| 429 transport_.reset(); | 437 transport_.reset(); |
| 430 } | 438 } |
| 431 | 439 |
| 432 } // namespace jingle_glue | 440 } // namespace jingle_glue |
| OLD | NEW |