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

Unified Diff: components/offline_pages/background/request_coordinator.h

Issue 2178143002: Check time budget before starting new requests, and unittest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/background/request_coordinator.h
diff --git a/components/offline_pages/background/request_coordinator.h b/components/offline_pages/background/request_coordinator.h
index c4858505aa3ec8c6743513cd8742368fb015ab78..ce9dc0b1f8e1bdd6753d43f67cf2d0c25a74981f 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -136,10 +136,9 @@ class RequestCoordinator : public KeyedService {
bool is_busy_;
// True if the current request has been canceled.
bool is_canceled_;
- // How long to wait for an offliner request before giving up.
- base::TimeDelta offliner_timeout_;
// Unowned pointer to the current offliner, if any.
Offliner* offliner_;
+ base::Time operation_start_time_;
// Last known conditions for network, battery
std::unique_ptr<DeviceConditions> current_conditions_;
// RequestCoordinator takes over ownership of the policy
@@ -160,6 +159,8 @@ class RequestCoordinator : public KeyedService {
RequestCoordinatorEventLogger event_logger_;
// Timer to watch for pre-render attempts running too long.
base::OneShotTimer watchdog_timer_;
+ // How long to wait for an offliner request before giving up.
+ base::TimeDelta offliner_timeout_;
// Allows us to pass a weak pointer to callbacks.
base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698