| 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 2277cd26e552e7003d77f6ed78d2450972aaa207..f2518ea19991b784b87826dff2da6c76c82d919b 100644
|
| --- a/chrome/browser/component_updater/component_updater_service.cc
|
| +++ b/chrome/browser/component_updater/component_updater_service.cc
|
| @@ -201,6 +201,7 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater {
|
| const CrxDownloader::Result& download_result);
|
|
|
| Status OnDemandUpdateInternal(CrxUpdateItem* item);
|
| + Status OnDemandUpdateWithCooldown(CrxUpdateItem* item);
|
|
|
| void ProcessPendingItems();
|
|
|
| @@ -956,7 +957,7 @@ void CrxUpdateService::OnNewResourceThrottle(
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| // Check if we can on-demand update, else unblock the request anyway.
|
| CrxUpdateItem* item = FindUpdateItemById(crx_id);
|
| - Status status = OnDemandUpdateInternal(item);
|
| + Status status = OnDemandUpdateWithCooldown(item);
|
| if (status == kOk || status == kInProgress) {
|
| item->throttles.push_back(rt);
|
| return;
|
| @@ -972,7 +973,7 @@ ComponentUpdateService::Status CrxUpdateService::OnDemandUpdate(
|
| return OnDemandUpdateInternal(FindUpdateItemById(component_id));
|
| }
|
|
|
| -ComponentUpdateService::Status CrxUpdateService::OnDemandUpdateInternal(
|
| +ComponentUpdateService::Status CrxUpdateService::OnDemandUpdateWithCooldown(
|
| CrxUpdateItem* uit) {
|
| if (!uit)
|
| return kError;
|
| @@ -982,6 +983,14 @@ ComponentUpdateService::Status CrxUpdateService::OnDemandUpdateInternal(
|
| if (delta < base::TimeDelta::FromSeconds(config_->OnDemandDelay()))
|
| return kError;
|
|
|
| + return OnDemandUpdateInternal(uit);
|
| +}
|
| +
|
| +ComponentUpdateService::Status CrxUpdateService::OnDemandUpdateInternal(
|
| + CrxUpdateItem* uit) {
|
| + if (!uit)
|
| + return kError;
|
| +
|
| Status service_status = GetServiceStatus(uit->status);
|
| // If the item is already in the process of being updated, there is
|
| // no point in this call, so return kInProgress.
|
|
|