Chromium Code Reviews| Index: components/offline_pages/background/request_queue.h |
| diff --git a/components/offline_pages/background/request_queue.h b/components/offline_pages/background/request_queue.h |
| index 8aa1425163ad7519bb96e44301cb59d354b3f582..314530eaa5783814ac5b3b1745827ac58c1ce191 100644 |
| --- a/components/offline_pages/background/request_queue.h |
| +++ b/components/offline_pages/background/request_queue.h |
| @@ -15,9 +15,9 @@ |
| #include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "components/offline_pages/background/cleanup_task_factory.h" |
| #include "components/offline_pages/background/device_conditions.h" |
| #include "components/offline_pages/background/pick_request_task.h" |
| -#include "components/offline_pages/background/pick_request_task_factory.h" |
| #include "components/offline_pages/background/request_queue_results.h" |
| #include "components/offline_pages/background/save_page_request.h" |
| #include "components/offline_pages/core/task_queue.h" |
| @@ -26,8 +26,8 @@ |
| namespace offline_pages { |
| +class CleanupTaskFactory; |
| class RequestQueueStore; |
| -class PickRequestTaskFactory; |
| // Class responsible for managing save page requests. |
| class RequestQueue { |
| @@ -91,18 +91,21 @@ class RequestQueue { |
| // Make a task to pick the next request, and report our choice to the |
| // callbacks. |
| void PickNextRequest( |
| + OfflinerPolicy* policy, |
| PickRequestTask::RequestPickedCallback picked_callback, |
| PickRequestTask::RequestNotPickedCallback not_picked_callback, |
| PickRequestTask::RequestCountCallback request_count_callback, |
| DeviceConditions& conditions, |
| std::set<int64_t>& disabled_requests); |
| + void CleanupRequestQueue(); |
|
fgorski
2016/12/02 21:44:04
add documentation please.
Pete Williamson
2016/12/05 20:39:46
Done.
|
| + |
| // Takes ownership of the factory. We use a setter to allow users of the |
| // request queue to not need a PickerFactory to create it, since we have lots |
|
fgorski
2016/12/02 21:44:04
fix
Pete Williamson
2016/12/05 20:39:46
Done.
|
| // of code using the request queue. The request coordinator will set a |
| // factory before calling PickNextRequest. |
|
fgorski
2016/12/02 21:44:05
fix
Pete Williamson
2016/12/05 20:39:46
Done.
|
| - void SetPickerFactory(std::unique_ptr<PickRequestTaskFactory> factory) { |
| - picker_factory_ = std::move(factory); |
| + void SetCleanupFactory(std::unique_ptr<CleanupTaskFactory> factory) { |
| + cleanup_factory_ = std::move(factory); |
| } |
| private: |
| @@ -115,8 +118,8 @@ class RequestQueue { |
| // Task queue to serialize store access. |
| TaskQueue task_queue_; |
| - // Builds PickRequestTask objects. |
| - std::unique_ptr<PickRequestTaskFactory> picker_factory_; |
| + // Builds CleanupTask objects. |
| + std::unique_ptr<CleanupTaskFactory> cleanup_factory_; |
| // Allows us to pass a weak pointer to callbacks. |
| base::WeakPtrFactory<RequestQueue> weak_ptr_factory_; |