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

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

Issue 2221323003: Add an API to Pause and Resume background offlining requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to request ID as key Created 4 years, 4 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/request_queue_store.h" 10 #include "components/offline_pages/background/request_queue_store.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 store_->RemoveRequests(request_ids, base::Bind(RemoveRequestDone, callback)); 135 store_->RemoveRequests(request_ids, base::Bind(RemoveRequestDone, callback));
136 } 136 }
137 137
138 void RequestQueue::RemoveRequestsByClientId( 138 void RequestQueue::RemoveRequestsByClientId(
139 const std::vector<ClientId>& client_ids, 139 const std::vector<ClientId>& client_ids,
140 const UpdateRequestCallback& callback) { 140 const UpdateRequestCallback& callback) {
141 store_->RemoveRequestsByClientId(client_ids, 141 store_->RemoveRequestsByClientId(client_ids,
142 base::Bind(RemoveRequestDone, callback)); 142 base::Bind(RemoveRequestDone, callback));
143 } 143 }
144 144
145 void RequestQueue::PauseRequests(
146 const std::vector<int64_t>& request_ids,
147 const UpdateRequestCallback& callback) {
148 store_->PauseRequests(request_ids,
149 base::Bind(UpdateRequestDone, callback));
150 }
151
152 void RequestQueue::ResumeRequests(
153 const std::vector<int64_t>& request_ids,
154 const UpdateRequestCallback& callback) {
155 store_->ResumeRequests(request_ids,
156 base::Bind(UpdateRequestDone, callback));
157 }
158
159
145 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {} 160 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {}
146 161
147 } // namespace offline_pages 162 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698