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

Unified Diff: components/component_updater/component_updater_service.h

Issue 2261533003: Provide a callback for Component Updater OnDemand calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/component_updater/component_updater_service.h
diff --git a/components/component_updater/component_updater_service.h b/components/component_updater/component_updater_service.h
index 48ae4799addf805e38613775c8554e57dec3b600..7fc06dc82613d11fc23e1843b5635370d5c50444 100644
--- a/components/component_updater/component_updater_service.h
+++ b/components/component_updater/component_updater_service.h
@@ -77,6 +77,7 @@ struct ComponentInfo {
// All methods are safe to call ONLY from the browser's main thread.
class ComponentUpdateService {
public:
+ using CompletionCallback = update_client::UpdateClient::CompletionCallback;
using Observer = update_client::UpdateClient::Observer;
// Adds an observer for this class. An observer should not be added more
@@ -162,11 +163,11 @@ class OnDemandUpdater {
// returned by GetCrxComponentID(). If an update for this component is already
// in progress, the function returns |kInProgress|. If an update is available,
// the update will be applied. The caller can subscribe to component update
- // service notifications to get an indication about the outcome of the
- // on-demand update. The function does not implement any cooldown interval.
- // TODO(sorin): improve this API so that the result of this non-blocking
- // call is provided by a callback.
- virtual bool OnDemandUpdate(const std::string& id) = 0;
+ // service notifications and provide an optional callback to get the result
+ // of the call. The function does not implement any cooldown interval.
+ virtual void OnDemandUpdate(
+ const std::string& id,
+ ComponentUpdateService::CompletionCallback callback) = 0;
};
// Creates the component updater.

Powered by Google App Engine
This is Rietveld 408576698