| 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 ReportPageLoadTimePrefetchedStats(PrefetchKeyType key_type, |
| 272 base::TimeDelta plt) const; |
| 273 void ReportPageLoadTimeNotPrefetchedStats(base::TimeDelta plt) const; |
| 274 |
| 267 // Reports accuracy by comparing prefetched resources with resources that are | 275 // Reports accuracy by comparing prefetched resources with resources that are |
| 268 // actually used by the page. | 276 // actually used by the page. |
| 269 void ReportAccuracyStats(PrefetchKeyType key_type, | 277 void ReportAccuracyStats(PrefetchKeyType key_type, |
| 270 const std::vector<URLRequestSummary>& actual, | 278 const std::vector<URLRequestSummary>& actual, |
| 271 ResourcePrefetcher::RequestVector* prefetched) const; | 279 ResourcePrefetcher::RequestVector* prefetched) const; |
| 272 | 280 |
| 273 // Reports predicted accuracy i.e. by comparing resources that are actually | 281 // Reports predicted accuracy i.e. by comparing resources that are actually |
| 274 // used by the page with those that may have been prefetched. | 282 // used by the page with those that may have been prefetched. |
| 275 void ReportPredictedAccuracyStats( | 283 void ReportPredictedAccuracyStats( |
| 276 PrefetchKeyType key_type, | 284 PrefetchKeyType key_type, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 305 | 313 |
| 306 ResultsMap results_map_; | 314 ResultsMap results_map_; |
| 307 STLValueDeleter<ResultsMap> results_map_deleter_; | 315 STLValueDeleter<ResultsMap> results_map_deleter_; |
| 308 | 316 |
| 309 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); | 317 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); |
| 310 }; | 318 }; |
| 311 | 319 |
| 312 } // namespace predictors | 320 } // namespace predictors |
| 313 | 321 |
| 314 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 322 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
| OLD | NEW |