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 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
14 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
17 #include "components/keyed_service/core/keyed_service.h" | 18 #include "components/keyed_service/core/keyed_service.h" |
18 #include "components/offline_pages/background/device_conditions.h" | 19 #include "components/offline_pages/background/device_conditions.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 std::unique_ptr<ClientPolicyController> policy_controller_; | 341 std::unique_ptr<ClientPolicyController> policy_controller_; |
341 // Unowned pointer to the Network Quality Estimator. | 342 // Unowned pointer to the Network Quality Estimator. |
342 net::NetworkQualityEstimator::NetworkQualityProvider* | 343 net::NetworkQualityEstimator::NetworkQualityProvider* |
343 network_quality_estimator_; | 344 network_quality_estimator_; |
344 // Holds copy of the active request, if any. | 345 // Holds copy of the active request, if any. |
345 std::unique_ptr<SavePageRequest> active_request_; | 346 std::unique_ptr<SavePageRequest> active_request_; |
346 // Status of the most recent offlining. | 347 // Status of the most recent offlining. |
347 Offliner::RequestStatus last_offlining_status_; | 348 Offliner::RequestStatus last_offlining_status_; |
348 // Class to choose which request to schedule next | 349 // Class to choose which request to schedule next |
349 std::unique_ptr<RequestPicker> picker_; | 350 std::unique_ptr<RequestPicker> picker_; |
| 351 // A set of request_ids that we are holding off until the download manager is |
| 352 // done with them. |
| 353 std::set<int64_t> disabled_requests_; |
350 // Calling this returns to the scheduler across the JNI bridge. | 354 // Calling this returns to the scheduler across the JNI bridge. |
351 base::Callback<void(bool)> scheduler_callback_; | 355 base::Callback<void(bool)> scheduler_callback_; |
352 // Logger to record events. | 356 // Logger to record events. |
353 RequestCoordinatorEventLogger event_logger_; | 357 RequestCoordinatorEventLogger event_logger_; |
354 // Timer to watch for pre-render attempts running too long. | 358 // Timer to watch for pre-render attempts running too long. |
355 base::OneShotTimer watchdog_timer_; | 359 base::OneShotTimer watchdog_timer_; |
356 // How long to wait for an offliner request before giving up. | 360 // How long to wait for an offliner request before giving up. |
357 base::TimeDelta offliner_timeout_; | 361 base::TimeDelta offliner_timeout_; |
358 // Allows us to pass a weak pointer to callbacks. | 362 // Allows us to pass a weak pointer to callbacks. |
359 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 363 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
360 | 364 |
361 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 365 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
362 }; | 366 }; |
363 | 367 |
364 } // namespace offline_pages | 368 } // namespace offline_pages |
365 | 369 |
366 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 370 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
OLD | NEW |