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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_predictor.h

Issue 632033002: Add PLT measurement to Resource Prefetching for Mobile Web (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review fix Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_
6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 PrefetchDataMap* data_map); 257 PrefetchDataMap* data_map);
258 258
259 // Merges resources in |new_resources| into the |data_map| and correspondingly 259 // Merges resources in |new_resources| into the |data_map| and correspondingly
260 // updates the predictor database. 260 // updates the predictor database.
261 void LearnNavigation(const std::string& key, 261 void LearnNavigation(const std::string& key,
262 PrefetchKeyType key_type, 262 PrefetchKeyType key_type,
263 const std::vector<URLRequestSummary>& new_resources, 263 const std::vector<URLRequestSummary>& new_resources,
264 size_t max_data_map_size, 264 size_t max_data_map_size,
265 PrefetchDataMap* data_map); 265 PrefetchDataMap* data_map);
266 266
267 // Reports overall page load time.
268 void ReportPageLoadTimeStats(base::TimeDelta plt) const;
269
270 // Reports page load time for prefetched and not prefetched pages
271 void ReportPageLoadTimePrefetchStats(
272 base::TimeDelta plt,
273 bool prefetched,
274 base::Callback<void(int)> report_network_type_callback,
275 PrefetchKeyType key_type) const;
276
267 // Reports accuracy by comparing prefetched resources with resources that are 277 // Reports accuracy by comparing prefetched resources with resources that are
268 // actually used by the page. 278 // actually used by the page.
269 void ReportAccuracyStats(PrefetchKeyType key_type, 279 void ReportAccuracyStats(PrefetchKeyType key_type,
270 const std::vector<URLRequestSummary>& actual, 280 const std::vector<URLRequestSummary>& actual,
271 ResourcePrefetcher::RequestVector* prefetched) const; 281 ResourcePrefetcher::RequestVector* prefetched) const;
272 282
273 // Reports predicted accuracy i.e. by comparing resources that are actually 283 // Reports predicted accuracy i.e. by comparing resources that are actually
274 // used by the page with those that may have been prefetched. 284 // used by the page with those that may have been prefetched.
275 void ReportPredictedAccuracyStats( 285 void ReportPredictedAccuracyStats(
276 PrefetchKeyType key_type, 286 PrefetchKeyType key_type,
(...skipping 28 matching lines...) Expand all
305 315
306 ResultsMap results_map_; 316 ResultsMap results_map_;
307 STLValueDeleter<ResultsMap> results_map_deleter_; 317 STLValueDeleter<ResultsMap> results_map_deleter_;
308 318
309 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); 319 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor);
310 }; 320 };
311 321
312 } // namespace predictors 322 } // namespace predictors
313 323
314 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ 324 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.cc ('k') | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698