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

Unified Diff: components/update_client/update_client.h

Issue 1419473005: Fix task concurrency in components/update_client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/update_client/update_client.h
diff --git a/components/update_client/update_client.h b/components/update_client/update_client.h
index 29b80e065812cfa574fcdfa8d975333803343dc7..e53b634d0ac168e14f2907f808936cd844129b66 100644
--- a/components/update_client/update_client.h
+++ b/components/update_client/update_client.h
@@ -262,18 +262,27 @@ class UpdateClient : public base::RefCounted<UpdateClient> {
// the observers are being notified.
virtual void RemoveObserver(Observer* observer) = 0;
- // Installs the specified CRX. Calls back after the install has been handled.
- // Calls back on |completion_callback| after the update has been handled. The
- // |error| parameter of the |completion_callback| contains an error code in
- // the case of a run-time error, or 0 if the Install has been handled
- // successfully.
+ // Installs the specified CRX. Calls back on |completion_callback| after the
+ // update has been handled. The |error| parameter of the |completion_callback|
+ // contains an error code in the case of a run-time error, or 0 if the
+ // install has been handled successfully. Overlapping calls of this function
+ // are executed concurrently, as long as the id parameter is different,
+ // meaning that installs of different components are parallelized.
+ // The |Install| function is intended to be used for foreground installs of
+ // one CRX. These cases are usually associated with on-demand install
+ // scenarios, which are triggered by user actions. Installs are never
+ // queued up.
virtual void Install(const std::string& id,
const CrxDataCallback& crx_data_callback,
const CompletionCallback& completion_callback) = 0;
// Updates the specified CRXs. Calls back on |crx_data_callback| before the
// update is attempted to give the caller the opportunity to provide the
- // instances of CrxComponent to be used for this update.
+ // instances of CrxComponent to be used for this update. The |Update| function
+ // is intended to be used for background updates of several CRXs. Overlapping
+ // calls to this function result in a queuing behavior, and the execution
+ // of each call is serialized. In addition, updates are always queued up when
+ // installs are running.
virtual void Update(const std::vector<std::string>& ids,
const CrxDataCallback& crx_data_callback,
const CompletionCallback& completion_callback) = 0;
@@ -284,6 +293,7 @@ class UpdateClient : public base::RefCounted<UpdateClient> {
virtual bool GetCrxUpdateState(const std::string& id,
CrxUpdateItem* update_item) const = 0;
+ // Returns true if the |id| is found in any running task.
virtual bool IsUpdating(const std::string& id) const = 0;
protected:

Powered by Google App Engine
This is Rietveld 408576698