| 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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 if (HttpStreamFactory::spdy_enabled()) { | 326 if (HttpStreamFactory::spdy_enabled()) { |
| 327 *alpn_protos = next_protos_; | 327 *alpn_protos = next_protos_; |
| 328 } else { | 328 } else { |
| 329 alpn_protos->clear(); | 329 alpn_protos->clear(); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const { | 333 void HttpNetworkSession::GetNpnProtos(NextProtoVector* npn_protos) const { |
| 334 if (HttpStreamFactory::spdy_enabled() && params_.enable_npn) { | 334 if (HttpStreamFactory::spdy_enabled() && params_.enable_npn) { |
| 335 *npn_protos = next_protos_; | 335 *npn_protos = next_protos_; |
| 336 DisableHTTP2(npn_protos); | |
| 337 } else { | 336 } else { |
| 338 npn_protos->clear(); | 337 npn_protos->clear(); |
| 339 } | 338 } |
| 340 } | 339 } |
| 341 | 340 |
| 342 bool HttpNetworkSession::HasSpdyExclusion( | 341 bool HttpNetworkSession::HasSpdyExclusion( |
| 343 HostPortPair host_port_pair) const { | 342 HostPortPair host_port_pair) const { |
| 344 return params_.forced_spdy_exclusions.find(host_port_pair) != | 343 return params_.forced_spdy_exclusions.find(host_port_pair) != |
| 345 params_.forced_spdy_exclusions.end(); | 344 params_.forced_spdy_exclusions.end(); |
| 346 } | 345 } |
| 347 | 346 |
| 348 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( | 347 ClientSocketPoolManager* HttpNetworkSession::GetSocketPoolManager( |
| 349 SocketPoolType pool_type) { | 348 SocketPoolType pool_type) { |
| 350 switch (pool_type) { | 349 switch (pool_type) { |
| 351 case NORMAL_SOCKET_POOL: | 350 case NORMAL_SOCKET_POOL: |
| 352 return normal_socket_pool_manager_.get(); | 351 return normal_socket_pool_manager_.get(); |
| 353 case WEBSOCKET_SOCKET_POOL: | 352 case WEBSOCKET_SOCKET_POOL: |
| 354 return websocket_socket_pool_manager_.get(); | 353 return websocket_socket_pool_manager_.get(); |
| 355 default: | 354 default: |
| 356 NOTREACHED(); | 355 NOTREACHED(); |
| 357 break; | 356 break; |
| 358 } | 357 } |
| 359 return NULL; | 358 return NULL; |
| 360 } | 359 } |
| 361 | 360 |
| 362 } // namespace net | 361 } // namespace net |
| OLD | NEW |