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

Unified Diff: chrome/browser/net/predictor.h

Issue 1881463003: Add a browsertest suite for net predictor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a "forgetting" test + fix typo Created 4 years, 8 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/predictor.cc » ('j') | chrome/browser/net/predictor.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor.h
diff --git a/chrome/browser/net/predictor.h b/chrome/browser/net/predictor.h
index 53ea6323ca8a610e9bbcc57faba79fa4666ee3c4..20af1749dddb726df8e44da0df2c17c80ba3e3e1 100644
--- a/chrome/browser/net/predictor.h
+++ b/chrome/browser/net/predictor.h
@@ -75,7 +75,9 @@ class PredictorObserver {
virtual void OnPreconnectUrl(const GURL& original_url,
const GURL& first_party_for_cookies,
UrlInfo::ResolutionMotivation motivation,
- int count) = 0;
+ int count) {}
+ virtual void OnLearnFromNavigation(const GURL& referring_url,
+ const GURL& target_url) {}
};
// Predictor is constructed during Profile construction (on the UI thread),
@@ -307,6 +309,10 @@ class Predictor {
return predictor_enabled_;
}
+ // Used only for testing.
+ void set_preconnect_enabled(bool preconnect_enabled) {
mmenke 2016/04/15 15:44:02 set_preconnect_enabled_for_test There's a clang c
Charlie Harrison 2016/04/20 12:36:42 Done.
+ preconnect_enabled_ = preconnect_enabled;
+ }
mmenke 2016/04/15 15:44:02 This doesn't seem threadsafe - this is accessed on
Charlie Harrison 2016/04/20 12:36:42 Hmmm. I can try that in another CL to see if anyth
mmenke 2016/04/22 16:29:24 We can't really selectively add the flag - every s
private:
FRIEND_TEST_ALL_PREFIXES(PredictorTest, BenefitLookupTest);
@@ -564,7 +570,7 @@ class Predictor {
// Are we currently using preconnection, rather than just DNS resolution, for
// subresources and omni-box search URLs.
// This is false if and only if disabled by a command line switch.
- const bool preconnect_enabled_;
+ bool preconnect_enabled_;
// Most recent suggestion from Omnibox provided via AnticipateOmniboxUrl().
std::string last_omnibox_host_;
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | chrome/browser/net/predictor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698