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/socket/client_socket_pool_manager.h" | 5 #include "net/socket/client_socket_pool_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 return OK; | 320 return OK; |
321 } | 321 } |
322 | 322 |
323 return socket_handle->Init(connection_group, tcp_params, | 323 return socket_handle->Init(connection_group, tcp_params, |
324 request_priority, callback, | 324 request_priority, callback, |
325 pool, net_log); | 325 pool, net_log); |
326 } | 326 } |
327 | 327 |
328 } // namespace | 328 } // namespace |
329 | 329 |
330 // static | |
331 ClientSocketPoolManager::SocketGroupType | |
332 ClientSocketPoolManager::GroupTypeFromScheme(const std::string& scheme) { | |
333 if (scheme == "ftp") | |
334 return FTP_GROUP; | |
335 | |
336 if (scheme == "https" || scheme == "wss") | |
337 return SSL_GROUP; | |
338 | |
339 return NORMAL_GROUP; | |
340 } | |
341 | |
342 ClientSocketPoolManager::ClientSocketPoolManager() {} | 330 ClientSocketPoolManager::ClientSocketPoolManager() {} |
343 ClientSocketPoolManager::~ClientSocketPoolManager() {} | 331 ClientSocketPoolManager::~ClientSocketPoolManager() {} |
344 | 332 |
345 // static | 333 // static |
346 int ClientSocketPoolManager::max_sockets_per_pool( | 334 int ClientSocketPoolManager::max_sockets_per_pool( |
347 HttpNetworkSession::SocketPoolType pool_type) { | 335 HttpNetworkSession::SocketPoolType pool_type) { |
348 DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES); | 336 DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES); |
349 return g_max_sockets_per_pool[pool_type]; | 337 return g_max_sockets_per_pool[pool_type]; |
350 } | 338 } |
351 | 339 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 return InitSocketPoolHelper( | 506 return InitSocketPoolHelper( |
519 group_type, endpoint, request_extra_headers, request_load_flags, | 507 group_type, endpoint, request_extra_headers, request_load_flags, |
520 request_priority, session, proxy_info, force_spdy_over_ssl, | 508 request_priority, session, proxy_info, force_spdy_over_ssl, |
521 want_spdy_over_npn, ssl_config_for_origin, ssl_config_for_proxy, false, | 509 want_spdy_over_npn, ssl_config_for_origin, ssl_config_for_proxy, false, |
522 privacy_mode, net_log, num_preconnect_streams, NULL, | 510 privacy_mode, net_log, num_preconnect_streams, NULL, |
523 HttpNetworkSession::NORMAL_SOCKET_POOL, OnHostResolutionCallback(), | 511 HttpNetworkSession::NORMAL_SOCKET_POOL, OnHostResolutionCallback(), |
524 CompletionCallback()); | 512 CompletionCallback()); |
525 } | 513 } |
526 | 514 |
527 } // namespace net | 515 } // namespace net |
OLD | NEW |