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

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

Issue 2896713003: Create LoadingDataCollector class and have observers rely on it instead of ResourcePrefetchPredictor (Closed)
Patch Set: 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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_LOADING_PREDICTOR_H_ 5 #ifndef CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_
6 #define CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ 6 #define CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/predictors/glowplug_collector.h"
11 #include "chrome/browser/predictors/resource_prefetch_common.h" 12 #include "chrome/browser/predictors/resource_prefetch_common.h"
12 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 13 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
13 #include "components/keyed_service/core/keyed_service.h" 14 #include "components/keyed_service/core/keyed_service.h"
14 15
15 class Profile; 16 class Profile;
16 17
17 namespace predictors { 18 namespace predictors {
18 19
19 class ResourcePrefetchPredictor; 20 class ResourcePrefetchPredictor;
20 21
(...skipping 16 matching lines...) Expand all
37 void PrepareForPageLoad(const GURL& url, HintOrigin origin); 38 void PrepareForPageLoad(const GURL& url, HintOrigin origin);
38 39
39 // Indicates that a page load hint is no longer active. 40 // Indicates that a page load hint is no longer active.
40 void CancelPageLoadHint(const GURL& url); 41 void CancelPageLoadHint(const GURL& url);
41 42
42 // Starts initialization, will complete asynchronously. 43 // Starts initialization, will complete asynchronously.
43 void StartInitialization(); 44 void StartInitialization();
44 45
45 // Don't use, internal only. 46 // Don't use, internal only.
46 ResourcePrefetchPredictor* resource_prefetch_predictor() const; 47 ResourcePrefetchPredictor* resource_prefetch_predictor() const;
48 GlowplugCollector* glowplug_collector() const;
47 49
48 // KeyedService: 50 // KeyedService:
49 void Shutdown() override; 51 void Shutdown() override;
50 52
51 private: 53 private:
52 std::unique_ptr<ResourcePrefetchPredictor> resource_prefetch_predictor_; 54 std::unique_ptr<ResourcePrefetchPredictor> resource_prefetch_predictor_;
55 std::unique_ptr<GlowplugCollector> glowplug_collector_;
alexilin 2017/05/22 13:20:36 We need to decide whether GlowplugCollector should
Benoit L 2017/05/22 13:37:16 As its lifetime is 100% tied to LoadingPredictor,
alexilin 2017/05/23 08:24:37 SGTM Just one point in favor of separate lifetimes
53 56
54 DISALLOW_COPY_AND_ASSIGN(LoadingPredictor); 57 DISALLOW_COPY_AND_ASSIGN(LoadingPredictor);
55 }; 58 };
56 59
57 } // namespace predictors 60 } // namespace predictors
58 61
59 #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ 62 #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698