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

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

Issue 16514008: Add metrics for calculating precision/recall of link navigation pre-connect triggers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove PRERENDER flag change Created 7 years, 4 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 | « no previous file | chrome/browser/net/preconnect.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/connect_interceptor.cc
diff --git a/chrome/browser/net/connect_interceptor.cc b/chrome/browser/net/connect_interceptor.cc
index 4770fba96690a0e49319d6b8652882e02ef22e76..bcd836201055af5350024c9b55155cb4198557d6 100644
--- a/chrome/browser/net/connect_interceptor.cc
+++ b/chrome/browser/net/connect_interceptor.cc
@@ -29,6 +29,7 @@ void ConnectInterceptor::WitnessURLRequest(net::URLRequest* request) {
predictor_->LearnAboutInitialNavigation(request_scheme_host);
bool redirected_host = false;
+ bool is_subresource = !(request->load_flags() & net::LOAD_MAIN_FRAME);
if (request->referrer().empty()) {
if (request->url() != request->original_url()) {
// This request was completed with a redirect.
@@ -55,7 +56,6 @@ void ConnectInterceptor::WitnessURLRequest(net::URLRequest* request) {
}
} else {
GURL referring_scheme_host = GURL(request->referrer()).GetWithEmptyPath();
- bool is_subresource = !(request->load_flags() & net::LOAD_MAIN_FRAME);
// Learn about our referring URL, for use in the future.
if (is_subresource && timed_cache_.WasRecentlySeen(referring_scheme_host))
predictor_->LearnFromNavigation(referring_scheme_host,
@@ -71,7 +71,8 @@ void ConnectInterceptor::WitnessURLRequest(net::URLRequest* request) {
}
timed_cache_.SetRecentlySeen(request_scheme_host);
- predictor_->RecordPreconnectNavigationStats(request_scheme_host);
+ predictor_->RecordPreconnectNavigationStat(request->url_chain(),
+ is_subresource);
// Subresources for main frames usually get predicted when we detected the
// main frame request - way back in RenderViewHost::Navigate. So only handle
« no previous file with comments | « no previous file | chrome/browser/net/preconnect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698