| 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 COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_ |
| 7 | 7 |
| 8 #include "components/keyed_service/core/keyed_service.h" | 8 #include "components/keyed_service/core/keyed_service.h" |
| 9 | 9 |
| 10 namespace offline_pages { | 10 namespace offline_pages { |
| 11 class OfflineEventLogger; | 11 class OfflineEventLogger; |
| 12 class OfflineMetricsCollector; | 12 class OfflineMetricsCollector; |
| 13 class PrefetchDispatcher; | 13 class PrefetchDispatcher; |
| 14 class PrefetchGCMHandler; | 14 class PrefetchGCMHandler; |
| 15 class PrefetchStore; | |
| 16 class SuggestedArticlesObserver; | 15 class SuggestedArticlesObserver; |
| 17 | 16 |
| 18 // Main class and entry point for the Offline Pages Prefetching feature, that | 17 // Main class and entry point for the Offline Pages Prefetching feature, that |
| 19 // controls the lifetime of all major subcomponents of the prefetching system. | 18 // controls the lifetime of all major subcomponents of the prefetching system. |
| 20 class PrefetchService : public KeyedService { | 19 class PrefetchService : public KeyedService { |
| 21 public: | 20 public: |
| 22 ~PrefetchService() override = default; | 21 ~PrefetchService() override = default; |
| 23 | 22 |
| 24 // Subobjects that are created and owned by this service. Creation should be | 23 // Subobjects that are created and owned by this service. Creation should be |
| 25 // lightweight, all heavy work must be done on-demand only. | 24 // lightweight, all heavy work must be done on-demand only. |
| 26 // The service manages lifetime, hookup and initialization of Prefetch | 25 // The service manages lifetime, hookup and initialization of Prefetch |
| 27 // system that consists of multiple specialized objects, all vended by this | 26 // system that consists of multiple specialized objects, all vended by this |
| 28 // service. | 27 // service. |
| 28 virtual OfflineEventLogger* GetLogger() = 0; |
| 29 virtual OfflineMetricsCollector* GetOfflineMetricsCollector() = 0; | 29 virtual OfflineMetricsCollector* GetOfflineMetricsCollector() = 0; |
| 30 virtual PrefetchDispatcher* GetPrefetchDispatcher() = 0; | 30 virtual PrefetchDispatcher* GetPrefetchDispatcher() = 0; |
| 31 virtual PrefetchGCMHandler* GetPrefetchGCMHandler() = 0; | 31 virtual PrefetchGCMHandler* GetPrefetchGCMHandler() = 0; |
| 32 virtual PrefetchStore* GetPrefetchStore() = 0; | |
| 33 virtual OfflineEventLogger* GetLogger() = 0; | |
| 34 | 32 |
| 35 // May be |nullptr| in tests. The PrefetchService does not depend on the | 33 // May be |nullptr| in tests. The PrefetchService does not depend on the |
| 36 // SuggestedArticlesObserver, it merely owns it for lifetime purposes. | 34 // SuggestedArticlesObserver, it merely owns it for lifetime purposes. |
| 37 virtual SuggestedArticlesObserver* GetSuggestedArticlesObserver() = 0; | 35 virtual SuggestedArticlesObserver* GetSuggestedArticlesObserver() = 0; |
| 38 }; | 36 }; |
| 39 | 37 |
| 40 } // namespace offline_pages | 38 } // namespace offline_pages |
| 41 | 39 |
| 42 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_ | 40 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_SERVICE_H_ |
| OLD | NEW |