OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 HttpNetworkSession* session, | 45 HttpNetworkSession* session, |
46 const ProxyInfo& proxy_info, | 46 const ProxyInfo& proxy_info, |
47 bool force_spdy_over_ssl, | 47 bool force_spdy_over_ssl, |
48 bool want_spdy_over_npn, | 48 bool want_spdy_over_npn, |
49 const SSLConfig& ssl_config_for_origin, | 49 const SSLConfig& ssl_config_for_origin, |
50 const SSLConfig& ssl_config_for_proxy, | 50 const SSLConfig& ssl_config_for_proxy, |
51 bool force_tunnel, | 51 bool force_tunnel, |
52 const BoundNetLog& net_log, | 52 const BoundNetLog& net_log, |
53 int num_preconnect_streams, | 53 int num_preconnect_streams, |
54 ClientSocketHandle* socket_handle, | 54 ClientSocketHandle* socket_handle, |
55 OldCompletionCallback* callback) { | 55 const CompletionCallback& callback) { |
56 scoped_refptr<TransportSocketParams> tcp_params; | 56 scoped_refptr<TransportSocketParams> tcp_params; |
57 scoped_refptr<HttpProxySocketParams> http_proxy_params; | 57 scoped_refptr<HttpProxySocketParams> http_proxy_params; |
58 scoped_refptr<SOCKSSocketParams> socks_params; | 58 scoped_refptr<SOCKSSocketParams> socks_params; |
59 scoped_ptr<HostPortPair> proxy_host_port; | 59 scoped_ptr<HostPortPair> proxy_host_port; |
60 | 60 |
61 bool using_ssl = request_url.SchemeIs("https") || force_spdy_over_ssl; | 61 bool using_ssl = request_url.SchemeIs("https") || force_spdy_over_ssl; |
62 | 62 |
63 HostPortPair origin_host_port = | 63 HostPortPair origin_host_port = |
64 HostPortPair(request_url.HostNoBrackets(), | 64 HostPortPair(request_url.HostNoBrackets(), |
65 request_url.EffectiveIntPort()); | 65 request_url.EffectiveIntPort()); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 int request_load_flags, | 282 int request_load_flags, |
283 RequestPriority request_priority, | 283 RequestPriority request_priority, |
284 HttpNetworkSession* session, | 284 HttpNetworkSession* session, |
285 const ProxyInfo& proxy_info, | 285 const ProxyInfo& proxy_info, |
286 bool force_spdy_over_ssl, | 286 bool force_spdy_over_ssl, |
287 bool want_spdy_over_npn, | 287 bool want_spdy_over_npn, |
288 const SSLConfig& ssl_config_for_origin, | 288 const SSLConfig& ssl_config_for_origin, |
289 const SSLConfig& ssl_config_for_proxy, | 289 const SSLConfig& ssl_config_for_proxy, |
290 const BoundNetLog& net_log, | 290 const BoundNetLog& net_log, |
291 ClientSocketHandle* socket_handle, | 291 ClientSocketHandle* socket_handle, |
292 OldCompletionCallback* callback) { | 292 const CompletionCallback& callback) { |
293 DCHECK(socket_handle); | 293 DCHECK(socket_handle); |
294 return InitSocketPoolHelper(request_url, | 294 return InitSocketPoolHelper( |
295 request_extra_headers, | 295 request_url, request_extra_headers, request_load_flags, request_priority, |
296 request_load_flags, | 296 session, proxy_info, force_spdy_over_ssl, want_spdy_over_npn, |
297 request_priority, | 297 ssl_config_for_origin, ssl_config_for_proxy, false, net_log, 0, |
298 session, | 298 socket_handle, callback); |
299 proxy_info, | |
300 force_spdy_over_ssl, | |
301 want_spdy_over_npn, | |
302 ssl_config_for_origin, | |
303 ssl_config_for_proxy, | |
304 false, | |
305 net_log, | |
306 0, | |
307 socket_handle, | |
308 callback); | |
309 } | 299 } |
310 | 300 |
311 int InitSocketHandleForRawConnect( | 301 int InitSocketHandleForRawConnect( |
312 const HostPortPair& host_port_pair, | 302 const HostPortPair& host_port_pair, |
313 HttpNetworkSession* session, | 303 HttpNetworkSession* session, |
314 const ProxyInfo& proxy_info, | 304 const ProxyInfo& proxy_info, |
315 const SSLConfig& ssl_config_for_origin, | 305 const SSLConfig& ssl_config_for_origin, |
316 const SSLConfig& ssl_config_for_proxy, | 306 const SSLConfig& ssl_config_for_proxy, |
317 const BoundNetLog& net_log, | 307 const BoundNetLog& net_log, |
318 ClientSocketHandle* socket_handle, | 308 ClientSocketHandle* socket_handle, |
319 OldCompletionCallback* callback) { | 309 const CompletionCallback& callback) { |
320 DCHECK(socket_handle); | 310 DCHECK(socket_handle); |
321 // Synthesize an HttpRequestInfo. | 311 // Synthesize an HttpRequestInfo. |
322 GURL request_url = GURL("http://" + host_port_pair.ToString()); | 312 GURL request_url = GURL("http://" + host_port_pair.ToString()); |
323 HttpRequestHeaders request_extra_headers; | 313 HttpRequestHeaders request_extra_headers; |
324 int request_load_flags = 0; | 314 int request_load_flags = 0; |
325 RequestPriority request_priority = MEDIUM; | 315 RequestPriority request_priority = MEDIUM; |
326 | 316 |
327 return InitSocketPoolHelper(request_url, | 317 return InitSocketPoolHelper( |
328 request_extra_headers, | 318 request_url, request_extra_headers, request_load_flags, request_priority, |
329 request_load_flags, | 319 session, proxy_info, false, false, ssl_config_for_origin, |
330 request_priority, | 320 ssl_config_for_proxy, true, net_log, 0, socket_handle, callback); |
331 session, | |
332 proxy_info, | |
333 false, | |
334 false, | |
335 ssl_config_for_origin, | |
336 ssl_config_for_proxy, | |
337 true, | |
338 net_log, | |
339 0, | |
340 socket_handle, | |
341 callback); | |
342 } | 321 } |
343 | 322 |
344 int PreconnectSocketsForHttpRequest( | 323 int PreconnectSocketsForHttpRequest( |
345 const GURL& request_url, | 324 const GURL& request_url, |
346 const HttpRequestHeaders& request_extra_headers, | 325 const HttpRequestHeaders& request_extra_headers, |
347 int request_load_flags, | 326 int request_load_flags, |
348 RequestPriority request_priority, | 327 RequestPriority request_priority, |
349 HttpNetworkSession* session, | 328 HttpNetworkSession* session, |
350 const ProxyInfo& proxy_info, | 329 const ProxyInfo& proxy_info, |
351 bool force_spdy_over_ssl, | 330 bool force_spdy_over_ssl, |
352 bool want_spdy_over_npn, | 331 bool want_spdy_over_npn, |
353 const SSLConfig& ssl_config_for_origin, | 332 const SSLConfig& ssl_config_for_origin, |
354 const SSLConfig& ssl_config_for_proxy, | 333 const SSLConfig& ssl_config_for_proxy, |
355 const BoundNetLog& net_log, | 334 const BoundNetLog& net_log, |
356 int num_preconnect_streams) { | 335 int num_preconnect_streams) { |
357 return InitSocketPoolHelper(request_url, | 336 return InitSocketPoolHelper( |
358 request_extra_headers, | 337 request_url, request_extra_headers, request_load_flags, request_priority, |
359 request_load_flags, | 338 session, proxy_info, force_spdy_over_ssl, want_spdy_over_npn, |
360 request_priority, | 339 ssl_config_for_origin, ssl_config_for_proxy, false, net_log, |
361 session, | 340 num_preconnect_streams, NULL, CompletionCallback()); |
362 proxy_info, | |
363 force_spdy_over_ssl, | |
364 want_spdy_over_npn, | |
365 ssl_config_for_origin, | |
366 ssl_config_for_proxy, | |
367 false, | |
368 net_log, | |
369 num_preconnect_streams, | |
370 NULL, | |
371 NULL); | |
372 } | 341 } |
373 | 342 |
374 } // namespace net | 343 } // namespace net |
OLD | NEW |