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

Unified Diff: chrome/browser/predictors/resource_prefetch_predictor.h

Issue 2683633004: predictors: Add subresources count and prefetching duration histograms. (Closed)
Patch Set: Add descriptions to histograms.xml. Created 3 years, 10 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/predictors/resource_prefetch_predictor.h
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
index 5bfc2bc4d502b698076f17c5160745a061895500..fae829c734aa83f2bd5bc2d4f7333f27ebfb05b1 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.h
+++ b/chrome/browser/predictors/resource_prefetch_predictor.h
@@ -43,6 +43,10 @@ constexpr char kResourcePrefetchPredictorPrecisionHistogram[] =
"ResourcePrefetchPredictor.LearningPrecision";
constexpr char kResourcePrefetchPredictorRecallHistogram[] =
"ResourcePrefetchPredictor.LearningRecall";
+constexpr char kResourcePrefetchPredictorCountHistogram[] =
+ "ResourcePrefetchPredictor.LearningCount";
+constexpr char kResourcePrefetchPredictorPrefetchingDurationHistogram[] =
+ "ResourcePrefetchPredictor.PrefetchingDuration";
} // namespace internal
class TestObserver;
@@ -210,6 +214,8 @@ class ResourcePrefetchPredictor
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest, GetPrefetchData);
FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest,
TestPrecisionRecallHistograms);
+ FRIEND_TEST_ALL_PREFIXES(ResourcePrefetchPredictorTest,
+ TestPrefetchingDurationHistogram);
enum InitializationState {
NOT_INITIALIZED = 0,
@@ -283,7 +289,7 @@ class ResourcePrefetchPredictor
void OnHistoryAndCacheLoaded();
// Removes data for navigations where the onload never fired. Will cleanup
- // inflight_navigations_.
+ // inflight_navigations_ and inflight_prefetchings_.
Benoit L 2017/02/09 02:24:52 nit: s/prefetchings/prefetches/
alexilin 2017/02/09 15:50:19 Done.
void CleanupAbandonedNavigations(const NavigationID& navigation_id);
// Deletes all URLs from the predictor database, the caches and removes all
@@ -364,6 +370,7 @@ class ResourcePrefetchPredictor
std::unique_ptr<RedirectDataMap> url_redirect_table_cache_;
std::unique_ptr<RedirectDataMap> host_redirect_table_cache_;
+ std::map<GURL, base::TimeTicks> inflight_prefetchings_;
Benoit L 2017/02/09 02:24:52 nit: ditto, for the renaming.
alexilin 2017/02/09 15:50:19 Done.
NavigationMap inflight_navigations_;
ScopedObserver<history::HistoryService, history::HistoryServiceObserver>

Powered by Google App Engine
This is Rietveld 408576698