Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 15 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 16 #include "base/supports_user_data.h" | 17 #include "base/supports_user_data.h" |
| 17 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 18 #include "base/timer/timer.h" | 19 #include "base/timer/timer.h" |
| 19 #include "components/keyed_service/core/keyed_service.h" | 20 #include "components/keyed_service/core/keyed_service.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 // Receives the results of a get from the request queue, and turns that into | 235 // Receives the results of a get from the request queue, and turns that into |
| 235 // SavePageRequest objects for the caller of GetQueuedRequests. | 236 // SavePageRequest objects for the caller of GetQueuedRequests. |
| 236 void GetRequestsForSchedulingCallback( | 237 void GetRequestsForSchedulingCallback( |
| 237 RequestQueue::GetRequestsResult result, | 238 RequestQueue::GetRequestsResult result, |
| 238 std::vector<std::unique_ptr<SavePageRequest>> requests); | 239 std::vector<std::unique_ptr<SavePageRequest>> requests); |
| 239 | 240 |
| 240 // Receives the result of add requests to the request queue. | 241 // Receives the result of add requests to the request queue. |
| 241 void AddRequestResultCallback(RequestQueue::AddRequestResult result, | 242 void AddRequestResultCallback(RequestQueue::AddRequestResult result, |
| 242 const SavePageRequest& request); | 243 const SavePageRequest& request); |
| 243 | 244 |
| 244 // Receives the result of update and delete requests to the request queue. | 245 // Receives the result of mark attempt completed requests. |
| 245 void UpdateRequestCallback(const ClientId& client_id, | 246 void MarkAttemptCompletedDoneCallback( |
|
Pete Williamson
2016/10/31 21:38:27
I thought this callback was used for lots of thing
dougarnett
2016/10/31 22:51:18
No, this was last usage.
| |
| 246 RequestQueue::UpdateRequestResult result); | 247 int64_t request_id, |
| 248 const ClientId& client_id, | |
| 249 std::unique_ptr<UpdateRequestsResult> result); | |
| 247 | 250 |
| 248 void UpdateMultipleRequestsCallback( | 251 void UpdateMultipleRequestsCallback( |
| 249 std::unique_ptr<UpdateRequestsResult> result); | 252 std::unique_ptr<UpdateRequestsResult> result); |
| 250 | 253 |
| 251 void CompletedRequestCallback(const MultipleItemStatuses& status); | 254 void CompletedRequestCallback(const MultipleItemStatuses& status); |
| 252 | 255 |
| 253 void HandleRemovedRequestsAndCallback( | 256 void HandleRemovedRequestsAndCallback( |
| 254 const RemoveRequestsCallback& callback, | 257 const RemoveRequestsCallback& callback, |
| 255 BackgroundSavePageResult status, | 258 BackgroundSavePageResult status, |
| 256 std::unique_ptr<UpdateRequestsResult> result); | 259 std::unique_ptr<UpdateRequestsResult> result); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 base::Callback<void(bool)> immediate_schedule_callback_; | 399 base::Callback<void(bool)> immediate_schedule_callback_; |
| 397 // Allows us to pass a weak pointer to callbacks. | 400 // Allows us to pass a weak pointer to callbacks. |
| 398 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 401 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
| 399 | 402 |
| 400 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 403 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
| 401 }; | 404 }; |
| 402 | 405 |
| 403 } // namespace offline_pages | 406 } // namespace offline_pages |
| 404 | 407 |
| 405 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 408 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| OLD | NEW |