| OLD | NEW |
| 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/loading_data_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 Loading... |
| 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 LoadingDataCollector* loading_data_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<LoadingDataCollector> loading_data_collector_; |
| 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_ |
| OLD | NEW |