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