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), |
108 channel_id_service(nullptr), | 109 channel_id_service(nullptr), |
109 transport_security_state(nullptr), | 110 transport_security_state(nullptr), |
110 cert_transparency_verifier(nullptr), | 111 cert_transparency_verifier(nullptr), |
111 ct_policy_enforcer(nullptr), | 112 ct_policy_enforcer(nullptr), |
112 proxy_service(nullptr), | 113 proxy_service(nullptr), |
113 ssl_config_service(nullptr), | 114 ssl_config_service(nullptr), |
114 http_auth_handler_factory(nullptr), | 115 http_auth_handler_factory(nullptr), |
115 net_log(nullptr), | 116 net_log(nullptr), |
116 host_mapping_rules(nullptr), | 117 host_mapping_rules(nullptr), |
117 socket_performance_watcher_factory(nullptr), | 118 socket_performance_watcher_factory(nullptr), |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 return params_.enable_http2; | 390 return params_.enable_http2; |
390 case kProtoQUIC: | 391 case kProtoQUIC: |
391 return IsQuicEnabled(); | 392 return IsQuicEnabled(); |
392 } | 393 } |
393 NOTREACHED(); | 394 NOTREACHED(); |
394 return false; | 395 return false; |
395 } | 396 } |
396 | 397 |
397 void HttpNetworkSession::SetServerPushDelegate( | 398 void HttpNetworkSession::SetServerPushDelegate( |
398 std::unique_ptr<ServerPushDelegate> push_delegate) { | 399 std::unique_ptr<ServerPushDelegate> push_delegate) { |
399 DCHECK(!push_delegate_ && push_delegate); | 400 DCHECK(push_delegate); |
| 401 if (!params_.enable_server_push_cancellation || push_delegate_) |
| 402 return; |
400 | 403 |
401 push_delegate_ = std::move(push_delegate); | 404 push_delegate_ = std::move(push_delegate); |
402 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); | 405 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); |
403 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); | 406 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); |
404 } | 407 } |
405 | 408 |
406 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { | 409 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { |
407 *alpn_protos = next_protos_; | 410 *alpn_protos = next_protos_; |
408 } | 411 } |
409 | 412 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 CloseIdleConnections(); | 485 CloseIdleConnections(); |
483 break; | 486 break; |
484 } | 487 } |
485 } | 488 } |
486 | 489 |
487 void HttpNetworkSession::OnPurgeMemory() { | 490 void HttpNetworkSession::OnPurgeMemory() { |
488 CloseIdleConnections(); | 491 CloseIdleConnections(); |
489 } | 492 } |
490 | 493 |
491 } // namespace net | 494 } // namespace net |
OLD | NEW |