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

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

Issue 2066593003: Add a general purpose facility for letting background tasks wait until (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 a6001a04b6e0d9991bbf1a17ff0dcef48122aa8e..bdad378735ae4d8caff7061a01e071a6b8e4c773 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -47,7 +47,7 @@ class RequestCoordinator : public KeyedService {
// Starts processing of one or more queued save page later requests.
// Returns whether processing was started and that caller should expect
// a callback. If processing was already active, returns false.
- bool StartProcessing(const base::Callback<void(bool)>& callback);
+ bool StartProcessing(const base::Callback<void(bool)> callback);
// Stops the current request processing if active. This is a way for
// caller to abort processing; otherwise, processing will complete on
@@ -93,6 +93,8 @@ class RequestCoordinator : public KeyedService {
Offliner::RequestStatus last_offlining_status_;
// Class to choose which request to schedule next
std::unique_ptr<RequestPicker> picker_;
+ // Calling this returns to the scheduler across the JNI bridge.
+ base::Callback<void(bool)> scheduler_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