| 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 <inttypes.h> | 7 #include <inttypes.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 return http2_settings; | 99 return http2_settings; |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // unnamed namespace | 102 } // unnamed namespace |
| 103 | 103 |
| 104 HttpNetworkSession::Params::Params() | 104 HttpNetworkSession::Params::Params() |
| 105 : client_socket_factory(nullptr), | 105 : client_socket_factory(nullptr), |
| 106 host_resolver(nullptr), | 106 host_resolver(nullptr), |
| 107 cert_verifier(nullptr), | 107 cert_verifier(nullptr), |
| 108 enable_server_push_cancellation(false), | |
| 109 channel_id_service(nullptr), | 108 channel_id_service(nullptr), |
| 110 transport_security_state(nullptr), | 109 transport_security_state(nullptr), |
| 111 cert_transparency_verifier(nullptr), | 110 cert_transparency_verifier(nullptr), |
| 112 ct_policy_enforcer(nullptr), | 111 ct_policy_enforcer(nullptr), |
| 113 proxy_service(nullptr), | 112 proxy_service(nullptr), |
| 114 ssl_config_service(nullptr), | 113 ssl_config_service(nullptr), |
| 115 http_auth_handler_factory(nullptr), | 114 http_auth_handler_factory(nullptr), |
| 116 net_log(nullptr), | 115 net_log(nullptr), |
| 117 host_mapping_rules(nullptr), | 116 host_mapping_rules(nullptr), |
| 118 socket_performance_watcher_factory(nullptr), | 117 socket_performance_watcher_factory(nullptr), |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 return params_.enable_http2; | 391 return params_.enable_http2; |
| 393 case kProtoQUIC: | 392 case kProtoQUIC: |
| 394 return IsQuicEnabled(); | 393 return IsQuicEnabled(); |
| 395 } | 394 } |
| 396 NOTREACHED(); | 395 NOTREACHED(); |
| 397 return false; | 396 return false; |
| 398 } | 397 } |
| 399 | 398 |
| 400 void HttpNetworkSession::SetServerPushDelegate( | 399 void HttpNetworkSession::SetServerPushDelegate( |
| 401 std::unique_ptr<ServerPushDelegate> push_delegate) { | 400 std::unique_ptr<ServerPushDelegate> push_delegate) { |
| 402 DCHECK(push_delegate); | 401 DCHECK(!push_delegate_ && push_delegate); |
| 403 if (!params_.enable_server_push_cancellation || push_delegate_) | |
| 404 return; | |
| 405 | 402 |
| 406 push_delegate_ = std::move(push_delegate); | 403 push_delegate_ = std::move(push_delegate); |
| 407 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); | 404 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); |
| 408 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); | 405 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); |
| 409 } | 406 } |
| 410 | 407 |
| 411 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { | 408 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { |
| 412 *alpn_protos = next_protos_; | 409 *alpn_protos = next_protos_; |
| 413 } | 410 } |
| 414 | 411 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 CloseIdleConnections(); | 484 CloseIdleConnections(); |
| 488 break; | 485 break; |
| 489 } | 486 } |
| 490 } | 487 } |
| 491 | 488 |
| 492 void HttpNetworkSession::OnPurgeMemory() { | 489 void HttpNetworkSession::OnPurgeMemory() { |
| 493 CloseIdleConnections(); | 490 CloseIdleConnections(); |
| 494 } | 491 } |
| 495 | 492 |
| 496 } // namespace net | 493 } // namespace net |
| OLD | NEW |