Chromium Code Reviews| Index: components/offline_pages/background/request_coordinator.h |
| diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h |
| index 3ddd2d9dc2d19cb2178db259702e7e7d457733a1..0dbed0ad4669ff95041c326d019c50927e114ab1 100644 |
| --- a/components/offline_pages/background/request_coordinator.h |
| +++ b/components/offline_pages/background/request_coordinator.h |
| @@ -5,10 +5,17 @@ |
| #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| +#include "base/callback.h" |
| +#include "components/keyed_service/core/keyed_service.h" |
| + |
| namespace offline_pages { |
| +class OfflinerPolicy; |
| +class OfflinerFactory; |
| +class Offliner; |
| + |
| // Coordinates queueing and processing save page later requests. |
| -class RequestCoordinator { |
| +class RequestCoordinator : public KeyedService { |
| public: |
| // Callback to report when the processing of a triggered task is complete. |
| typedef base::Callback<void()> ProcessingDoneCallback; |
| @@ -17,10 +24,10 @@ class RequestCoordinator { |
| // TODO(dougarnett): define and consider making stand-alone. |
| }; |
| - // TODO(dougarnett): How to inject Offliner factories and policy objects. |
| - RequestCoordinator(); |
| + RequestCoordinator( |
| + OfflinerPolicy* policy, OfflinerFactory* factory); |
|
fgorski
2016/04/29 04:16:46
a) what about multiple factories for different off
Pete Williamson
2016/05/02 20:51:14
For now we only have one factory. I have a TODO e
|
| - ~RequestCoordinator() {} |
| + ~RequestCoordinator() override; |
| // Queues |request| to later load and save when system conditions allow. |
| bool SavePageLater(const SavePageRequest& request); |
| @@ -36,7 +43,14 @@ class RequestCoordinator { |
| // is stopped or complete. |
| void StopProcessing(); |
| - // TODO(dougarnett): add policy support methods. |
| + // Factory has permission to call our private constructor. |
| + friend class RequestCoordinatorFactory; |
| + |
| + private: |
| + OfflinerPolicy* policy_; |
| + OfflinerFactory* factory_; |
| + // Offliner* offlinerArray_; |
| + int factoryArraySize_; |
| }; |
| } // namespace offline_pages |