| 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_CORE_BACKGROUND_REMOVE_REQUESTS_TASK_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REMOVE_REQUESTS_TASK_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REMOVE_REQUESTS_TASK_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REMOVE_REQUESTS_TASK_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Step 1. Removes requests from the store. | 31 // Step 1. Removes requests from the store. |
| 32 void RemoveRequests(); | 32 void RemoveRequests(); |
| 33 // Step for early termination, that builds failure result. | 33 // Step for early termination, that builds failure result. |
| 34 void CompleteEarly(ItemActionStatus status); | 34 void CompleteEarly(ItemActionStatus status); |
| 35 // Step 2. Processes update result, calls callback. | 35 // Step 2. Processes update result, calls callback. |
| 36 void CompleteWithResult(std::unique_ptr<UpdateRequestsResult> result); | 36 void CompleteWithResult(std::unique_ptr<UpdateRequestsResult> result); |
| 37 | 37 |
| 38 // Store that this task updates. | 38 // Store that this task updates. |
| 39 RequestQueueStore* store_; | 39 RequestQueueStore* store_; |
| 40 // Request IDs to be updated. | 40 // Request IDs to be updated. |
| 41 // TODO(fgorski): perhaps convert to unique_ptr to a vector. | |
| 42 std::vector<int64_t> request_ids_; | 41 std::vector<int64_t> request_ids_; |
| 43 // Callback to complete the task. | 42 // Callback to complete the task. |
| 44 RequestQueueStore::UpdateCallback callback_; | 43 RequestQueueStore::UpdateCallback callback_; |
| 45 | 44 |
| 46 base::WeakPtrFactory<RemoveRequestsTask> weak_ptr_factory_; | 45 base::WeakPtrFactory<RemoveRequestsTask> weak_ptr_factory_; |
| 47 | 46 |
| 48 DISALLOW_COPY_AND_ASSIGN(RemoveRequestsTask); | 47 DISALLOW_COPY_AND_ASSIGN(RemoveRequestsTask); |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 } // namespace offline_pages | 50 } // namespace offline_pages |
| 52 | 51 |
| 53 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REMOVE_REQUESTS_TASK_H_ | 52 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REMOVE_REQUESTS_TASK_H_ |
| OLD | NEW |