| 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_QUEUE_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REQUEST_QUEUE_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REQUEST_QUEUE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "components/offline_pages/background/device_conditions.h" | 18 #include "components/offline_pages/core/background/device_conditions.h" |
| 19 #include "components/offline_pages/background/pick_request_task.h" | 19 #include "components/offline_pages/core/background/pick_request_task.h" |
| 20 #include "components/offline_pages/background/pick_request_task_factory.h" | 20 #include "components/offline_pages/core/background/pick_request_task_factory.h" |
| 21 #include "components/offline_pages/background/request_queue_results.h" | 21 #include "components/offline_pages/core/background/request_queue_results.h" |
| 22 #include "components/offline_pages/background/save_page_request.h" | 22 #include "components/offline_pages/core/background/save_page_request.h" |
| 23 #include "components/offline_pages/core/offline_page_item.h" |
| 24 #include "components/offline_pages/core/offline_store_types.h" |
| 23 #include "components/offline_pages/core/task_queue.h" | 25 #include "components/offline_pages/core/task_queue.h" |
| 24 #include "components/offline_pages/offline_page_item.h" | |
| 25 #include "components/offline_pages/offline_store_types.h" | |
| 26 | 26 |
| 27 namespace offline_pages { | 27 namespace offline_pages { |
| 28 | 28 |
| 29 class RequestQueueStore; | 29 class RequestQueueStore; |
| 30 class PickRequestTaskFactory; | 30 class PickRequestTaskFactory; |
| 31 | 31 |
| 32 // Class responsible for managing save page requests. | 32 // Class responsible for managing save page requests. |
| 33 class RequestQueue { | 33 class RequestQueue { |
| 34 public: | 34 public: |
| 35 | |
| 36 // Callback used for |GetRequests|. | 35 // Callback used for |GetRequests|. |
| 37 typedef base::Callback<void(GetRequestsResult, | 36 typedef base::Callback<void(GetRequestsResult, |
| 38 std::vector<std::unique_ptr<SavePageRequest>>)> | 37 std::vector<std::unique_ptr<SavePageRequest>>)> |
| 39 GetRequestsCallback; | 38 GetRequestsCallback; |
| 40 | 39 |
| 41 // Callback used for |AddRequest|. | 40 // Callback used for |AddRequest|. |
| 42 typedef base::Callback<void(AddRequestResult, const SavePageRequest& request)> | 41 typedef base::Callback<void(AddRequestResult, const SavePageRequest& request)> |
| 43 AddRequestCallback; | 42 AddRequestCallback; |
| 44 | 43 |
| 45 // Callback used by |ChangeRequestsState|. | 44 // Callback used by |ChangeRequestsState|. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 std::unique_ptr<PickRequestTaskFactory> picker_factory_; | 124 std::unique_ptr<PickRequestTaskFactory> picker_factory_; |
| 126 | 125 |
| 127 // Allows us to pass a weak pointer to callbacks. | 126 // Allows us to pass a weak pointer to callbacks. |
| 128 base::WeakPtrFactory<RequestQueue> weak_ptr_factory_; | 127 base::WeakPtrFactory<RequestQueue> weak_ptr_factory_; |
| 129 | 128 |
| 130 DISALLOW_COPY_AND_ASSIGN(RequestQueue); | 129 DISALLOW_COPY_AND_ASSIGN(RequestQueue); |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 } // namespace offline_pages | 132 } // namespace offline_pages |
| 134 | 133 |
| 135 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_H_ | 134 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_REQUEST_QUEUE_H_ |
| OLD | NEW |