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