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

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

Issue 2416083002: [Offline pages] Introduction of MarkAttemptStartedTask with tests (Closed)
Patch Set: Addressing code review feedback 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_started_task.h"
11 #include "components/offline_pages/background/remove_requests_task.h" 12 #include "components/offline_pages/background/remove_requests_task.h"
12 #include "components/offline_pages/background/request_queue_store.h" 13 #include "components/offline_pages/background/request_queue_store.h"
13 #include "components/offline_pages/background/save_page_request.h" 14 #include "components/offline_pages/background/save_page_request.h"
14 15
15 namespace offline_pages { 16 namespace offline_pages {
16 17
17 namespace { 18 namespace {
18 // Completes the get requests call. 19 // Completes the get requests call.
19 void GetRequestsDone(const RequestQueue::GetRequestsCallback& callback, 20 void GetRequestsDone(const RequestQueue::GetRequestsCallback& callback,
20 bool success, 21 bool success,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 153
153 void RequestQueue::ChangeRequestsState( 154 void RequestQueue::ChangeRequestsState(
154 const std::vector<int64_t>& request_ids, 155 const std::vector<int64_t>& request_ids,
155 const SavePageRequest::RequestState new_state, 156 const SavePageRequest::RequestState new_state,
156 const RequestQueue::UpdateCallback& callback) { 157 const RequestQueue::UpdateCallback& callback) {
157 std::unique_ptr<Task> task(new ChangeRequestsStateTask( 158 std::unique_ptr<Task> task(new ChangeRequestsStateTask(
158 store_.get(), request_ids, new_state, callback)); 159 store_.get(), request_ids, new_state, callback));
159 task_queue_.AddTask(std::move(task)); 160 task_queue_.AddTask(std::move(task));
160 } 161 }
161 162
163 void RequestQueue::MarkAttemptStarted(int64_t request_id,
164 const UpdateCallback& callback) {
165 std::unique_ptr<Task> task(
166 new MarkAttemptStartedTask(store_.get(), request_id, callback));
167 task_queue_.AddTask(std::move(task));
168 }
169
162 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {} 170 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {}
163 171
164 } // namespace offline_pages 172 } // 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