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

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

Issue 2425873003: [Offline Pages] Add evaluation test support in RequestCoordinator. (Closed)
Patch Set: Addressed comments. 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 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 c523edb98a022d87dbf3a53c29f0681fcab5ead5..371fd23c319dac2200575e2fdbc700c98867a499 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -137,6 +137,14 @@ class RequestCoordinator : public KeyedService,
scheduler_callback_ = callback;
}
+ // A way to set the callback which would be called if the request will be
+ // scheduled immediately. Used by testing harness to determine if a request
+ // has been processed.
+ void SetImmediateScheduleCallbackForTest(
+ const base::Callback<void(bool)> callback) {
+ immediate_schedule_callback_ = callback;
+ }
+
// Observers implementing the RequestCoordinator::Observer interface can
// register here to get notifications of changes to request state. This
// pointer is not owned, and it is the callers responsibility to remove the
@@ -367,6 +375,8 @@ class RequestCoordinator : public KeyedService,
RequestCoordinatorEventLogger event_logger_;
// Timer to watch for pre-render attempts running too long.
base::OneShotTimer watchdog_timer_;
+ // Callback invoked when an immediate request is done (default empty).
+ base::Callback<void(bool)> immediate_schedule_callback_;
// Allows us to pass a weak pointer to callbacks.
base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698