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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 return params_.enable_http2; | 389 return params_.enable_http2; |
390 case kProtoQUIC: | 390 case kProtoQUIC: |
391 return IsQuicEnabled(); | 391 return IsQuicEnabled(); |
392 } | 392 } |
393 NOTREACHED(); | 393 NOTREACHED(); |
394 return false; | 394 return false; |
395 } | 395 } |
396 | 396 |
397 void HttpNetworkSession::SetServerPushDelegate( | 397 void HttpNetworkSession::SetServerPushDelegate( |
398 std::unique_ptr<ServerPushDelegate> push_delegate) { | 398 std::unique_ptr<ServerPushDelegate> push_delegate) { |
399 DCHECK(!push_delegate_ && push_delegate); | 399 DCHECK(push_delegate); |
| 400 if (!params_.enable_server_push_cancellation || push_delegate_) |
| 401 return; |
400 | 402 |
401 push_delegate_ = std::move(push_delegate); | 403 push_delegate_ = std::move(push_delegate); |
402 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); | 404 spdy_session_pool_.set_server_push_delegate(push_delegate_.get()); |
403 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); | 405 quic_stream_factory_.set_server_push_delegate(push_delegate_.get()); |
404 } | 406 } |
405 | 407 |
406 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { | 408 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { |
407 *alpn_protos = next_protos_; | 409 *alpn_protos = next_protos_; |
408 } | 410 } |
409 | 411 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 CloseIdleConnections(); | 482 CloseIdleConnections(); |
481 break; | 483 break; |
482 } | 484 } |
483 } | 485 } |
484 | 486 |
485 void HttpNetworkSession::OnPurgeMemory() { | 487 void HttpNetworkSession::OnPurgeMemory() { |
486 CloseIdleConnections(); | 488 CloseIdleConnections(); |
487 } | 489 } |
488 | 490 |
489 } // namespace net | 491 } // namespace net |
OLD | NEW |