| 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 2a8d14fc728b3205127feafc817ac850b2da40dd..5d6e71d80c3076bba1877c79a862c13307fe1793 100644
|
| --- a/chrome/browser/component_updater/component_updater_service.cc
|
| +++ b/chrome/browser/component_updater/component_updater_service.cc
|
| @@ -313,12 +313,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;
|
|
|
| NotifyObservers(Observer::COMPONENT_UPDATER_STARTED, "");
|
|
|
| + 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;
|
| @@ -327,6 +330,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;
|
| @@ -389,6 +393,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);
|
| }
|
| @@ -620,9 +625,18 @@ 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;
|
| @@ -710,6 +724,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);
|
| @@ -724,18 +739,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;
|
| }
|
| @@ -743,6 +761,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;
|
| }
|
| @@ -750,6 +769,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;
|
| @@ -787,6 +808,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);
|
| }
|
|
|
|
|