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 #include "components/offline_pages/background/request_queue.h" | 5 #include "components/offline_pages/core/background/request_queue.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "components/offline_pages/background/change_requests_state_task.h" | 12 #include "components/offline_pages/core/background/change_requests_state_task.h" |
13 #include "components/offline_pages/background/mark_attempt_aborted_task.h" | 13 #include "components/offline_pages/core/background/mark_attempt_aborted_task.h" |
14 #include "components/offline_pages/background/mark_attempt_completed_task.h" | 14 #include "components/offline_pages/core/background/mark_attempt_completed_task.h
" |
15 #include "components/offline_pages/background/mark_attempt_started_task.h" | 15 #include "components/offline_pages/core/background/mark_attempt_started_task.h" |
16 #include "components/offline_pages/background/pick_request_task.h" | 16 #include "components/offline_pages/core/background/pick_request_task.h" |
17 #include "components/offline_pages/background/pick_request_task_factory.h" | 17 #include "components/offline_pages/core/background/pick_request_task_factory.h" |
18 #include "components/offline_pages/background/remove_requests_task.h" | 18 #include "components/offline_pages/core/background/remove_requests_task.h" |
19 #include "components/offline_pages/background/request_queue_store.h" | 19 #include "components/offline_pages/core/background/request_queue_store.h" |
20 #include "components/offline_pages/background/save_page_request.h" | 20 #include "components/offline_pages/core/background/save_page_request.h" |
21 | 21 |
22 namespace offline_pages { | 22 namespace offline_pages { |
23 | 23 |
24 namespace { | 24 namespace { |
25 // Completes the get requests call. | 25 // Completes the get requests call. |
26 void GetRequestsDone(const RequestQueue::GetRequestsCallback& callback, | 26 void GetRequestsDone(const RequestQueue::GetRequestsCallback& callback, |
27 bool success, | 27 bool success, |
28 std::vector<std::unique_ptr<SavePageRequest>> requests) { | 28 std::vector<std::unique_ptr<SavePageRequest>> requests) { |
29 GetRequestsResult result = | 29 GetRequestsResult result = |
30 success ? GetRequestsResult::SUCCESS : GetRequestsResult::STORE_FAILURE; | 30 success ? GetRequestsResult::SUCCESS : GetRequestsResult::STORE_FAILURE; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 std::unique_ptr<Task> task(picker_factory_->CreatePickerTask( | 124 std::unique_ptr<Task> task(picker_factory_->CreatePickerTask( |
125 store_.get(), picked_callback, not_picked_callback, conditions, | 125 store_.get(), picked_callback, not_picked_callback, conditions, |
126 disabled_requests)); | 126 disabled_requests)); |
127 | 127 |
128 // Queue up the picking task, it will call one of the callbacks when it | 128 // Queue up the picking task, it will call one of the callbacks when it |
129 // completes. | 129 // completes. |
130 task_queue_.AddTask(std::move(task)); | 130 task_queue_.AddTask(std::move(task)); |
131 } | 131 } |
132 | 132 |
133 } // namespace offline_pages | 133 } // namespace offline_pages |
OLD | NEW |