Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: components/offline_pages/background/request_coordinator.h

Issue 2395213002: Implement disabled list (Closed)
Patch Set: Pass the disabled list when looking for a new request. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 std::unique_ptr<ClientPolicyController> policy_controller_; 319 std::unique_ptr<ClientPolicyController> policy_controller_;
319 // Unowned pointer to the Network Quality Estimator. 320 // Unowned pointer to the Network Quality Estimator.
320 net::NetworkQualityEstimator::NetworkQualityProvider* 321 net::NetworkQualityEstimator::NetworkQualityProvider*
321 network_quality_estimator_; 322 network_quality_estimator_;
322 // Holds copy of the active request, if any. 323 // Holds copy of the active request, if any.
323 std::unique_ptr<SavePageRequest> active_request_; 324 std::unique_ptr<SavePageRequest> active_request_;
324 // Status of the most recent offlining. 325 // Status of the most recent offlining.
325 Offliner::RequestStatus last_offlining_status_; 326 Offliner::RequestStatus last_offlining_status_;
326 // Class to choose which request to schedule next 327 // Class to choose which request to schedule next
327 std::unique_ptr<RequestPicker> picker_; 328 std::unique_ptr<RequestPicker> picker_;
329 // A set of request_ids that we are holding off until the download manager is
330 // done with them.
331 std::set<int64_t> disabled_requests_;
328 // Calling this returns to the scheduler across the JNI bridge. 332 // Calling this returns to the scheduler across the JNI bridge.
329 base::Callback<void(bool)> scheduler_callback_; 333 base::Callback<void(bool)> scheduler_callback_;
330 // Logger to record events. 334 // Logger to record events.
331 RequestCoordinatorEventLogger event_logger_; 335 RequestCoordinatorEventLogger event_logger_;
332 // Timer to watch for pre-render attempts running too long. 336 // Timer to watch for pre-render attempts running too long.
333 base::OneShotTimer watchdog_timer_; 337 base::OneShotTimer watchdog_timer_;
334 // How long to wait for an offliner request before giving up. 338 // How long to wait for an offliner request before giving up.
335 base::TimeDelta offliner_timeout_; 339 base::TimeDelta offliner_timeout_;
336 // Allows us to pass a weak pointer to callbacks. 340 // Allows us to pass a weak pointer to callbacks.
337 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; 341 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_;
338 342
339 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); 343 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator);
340 }; 344 };
341 345
342 } // namespace offline_pages 346 } // namespace offline_pages
343 347
344 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ 348 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698