| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { | 358 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { |
| 359 DCHECK(IsAlternateProtocolValid(protocol)); | 359 DCHECK(IsAlternateProtocolValid(protocol)); |
| 360 return enabled_protocols_[ | 360 return enabled_protocols_[ |
| 361 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION]; | 361 protocol - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION]; |
| 362 } | 362 } |
| 363 | 363 |
| 364 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { | 364 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { |
| 365 *alpn_protos = next_protos_; | 365 *alpn_protos = next_protos_; |
| 366 } | 366 } |
| 367 | 367 |
| 368 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const { | |
| 369 npn_protos->clear(); | |
| 370 } | |
| 371 | |
| 372 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, | 368 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, |
| 373 SSLConfig* server_config, | 369 SSLConfig* server_config, |
| 374 SSLConfig* proxy_config) const { | 370 SSLConfig* proxy_config) const { |
| 375 ssl_config_service_->GetSSLConfig(server_config); | 371 ssl_config_service_->GetSSLConfig(server_config); |
| 376 GetAlpnProtos(&server_config->alpn_protos); | 372 GetAlpnProtos(&server_config->alpn_protos); |
| 377 GetNpnProtos(&server_config->npn_protos); | |
| 378 *proxy_config = *server_config; | 373 *proxy_config = *server_config; |
| 379 if (request.privacy_mode == PRIVACY_MODE_ENABLED) { | 374 if (request.privacy_mode == PRIVACY_MODE_ENABLED) { |
| 380 server_config->channel_id_enabled = false; | 375 server_config->channel_id_enabled = false; |
| 381 } else if (params_.enable_token_binding && params_.channel_id_service) { | 376 } else if (params_.enable_token_binding && params_.channel_id_service) { |
| 382 server_config->token_binding_params.push_back(TB_PARAM_ECDSAP256); | 377 server_config->token_binding_params.push_back(TB_PARAM_ECDSAP256); |
| 383 } | 378 } |
| 384 } | 379 } |
| 385 | 380 |
| 386 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( | 381 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( |
| 387 SocketPoolType pool_type) { | 382 SocketPoolType pool_type) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 403 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: | 398 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: |
| 404 break; | 399 break; |
| 405 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: | 400 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: |
| 406 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: | 401 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: |
| 407 CloseIdleConnections(); | 402 CloseIdleConnections(); |
| 408 break; | 403 break; |
| 409 } | 404 } |
| 410 } | 405 } |
| 411 | 406 |
| 412 } // namespace net | 407 } // namespace net |
| OLD | NEW |