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

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

Issue 2527293002: [Offline pages] Adding AddRequestTask to Request Queue (Closed)
Patch Set: Rebased 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/add_request_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 b7c83c6f64d9b4c40e473eb8a02e6e60ba5c2ca5..7c3ab88b3b0a76496c1684be6a99620f75d58c2e 100644
--- a/components/offline_pages/background/request_queue.cc
+++ b/components/offline_pages/background/request_queue.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "components/offline_pages/background/add_request_task.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"
@@ -76,7 +77,9 @@ void RequestQueue::AddRequest(const SavePageRequest& request,
const AddRequestCallback& callback) {
// TODO(fgorski): check that request makes sense.
// TODO(fgorski): check that request does not violate policy.
- store_->AddRequest(request, base::Bind(&AddRequestDone, callback, request));
+ std::unique_ptr<AddRequestTask> task(new AddRequestTask(
+ store_.get(), request, base::Bind(&AddRequestDone, callback, request)));
+ task_queue_.AddTask(std::move(task));
}
void RequestQueue::RemoveRequests(const std::vector<int64_t>& request_ids,
« no previous file with comments | « components/offline_pages/background/add_request_task_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698