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