| 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 903674a15409ab26adcd249e7c6f06c886e10402..bf2371c82c8c88c9b03caca78ad37ac1228e033c 100644
|
| --- a/chrome/browser/component_updater/component_updater_service.cc
|
| +++ b/chrome/browser/component_updater/component_updater_service.cc
|
| @@ -300,12 +300,15 @@ ComponentUpdateService::Status CrxUpdateService::Start() {
|
| // Note that RegisterComponent will call Start() when the first
|
| // component is registered, so it can be called twice. This way
|
| // we avoid scheduling the timer if there is no work to do.
|
| + VLOG(1) << "CrxUpdateService starting up";
|
| running_ = true;
|
| if (work_items_.empty())
|
| return kOk;
|
|
|
| NotifyComponentObservers(ComponentObserver::COMPONENT_UPDATER_STARTED, 0);
|
|
|
| + VLOG(1) << "First update attempt will take place in "
|
| + << config_->InitialDelay() << " seconds";
|
| timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(config_->InitialDelay()),
|
| this, &CrxUpdateService::ProcessPendingItems);
|
| return kOk;
|
| @@ -314,6 +317,7 @@ ComponentUpdateService::Status CrxUpdateService::Start() {
|
| // Stop the main check + update loop. In flight operations will be
|
| // completed.
|
| ComponentUpdateService::Status CrxUpdateService::Stop() {
|
| + VLOG(1) << "CrxUpdateService stopping";
|
| running_ = false;
|
| timer_.Stop();
|
| return kOk;
|
| @@ -376,6 +380,7 @@ void CrxUpdateService::ScheduleNextRun(StepDelayInterval step_delay) {
|
| return;
|
| }
|
|
|
| + VLOG(1) << "Scheduling next run to occur in " << delay_seconds << " seconds";
|
| timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(delay_seconds),
|
| this, &CrxUpdateService::ProcessPendingItems);
|
| }
|
| @@ -610,9 +615,16 @@ bool CrxUpdateService::CheckForUpdates() {
|
|
|
| if (!item->on_demand &&
|
| time_since_last_checked < minimum_recheck_wait_time) {
|
| + VLOG(1) << "Skipping check for component update: id=" << item->id
|
| + << ", time_since_last_checked=" << time_since_last_checked.InSeconds()
|
| + << " seconds: too soon to check for an update";
|
| continue;
|
| }
|
|
|
| + VLOG(1) << "Scheduling update check for component id=" << item->id
|
| + << ", time_since_last_checked=" << time_since_last_checked.InSeconds()
|
| + << " seconds";
|
| +
|
| ChangeItemState(item, CrxUpdateItem::kChecking);
|
|
|
| item->last_check = now;
|
| @@ -701,6 +713,7 @@ void CrxUpdateService::OnUpdateCheckSucceeded(
|
| const UpdateResponse::Results& results) {
|
| size_t num_updates_pending = 0;
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + VLOG(1) << "Update check succeeded.";
|
| std::vector<UpdateResponse::Result>::const_iterator it;
|
| for (it = results.list.begin(); it != results.list.end(); ++it) {
|
| CrxUpdateItem* crx = FindUpdateItemById(it->extension_id);
|
| @@ -715,18 +728,21 @@ void CrxUpdateService::OnUpdateCheckSucceeded(
|
| if (it->manifest.version.empty()) {
|
| // No version means no update available.
|
| ChangeItemState(crx, CrxUpdateItem::kNoUpdate);
|
| + VLOG(1) << "No update available for component: " << crx->id;
|
| continue;
|
| }
|
|
|
| if (!IsVersionNewer(crx->component.version, it->manifest.version)) {
|
| // The component is up to date.
|
| ChangeItemState(crx, CrxUpdateItem::kUpToDate);
|
| + VLOG(1) << "Component already up-to-date: " << crx->id;
|
| continue;
|
| }
|
|
|
| if (!it->manifest.browser_min_version.empty()) {
|
| if (IsVersionNewer(chrome_version_, it->manifest.browser_min_version)) {
|
| // The component is not compatible with this Chrome version.
|
| + VLOG(1) << "Ignoring incompatible component: " << crx->id;
|
| ChangeItemState(crx, CrxUpdateItem::kNoUpdate);
|
| continue;
|
| }
|
| @@ -734,6 +750,7 @@ void CrxUpdateService::OnUpdateCheckSucceeded(
|
|
|
| if (it->manifest.packages.size() != 1) {
|
| // Assume one and only one package per component.
|
| + VLOG(1) << "Ignoring multiple packages for component: " << crx->id;
|
| ChangeItemState(crx, CrxUpdateItem::kNoUpdate);
|
| continue;
|
| }
|
| @@ -741,6 +758,8 @@ void CrxUpdateService::OnUpdateCheckSucceeded(
|
| // Parse the members of the result and queue an upgrade for this component.
|
| crx->next_version = Version(it->manifest.version);
|
|
|
| + VLOG(1) << "Update found for component: " << crx->id;
|
| +
|
| typedef UpdateResponse::Result::Manifest::Package Package;
|
| const Package& package(it->manifest.packages[0]);
|
| crx->next_fp = package.fingerprint;
|
| @@ -778,6 +797,7 @@ void CrxUpdateService::OnUpdateCheckFailed(int error,
|
| size_t count = ChangeItemStatus(CrxUpdateItem::kChecking,
|
| CrxUpdateItem::kNoUpdate);
|
| DCHECK_GT(count, 0ul);
|
| + VLOG(1) << "Update check failed.";
|
| ScheduleNextRun(kStepDelayLong);
|
| }
|
|
|
|
|