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

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

Issue 3032014: Support both preconnection, and pre-resolution for subresources... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/preconnect.h ('k') | chrome/browser/net/predictor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/preconnect.cc
===================================================================
--- chrome/browser/net/preconnect.cc (revision 54027)
+++ chrome/browser/net/preconnect.cc (working copy)
@@ -26,17 +26,18 @@
Preconnect* Preconnect::callback_instance_;
// static
-bool Preconnect::PreconnectOnUIThread(const GURL& url) {
+void Preconnect::PreconnectOnUIThread(const GURL& url,
+ UrlInfo::ResolutionMotivation motivation) {
// Try to do connection warming for this search provider.
URLRequestContextGetter* getter = Profile::GetDefaultRequestContext();
if (!getter)
- return false;
+ return;
// Prewarm connection to Search URL.
ChromeThread::PostTask(
ChromeThread::IO,
FROM_HERE,
- NewRunnableFunction(Preconnect::PreconnectOnIOThread, url));
- return true;
+ NewRunnableFunction(Preconnect::PreconnectOnIOThread, url, motivation));
+ return;
}
enum ProxyStatus {
@@ -53,8 +54,8 @@
}
// static
-void Preconnect::PreconnectOnIOThread(const GURL& url) {
- // TODO(jar): This does not handle proxies currently.
+void Preconnect::PreconnectOnIOThread(const GURL& url,
+ UrlInfo::ResolutionMotivation motivation) {
URLRequestContextGetter* getter = Profile::GetDefaultRequestContext();
if (!getter)
return;
@@ -84,6 +85,9 @@
}
}
+ UMA_HISTOGRAM_ENUMERATION("Net.PreconnectMotivation", motivation,
+ UrlInfo::MAX_MOTIVATED);
+
net::HttpTransactionFactory* factory = context->http_transaction_factory();
net::HttpNetworkSession* session = factory->GetSession();
« no previous file with comments | « chrome/browser/net/preconnect.h ('k') | chrome/browser/net/predictor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698