| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 340 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
| 341 quic_stream_factory_.CloseAllSessions(ERR_ABORTED, QUIC_INTERNAL_ERROR); | 341 quic_stream_factory_.CloseAllSessions(ERR_ABORTED, QUIC_INTERNAL_ERROR); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void HttpNetworkSession::CloseIdleConnections() { | 344 void HttpNetworkSession::CloseIdleConnections() { |
| 345 normal_socket_pool_manager_->CloseIdleSockets(); | 345 normal_socket_pool_manager_->CloseIdleSockets(); |
| 346 websocket_socket_pool_manager_->CloseIdleSockets(); | 346 websocket_socket_pool_manager_->CloseIdleSockets(); |
| 347 spdy_session_pool_.CloseCurrentIdleSessions(); | 347 spdy_session_pool_.CloseCurrentIdleSessions(); |
| 348 } | 348 } |
| 349 | 349 |
| 350 bool HttpNetworkSession::IsProtocolEnabled(NextProto protocol) const { | 350 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { |
| 351 switch (protocol) { | 351 switch (protocol) { |
| 352 case kProtoUnknown: | 352 case NPN_HTTP_2: |
| 353 return params_.enable_http2; |
| 354 case QUIC: |
| 355 return params_.enable_quic; |
| 356 case UNINITIALIZED_ALTERNATE_PROTOCOL: |
| 353 NOTREACHED(); | 357 NOTREACHED(); |
| 354 return false; | 358 return false; |
| 355 case kProtoHTTP11: | |
| 356 return true; | |
| 357 case kProtoHTTP2: | |
| 358 return params_.enable_http2; | |
| 359 case kProtoQUIC: | |
| 360 return params_.enable_quic; | |
| 361 } | 359 } |
| 362 NOTREACHED(); | 360 NOTREACHED(); |
| 363 return false; | 361 return false; |
| 364 } | 362 } |
| 365 | 363 |
| 366 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { | 364 void HttpNetworkSession::GetAlpnProtos(NextProtoVector* alpn_protos) const { |
| 367 *alpn_protos = next_protos_; | 365 *alpn_protos = next_protos_; |
| 368 } | 366 } |
| 369 | 367 |
| 370 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, | 368 void HttpNetworkSession::GetSSLConfig(const HttpRequestInfo& request, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 break; | 416 break; |
| 419 case base::MemoryState::SUSPENDED: | 417 case base::MemoryState::SUSPENDED: |
| 420 // Note: Not supported at present. Fall through. | 418 // Note: Not supported at present. Fall through. |
| 421 case base::MemoryState::UNKNOWN: | 419 case base::MemoryState::UNKNOWN: |
| 422 NOTREACHED(); | 420 NOTREACHED(); |
| 423 break; | 421 break; |
| 424 } | 422 } |
| 425 } | 423 } |
| 426 | 424 |
| 427 } // namespace net | 425 } // namespace net |
| OLD | NEW |