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

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: Review comments Created 5 years, 6 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..7b561de5e53519e83cf465146f9383e71de1489f 100644
--- a/chrome/browser/net/preconnect.cc
+++ b/chrome/browser/net/preconnect.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "content/public/browser/browser_thread.h"
+#include "net/base/load_flags.h"
#include "net/http/http_network_session.h"
#include "net/http/http_request_info.h"
#include "net/http/http_stream_factory.h"
@@ -33,7 +34,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 +44,8 @@ void PreconnectOnIOThread(
const GURL& first_party_for_cookies,
UrlInfo::ResolutionMotivation motivation,
int count,
- net::URLRequestContextGetter* getter) {
+ net::URLRequestContextGetter* getter,
+ bool is_credentials_flag_set) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
LOG(DFATAL) << "This must be run only on the IO thread.";
return;
@@ -68,7 +70,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)
+ || !is_credentials_flag_set)
Ryan Sleevi 2015/06/11 22:20:15 To be clear: You're going to need to dig in to why
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