OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | |
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | |
7 | |
8 namespace offline_pages { | |
9 | |
10 class SavePageRequest; | |
11 | |
12 // Coordinates queueing and processing save page later requests. | |
13 class RequestCoordinator : public KeyedService { | |
Pete Williamson
2016/04/26 00:52:19
KeyedService -> BrowserContextKeyedService
Once w
Pete Williamson
2016/04/26 00:56:13
Oops, my bad, it looks like it is KeyedService aft
dougarnett
2016/04/26 15:50:38
I'm happy to take out KeyedService for this CL or
Pete Williamson
2016/04/26 16:40:59
Let's take out the KeyedService, and add it back w
| |
14 public: | |
15 // Callback to report when the processing of a triggered task is complete. | |
16 typedef base::Callback<void()> ProcessingDoneCallback; | |
17 | |
18 // TODO(dougarnett): How to inject Offliner factories and policy objects. | |
19 RequestCoordinator(); | |
20 | |
21 virtual ~RequestCoordinator() {} | |
22 | |
23 // Handles shutdown of KeyedService. | |
24 virtual void Shutdown() = 0; | |
Pete Williamson
2016/04/26 00:52:19
Why make these pure virtual? We don't really need
dougarnett
2016/04/26 15:50:38
Done.
| |
25 | |
26 // Queues |request| to later load and save when system conditions allow. | |
27 virtual bool SavePageLater(const SavePageRequest& request) = 0; | |
28 | |
29 // Starts processing of one or more queued save page later requests. | |
30 virtual void StartProcessing(const ProcessingDoneCallback& callback) = 0; | |
31 | |
32 // Stops the current request processing if active. | |
33 virtual void StopProcessing() = 0; | |
34 | |
35 // TODO(dougarnett): add policy support methods. | |
36 }; | |
37 | |
38 } // namespace offline_pages | |
39 | |
40 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | |
OLD | NEW |