Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: net/socket/client_socket_pool_manager.cc

Issue 1131293004: Add cross origin to Blink-driven preconnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a comment about GetPort Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 socks_version = '4'; 208 socks_version = '4';
209 connection_group = base::StringPrintf( 209 connection_group = base::StringPrintf(
210 "socks%c/%s", socks_version, connection_group.c_str()); 210 "socks%c/%s", socks_version, connection_group.c_str());
211 211
212 socks_params = new SOCKSSocketParams(proxy_tcp_params, 212 socks_params = new SOCKSSocketParams(proxy_tcp_params,
213 socks_version == '5', 213 socks_version == '5',
214 origin_host_port); 214 origin_host_port);
215 } 215 }
216 } 216 }
217 217
218 // Turn on privacy mode if it was enabled, or if the load flags indicate
219 // that credentials cannot be sent.
220 bool enable_privacy_mode = (load_flags & LOAD_DO_NOT_SEND_COOKIES) ||
221 (load_flags & LOAD_DO_NOT_SAVE_COOKIES) ||
222 (load_flags & LOAD_DO_NOT_SEND_AUTH_DATA) ||
223 (privacy_mode == PRIVACY_MODE_ENABLED);
mmenke 2015/07/13 21:02:01 We should have tests of this changed behavior.
Yoav Weiss 2015/07/13 22:11:38 What's the best location and methodology for such
mmenke 2015/07/13 22:30:16 I may have to do a little digging to figure how to
224
218 // Change group name if privacy mode is enabled. 225 // Change group name if privacy mode is enabled.
219 if (privacy_mode == PRIVACY_MODE_ENABLED) 226 if (enable_privacy_mode)
220 connection_group = "pm/" + connection_group; 227 connection_group = "pm/" + connection_group;
221 228
222 // Deal with SSL - which layers on top of any given proxy. 229 // Deal with SSL - which layers on top of any given proxy.
223 if (using_ssl) { 230 if (using_ssl) {
224 scoped_refptr<TransportSocketParams> ssl_tcp_params; 231 scoped_refptr<TransportSocketParams> ssl_tcp_params;
225 if (proxy_info.is_direct()) { 232 if (proxy_info.is_direct()) {
226 // Setup TCP params if non-proxied SSL connection. 233 // Setup TCP params if non-proxied SSL connection.
227 // Combine connect and write for SSL sockets in TCP FastOpen field trial. 234 // Combine connect and write for SSL sockets in TCP FastOpen field trial.
228 TransportSocketParams::CombineConnectAndWritePolicy 235 TransportSocketParams::CombineConnectAndWritePolicy
229 combine_connect_and_write = 236 combine_connect_and_write =
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 int num_preconnect_streams) { 494 int num_preconnect_streams) {
488 return InitSocketPoolHelper( 495 return InitSocketPoolHelper(
489 group_type, endpoint, request_extra_headers, request_load_flags, 496 group_type, endpoint, request_extra_headers, request_load_flags,
490 request_priority, session, proxy_info, expect_spdy, ssl_config_for_origin, 497 request_priority, session, proxy_info, expect_spdy, ssl_config_for_origin,
491 ssl_config_for_proxy, /*force_tunnel=*/false, privacy_mode, net_log, 498 ssl_config_for_proxy, /*force_tunnel=*/false, privacy_mode, net_log,
492 num_preconnect_streams, NULL, HttpNetworkSession::NORMAL_SOCKET_POOL, 499 num_preconnect_streams, NULL, HttpNetworkSession::NORMAL_SOCKET_POOL,
493 OnHostResolutionCallback(), CompletionCallback()); 500 OnHostResolutionCallback(), CompletionCallback());
494 } 501 }
495 502
496 } // namespace net 503 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698