| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 HttpNetworkSession::Params::~Params() {} | 137 HttpNetworkSession::Params::~Params() {} |
| 138 | 138 |
| 139 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. | 139 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. |
| 140 HttpNetworkSession::HttpNetworkSession(const Params& params) | 140 HttpNetworkSession::HttpNetworkSession(const Params& params) |
| 141 : net_log_(params.net_log), | 141 : net_log_(params.net_log), |
| 142 http_server_properties_(params.http_server_properties), | 142 http_server_properties_(params.http_server_properties), |
| 143 cert_verifier_(params.cert_verifier), | 143 cert_verifier_(params.cert_verifier), |
| 144 http_auth_handler_factory_(params.http_auth_handler_factory), | 144 http_auth_handler_factory_(params.http_auth_handler_factory), |
| 145 proxy_service_(params.proxy_service), | 145 proxy_service_(params.proxy_service), |
| 146 ssl_config_service_(params.ssl_config_service), | 146 ssl_config_service_(params.ssl_config_service), |
| 147 push_delegate_(nullptr), |
| 147 quic_stream_factory_( | 148 quic_stream_factory_( |
| 148 params.net_log, | 149 params.net_log, |
| 149 params.host_resolver, | 150 params.host_resolver, |
| 150 params.ssl_config_service, | 151 params.ssl_config_service, |
| 151 params.client_socket_factory | 152 params.client_socket_factory |
| 152 ? params.client_socket_factory | 153 ? params.client_socket_factory |
| 153 : ClientSocketFactory::GetDefaultFactory(), | 154 : ClientSocketFactory::GetDefaultFactory(), |
| 154 params.http_server_properties, | 155 params.http_server_properties, |
| 155 params.proxy_delegate, | 156 params.proxy_delegate, |
| 156 params.cert_verifier, | 157 params.cert_verifier, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 return true; | 358 return true; |
| 358 case kProtoHTTP2: | 359 case kProtoHTTP2: |
| 359 return params_.enable_http2; | 360 return params_.enable_http2; |
| 360 case kProtoQUIC: | 361 case kProtoQUIC: |
| 361 return params_.enable_quic; | 362 return params_.enable_quic; |
| 362 } | 363 } |
| 363 NOTREACHED(); | 364 NOTREACHED(); |
| 364 return false; | 365 return false; |
| 365 } | 366 } |
| 366 | 367 |
| 368 void HttpNetworkSession::SetServerPushDelegate( |
| 369 std::unique_ptr<ServerPushDelegate> push_delegate) { |
| 370 DCHECK(!push_delegate_ && push_delegate); |
| 371 |
| 372 push_delegate_ = std::move(push_delegate); |
| 373 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); |
| 374 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); |
| 375 } |
| 376 |
| 367 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { | 377 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { |
| 368 *alpn_protos = next_protos_; | 378 *alpn_protos = next_protos_; |
| 369 } | 379 } |
| 370 | 380 |
| 371 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, | 381 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, |
| 372 SSLConfig* server_config, | 382 SSLConfig* server_config, |
| 373 SSLConfig* proxy_config) const { | 383 SSLConfig* proxy_config) const { |
| 374 ssl_config_service_->GetSSLConfig(server_config); | 384 ssl_config_service_->GetSSLConfig(server_config); |
| 375 GetAlpnProtos(&server_config->alpn_protos); | 385 GetAlpnProtos(&server_config->alpn_protos); |
| 376 *proxy_config = *server_config; | 386 *proxy_config = *server_config; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 break; | 429 break; |
| 420 case base::MemoryState::SUSPENDED: | 430 case base::MemoryState::SUSPENDED: |
| 421 // Note: Not supported at present. Fall through. | 431 // Note: Not supported at present. Fall through. |
| 422 case base::MemoryState::UNKNOWN: | 432 case base::MemoryState::UNKNOWN: |
| 423 NOTREACHED(); | 433 NOTREACHED(); |
| 424 break; | 434 break; |
| 425 } | 435 } |
| 426 } | 436 } |
| 427 | 437 |
| 428 } // namespace net | 438 } // namespace net |
| OLD | NEW |