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

Unified Diff: chrome/browser/component_updater/component_updater_service.cc

Issue 325073002: Component updater should wake up upon new component registration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/component_updater_service.cc
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index ec10a12f42c0e9eb13f51cc5c57bbbae390ec199..94ae2b3aa6fd08983099171a80734c19ed357ef9 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -489,10 +489,23 @@ ComponentUpdateService::Status CrxUpdateService::RegisterComponent(
uit->component = component;
work_items_.push_back(uit);
+
// If this is the first component registered we call Start to
- // schedule the first timer.
- if (running_ && (work_items_.size() == 1))
- Start();
+ // schedule the first timer. Otherwise, reset the timer to trigger another
+ // pass over the work items, if the component updater is sleeping, fact
+ // indicated by a running timer. If the timer is not running, it means that
+ // the service is busy updating something, and in that case, this component
+ // will be picked up at the next pass.
+ if (running_) {
+ if (work_items_.size() == 1) {
+ Start();
+ } else if (timer_.IsRunning()) {
+ timer_.Start(FROM_HERE,
+ base::TimeDelta::FromSeconds(config_->InitialDelay()),
+ this,
+ &CrxUpdateService::ProcessPendingItems);
+ }
+ }
return kOk;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698