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

Side by Side Diff: chrome/browser/predictors/loading_predictor.cc

Issue 2847183002: predictors: Introduce GlowplugPredictor. (Closed)
Patch Set: GlowplugPredictor -> LoadingPredictor Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/predictors/loading_predictor.h"
6
7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
9
10 namespace predictors {
11
12 LoadingPredictor::LoadingPredictor(const LoadingPredictorConfig& config,
13 Profile* profile) {
14 resource_prefetch_predictor_ =
15 base::MakeUnique<ResourcePrefetchPredictor>(config, profile);
16 }
17
18 LoadingPredictor::~LoadingPredictor() = default;
19
20 void LoadingPredictor::PrepareForPageLoad(const GURL& url, HintOrigin origin) {
21 resource_prefetch_predictor_->StartPrefetching(url, origin);
22 }
23
24 void LoadingPredictor::CancelPageLoadHint(const GURL& url) {
25 resource_prefetch_predictor_->StopPrefetching(url);
26 }
27
28 ResourcePrefetchPredictor* LoadingPredictor::resource_prefetch_predictor()
29 const {
30 return resource_prefetch_predictor_.get();
31 }
32
33 void LoadingPredictor::Shutdown() {
34 resource_prefetch_predictor_->Shutdown();
35 }
36
37 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/predictors/loading_predictor.h ('k') | chrome/browser/predictors/loading_predictor_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698