Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: components/offline_pages/background/request_queue.cc

Issue 2517383008: [Offline pages] Adding GetRequestsTask to RequestQueue (Closed)
Patch Set: Addressing CR feedback Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/offline_pages/background/get_requests_task_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/request_queue.cc
diff --git a/components/offline_pages/background/request_queue.cc b/components/offline_pages/background/request_queue.cc
index d25a72f3f30312a983022c812f5376850d9c321b..b7c83c6f64d9b4c40e473eb8a02e6e60ba5c2ca5 100644
--- a/components/offline_pages/background/request_queue.cc
+++ b/components/offline_pages/background/request_queue.cc
@@ -10,6 +10,7 @@
#include "base/location.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/offline_pages/background/change_requests_state_task.h"
+#include "components/offline_pages/background/get_requests_task.h"
#include "components/offline_pages/background/mark_attempt_aborted_task.h"
#include "components/offline_pages/background/mark_attempt_completed_task.h"
#include "components/offline_pages/background/mark_attempt_started_task.h"
@@ -66,7 +67,9 @@ RequestQueue::RequestQueue(std::unique_ptr<RequestQueueStore> store)
RequestQueue::~RequestQueue() {}
void RequestQueue::GetRequests(const GetRequestsCallback& callback) {
- store_->GetRequests(base::Bind(&GetRequestsDone, callback));
+ std::unique_ptr<Task> task(new GetRequestsTask(
+ store_.get(), base::Bind(&GetRequestsDone, callback)));
+ task_queue_.AddTask(std::move(task));
}
void RequestQueue::AddRequest(const SavePageRequest& request,
« no previous file with comments | « components/offline_pages/background/get_requests_task_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698