| 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/http/http_network_session.h" | 5 #include "net/http/http_network_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 HttpNetworkSession::Params::~Params() {} | 139 HttpNetworkSession::Params::~Params() {} |
| 140 | 140 |
| 141 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. | 141 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. |
| 142 HttpNetworkSession::HttpNetworkSession(const Params& params) | 142 HttpNetworkSession::HttpNetworkSession(const Params& params) |
| 143 : net_log_(params.net_log), | 143 : net_log_(params.net_log), |
| 144 http_server_properties_(params.http_server_properties), | 144 http_server_properties_(params.http_server_properties), |
| 145 cert_verifier_(params.cert_verifier), | 145 cert_verifier_(params.cert_verifier), |
| 146 http_auth_handler_factory_(params.http_auth_handler_factory), | 146 http_auth_handler_factory_(params.http_auth_handler_factory), |
| 147 proxy_service_(params.proxy_service), | 147 proxy_service_(params.proxy_service), |
| 148 ssl_config_service_(params.ssl_config_service), | 148 ssl_config_service_(params.ssl_config_service), |
| 149 push_delegate_(nullptr), |
| 149 quic_stream_factory_( | 150 quic_stream_factory_( |
| 150 params.net_log, | 151 params.net_log, |
| 151 params.host_resolver, | 152 params.host_resolver, |
| 152 params.ssl_config_service, | 153 params.ssl_config_service, |
| 153 params.client_socket_factory | 154 params.client_socket_factory |
| 154 ? params.client_socket_factory | 155 ? params.client_socket_factory |
| 155 : ClientSocketFactory::GetDefaultFactory(), | 156 : ClientSocketFactory::GetDefaultFactory(), |
| 156 params.http_server_properties, | 157 params.http_server_properties, |
| 157 params.proxy_delegate, | 158 params.proxy_delegate, |
| 158 params.cert_verifier, | 159 params.cert_verifier, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 return true; | 357 return true; |
| 357 case kProtoHTTP2: | 358 case kProtoHTTP2: |
| 358 return params_.enable_http2; | 359 return params_.enable_http2; |
| 359 case kProtoQUIC: | 360 case kProtoQUIC: |
| 360 return params_.enable_quic; | 361 return params_.enable_quic; |
| 361 } | 362 } |
| 362 NOTREACHED(); | 363 NOTREACHED(); |
| 363 return false; | 364 return false; |
| 364 } | 365 } |
| 365 | 366 |
| 367 void HttpNetworkSession::SetServerPushDelegate( |
| 368 std::unique_ptr<ServerPushDelegate> push_delegate) { |
| 369 DCHECK(!push_delegate_ && push_delegate); |
| 370 |
| 371 push_delegate_ = std::move(push_delegate); |
| 372 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); |
| 373 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); |
| 374 } |
| 375 |
| 366 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { | 376 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { |
| 367 *alpn_protos = next_protos_; | 377 *alpn_protos = next_protos_; |
| 368 } | 378 } |
| 369 | 379 |
| 370 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, | 380 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, |
| 371 SSLConfig* server_config, | 381 SSLConfig* server_config, |
| 372 SSLConfig* proxy_config) const { | 382 SSLConfig* proxy_config) const { |
| 373 ssl_config_service_->GetSSLConfig(server_config); | 383 ssl_config_service_->GetSSLConfig(server_config); |
| 374 GetAlpnProtos(&server_config->alpn_protos); | 384 GetAlpnProtos(&server_config->alpn_protos); |
| 375 *proxy_config = *server_config; | 385 *proxy_config = *server_config; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 break; | 453 break; |
| 444 case base::MemoryState::SUSPENDED: | 454 case base::MemoryState::SUSPENDED: |
| 445 // Note: Not supported at present. Fall through. | 455 // Note: Not supported at present. Fall through. |
| 446 case base::MemoryState::UNKNOWN: | 456 case base::MemoryState::UNKNOWN: |
| 447 NOTREACHED(); | 457 NOTREACHED(); |
| 448 break; | 458 break; |
| 449 } | 459 } |
| 450 } | 460 } |
| 451 | 461 |
| 452 } // namespace net | 462 } // namespace net |
| OLD | NEW |