Chromium Code Reviews| Index: chrome/browser/net/preconnect.cc |
| diff --git a/chrome/browser/net/preconnect.cc b/chrome/browser/net/preconnect.cc |
| index 01cadcce243593d28125112e78316302de3cdd94..ef88ab26de30e4cb55d07a0bc8c8092e53ae85ed 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 allow_credentials) { |
| if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| LOG(DFATAL) << "This must be run only on the IO thread."; |
| return; |
| @@ -71,6 +73,11 @@ void PreconnectOnIOThread( |
| if (delegate->CanEnablePrivacyMode(url, first_party_for_cookies)) |
| request_info.privacy_mode = net::PRIVACY_MODE_ENABLED; |
| + if (!allow_credentials) |
| + request_info.load_flags = net::LOAD_DO_NOT_SEND_COOKIES | |
| + net::LOAD_DO_NOT_SAVE_COOKIES | |
| + net::LOAD_DO_NOT_SEND_AUTH_DATA; |
|
Ryan Sleevi
2015/06/12 21:35:59
Don't forget to "git cl format" :) This doesn't ad
|
| + |
| // It almost doesn't matter whether we use net::LOWEST or net::HIGHEST |
| // priority here, as we won't make a request, and will surrender the created |
| // socket to the pool as soon as we can. However, we would like to mark the |