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

Unified Diff: components/component_updater/component_updater_service.h

Issue 2257363002: Define EnabledComponentUpdates group policy for the component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@callback
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..48b12a1a8e916ab2cbe78845a8fc5d6a6f94928c 100644
--- a/components/component_updater/component_updater_service.h
+++ b/components/component_updater/component_updater_service.h
@@ -37,6 +37,10 @@ class URLRequestContextGetter;
class URLRequest;
}
+namespace policy {
+class ComponentUpdaterPolicyTest;
+}
+
namespace update_client {
class ComponentInstaller;
class Configurator;
@@ -77,6 +81,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
@@ -154,6 +159,7 @@ class OnDemandUpdater {
private:
friend class OnDemandTester;
+ friend class policy::ComponentUpdaterPolicyTest;
friend class SupervisedUserWhitelistInstaller;
friend class ::ComponentsUI;
friend class ::PluginObserver;
@@ -162,11 +168,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