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