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

Unified Diff: chrome/browser/net/preconnect.cc

Issue 1131293004: Add cross origin to Blink-driven preconnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test and switch to a boolean Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/preconnect.cc
diff --git a/chrome/browser/net/preconnect.cc b/chrome/browser/net/preconnect.cc
index 01cadcce243593d28125112e78316302de3cdd94..0b2837839b54655b201e0fee89a8154ac05d0111 100644
--- a/chrome/browser/net/preconnect.cc
+++ b/chrome/browser/net/preconnect.cc
@@ -33,7 +33,7 @@ void PreconnectOnUIThread(
BrowserThread::IO,
FROM_HERE,
base::Bind(&PreconnectOnIOThread, url, first_party_for_cookies,
- motivation, count, make_scoped_refptr(getter)));
+ motivation, count, make_scoped_refptr(getter), false));
return;
}
@@ -43,7 +43,8 @@ void PreconnectOnIOThread(
const GURL& first_party_for_cookies,
UrlInfo::ResolutionMotivation motivation,
int count,
- net::URLRequestContextGetter* getter) {
+ net::URLRequestContextGetter* getter,
+ bool isAnonymous) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
LOG(DFATAL) << "This must be run only on the IO thread.";
return;
@@ -68,7 +69,8 @@ void PreconnectOnIOThread(
user_agent);
net::NetworkDelegate* delegate = context->network_delegate();
- if (delegate->CanEnablePrivacyMode(url, first_party_for_cookies))
+ if (delegate->CanEnablePrivacyMode(url, first_party_for_cookies)
+ || isAnonymous)
Ryan Sleevi 2015/06/10 19:30:41 So this is wrong. You should be using the |load_fl
Yoav Weiss 2015/06/11 12:55:14 hmm, setting request_info.load_flags to the above
request_info.privacy_mode = net::PRIVACY_MODE_ENABLED;
// It almost doesn't matter whether we use net::LOWEST or net::HIGHEST

Powered by Google App Engine
This is Rietveld 408576698