| 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 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Last known conditions for network, battery | 169 // Last known conditions for network, battery |
| 170 std::unique_ptr<DeviceConditions> current_conditions_; | 170 std::unique_ptr<DeviceConditions> current_conditions_; |
| 171 // RequestCoordinator takes over ownership of the policy | 171 // RequestCoordinator takes over ownership of the policy |
| 172 std::unique_ptr<OfflinerPolicy> policy_; | 172 std::unique_ptr<OfflinerPolicy> policy_; |
| 173 // OfflinerFactory. Used to create offline pages. Owned. | 173 // OfflinerFactory. Used to create offline pages. Owned. |
| 174 std::unique_ptr<OfflinerFactory> factory_; | 174 std::unique_ptr<OfflinerFactory> factory_; |
| 175 // RequestQueue. Used to store incoming requests. Owned. | 175 // RequestQueue. Used to store incoming requests. Owned. |
| 176 std::unique_ptr<RequestQueue> queue_; | 176 std::unique_ptr<RequestQueue> queue_; |
| 177 // Scheduler. Used to request a callback when network is available. Owned. | 177 // Scheduler. Used to request a callback when network is available. Owned. |
| 178 std::unique_ptr<Scheduler> scheduler_; | 178 std::unique_ptr<Scheduler> scheduler_; |
| 179 // Holds copy of the active request, if any. |
| 180 std::unique_ptr<SavePageRequest> active_request_; |
| 179 // Status of the most recent offlining. | 181 // Status of the most recent offlining. |
| 180 Offliner::RequestStatus last_offlining_status_; | 182 Offliner::RequestStatus last_offlining_status_; |
| 181 // Class to choose which request to schedule next | 183 // Class to choose which request to schedule next |
| 182 std::unique_ptr<RequestPicker> picker_; | 184 std::unique_ptr<RequestPicker> picker_; |
| 183 // Calling this returns to the scheduler across the JNI bridge. | 185 // Calling this returns to the scheduler across the JNI bridge. |
| 184 base::Callback<void(bool)> scheduler_callback_; | 186 base::Callback<void(bool)> scheduler_callback_; |
| 185 // Logger to record events. | 187 // Logger to record events. |
| 186 RequestCoordinatorEventLogger event_logger_; | 188 RequestCoordinatorEventLogger event_logger_; |
| 187 // Timer to watch for pre-render attempts running too long. | 189 // Timer to watch for pre-render attempts running too long. |
| 188 base::OneShotTimer watchdog_timer_; | 190 base::OneShotTimer watchdog_timer_; |
| 189 // How long to wait for an offliner request before giving up. | 191 // How long to wait for an offliner request before giving up. |
| 190 base::TimeDelta offliner_timeout_; | 192 base::TimeDelta offliner_timeout_; |
| 191 // Allows us to pass a weak pointer to callbacks. | 193 // Allows us to pass a weak pointer to callbacks. |
| 192 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 194 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
| 193 | 195 |
| 194 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 196 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
| 195 }; | 197 }; |
| 196 | 198 |
| 197 } // namespace offline_pages | 199 } // namespace offline_pages |
| 198 | 200 |
| 199 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 201 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| OLD | NEW |