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

Side by Side Diff: components/offline_pages/background/request_queue.cc

Issue 2438503003: [Offline pages] Add MarkAttemptAbortedTask to Request Queue (Closed)
Patch Set: Addressing feedback -- adding comments and documentation Created 4 years, 2 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/offline_pages/background/request_queue.h" 5 #include "components/offline_pages/background/request_queue.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "components/offline_pages/background/change_requests_state_task.h" 10 #include "components/offline_pages/background/change_requests_state_task.h"
11 #include "components/offline_pages/background/mark_attempt_aborted_task.h"
11 #include "components/offline_pages/background/mark_attempt_started_task.h" 12 #include "components/offline_pages/background/mark_attempt_started_task.h"
12 #include "components/offline_pages/background/remove_requests_task.h" 13 #include "components/offline_pages/background/remove_requests_task.h"
13 #include "components/offline_pages/background/request_queue_store.h" 14 #include "components/offline_pages/background/request_queue_store.h"
14 #include "components/offline_pages/background/save_page_request.h" 15 #include "components/offline_pages/background/save_page_request.h"
15 16
16 namespace offline_pages { 17 namespace offline_pages {
17 18
18 namespace { 19 namespace {
19 // Completes the get requests call. 20 // Completes the get requests call.
20 void GetRequestsDone(const RequestQueue::GetRequestsCallback& callback, 21 void GetRequestsDone(const RequestQueue::GetRequestsCallback& callback,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 task_queue_.AddTask(std::move(task)); 161 task_queue_.AddTask(std::move(task));
161 } 162 }
162 163
163 void RequestQueue::MarkAttemptStarted(int64_t request_id, 164 void RequestQueue::MarkAttemptStarted(int64_t request_id,
164 const UpdateCallback& callback) { 165 const UpdateCallback& callback) {
165 std::unique_ptr<Task> task( 166 std::unique_ptr<Task> task(
166 new MarkAttemptStartedTask(store_.get(), request_id, callback)); 167 new MarkAttemptStartedTask(store_.get(), request_id, callback));
167 task_queue_.AddTask(std::move(task)); 168 task_queue_.AddTask(std::move(task));
168 } 169 }
169 170
171 void RequestQueue::MarkAttemptAborted(int64_t request_id,
172 const UpdateCallback& callback) {
173 std::unique_ptr<Task> task(
174 new MarkAttemptAbortedTask(store_.get(), request_id, callback));
175 task_queue_.AddTask(std::move(task));
176 }
177
170 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {} 178 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {}
171 179
172 } // namespace offline_pages 180 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/background/request_queue.h ('k') | components/offline_pages/background/request_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698