Chromium Code Reviews| Index: chrome/browser/predictors/loading_predictor.cc |
| diff --git a/chrome/browser/predictors/loading_predictor.cc b/chrome/browser/predictors/loading_predictor.cc |
| index d5bd264009427aead4df1a4926e85807fee38f60..5c6a14e4cff9bb63dcee5159196357fb1ead21fb 100644 |
| --- a/chrome/browser/predictors/loading_predictor.cc |
| +++ b/chrome/browser/predictors/loading_predictor.cc |
| @@ -10,15 +10,15 @@ |
| namespace predictors { |
| LoadingPredictor::LoadingPredictor(const LoadingPredictorConfig& config, |
| - Profile* profile) { |
| - resource_prefetch_predictor_ = |
| - base::MakeUnique<ResourcePrefetchPredictor>(config, profile); |
| -} |
| + Profile* profile) |
| + : resource_prefetch_predictor_( |
| + base::MakeUnique<ResourcePrefetchPredictor>(config, profile)) {} |
|
alexilin
2017/05/23 11:01:38
Do you think it's better to construct the pointer
Benoit L
2017/05/29 16:45:14
We are trying to remove "new" as possible from Chr
|
| LoadingPredictor::~LoadingPredictor() = default; |
| void LoadingPredictor::PrepareForPageLoad(const GURL& url, HintOrigin origin) { |
| - resource_prefetch_predictor_->StartPrefetching(url, origin); |
| + if (resource_prefetch_predictor_->CanPrefetchUrlForOrigin(url, origin)) |
|
alexilin
2017/05/23 11:01:38
Shouldn't it be like LoadingPredictor tries to get
Benoit L
2017/05/29 16:45:14
That's the eventual goal yes, but it doesn't seem
|
| + resource_prefetch_predictor_->StartPrefetching(url, origin); |
| } |
| void LoadingPredictor::CancelPageLoadHint(const GURL& url) { |