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

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

Issue 2847183002: predictors: Introduce GlowplugPredictor. (Closed)
Patch Set: Address comments. 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/glowplug_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 GlowplugPredictor::GlowplugPredictor(const GlowplugPredictorConfig& config,
13 Profile* profile) {
14 resource_prefetch_predictor_ =
15 base::MakeUnique<ResourcePrefetchPredictor>(config, profile);
16 }
17
18 GlowplugPredictor::~GlowplugPredictor() = default;
19
20 void GlowplugPredictor::PrepareForPageLoad(const GURL& url, HintOrigin origin) {
21 resource_prefetch_predictor_->StartPrefetching(url, origin);
22 }
23
24 void GlowplugPredictor::CancelPageLoadHint(const GURL& url) {
25 resource_prefetch_predictor_->StopPrefetching(url);
26 }
27
28 ResourcePrefetchPredictor* GlowplugPredictor::resource_prefetch_predictor()
29 const {
30 return resource_prefetch_predictor_.get();
31 }
32
33 void GlowplugPredictor::Shutdown() {
34 resource_prefetch_predictor_->Shutdown();
35 }
36
37 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698