OLD | NEW |
---|---|
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 Loading... | |
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 = PREFETCH_KEY_TYPE_URL) const; | |
Alexei Svitkine (slow)
2014/10/27 14:59:10
Nit: I thinks style guide discourages use of defau
Zhen Wang
2014/10/27 18:09:46
Done.
| |
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 Loading... | |
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_ |
OLD | NEW |