summaryrefslogtreecommitdiffstats
path: root/components/component_updater/component_updater_service.cc
diff options
context:
space:
mode:
authorsorin <sorin@chromium.org>2014-09-16 14:31:07 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-16 21:31:37 +0000
commit395c2ac57fc8f5c2b5175692873a1702538cb84a (patch)
tree0798747d7280e1bf90136bbae5ab19bbb20ea2a4 /components/component_updater/component_updater_service.cc
parent159e3bbd2ae9b208691244005d705cbe29efe75f (diff)
downloadchromium_src-395c2ac57fc8f5c2b5175692873a1702538cb84a.zip
chromium_src-395c2ac57fc8f5c2b5175692873a1702538cb84a.tar.gz
chromium_src-395c2ac57fc8f5c2b5175692873a1702538cb84a.tar.bz2
Implement support for fallback update check urls in the component updater
This allows for specifying more than one urls for update checks and pings. The urls are then tried in the order they are specified. BUG=413879 Review URL: https://codereview.chromium.org/565363002 Cr-Commit-Position: refs/heads/master@{#295146}
Diffstat (limited to 'components/component_updater/component_updater_service.cc')
-rw-r--r--components/component_updater/component_updater_service.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/components/component_updater/component_updater_service.cc b/components/component_updater/component_updater_service.cc
index b005a15..aa69cdd 100644
--- a/components/component_updater/component_updater_service.cc
+++ b/components/component_updater/component_updater_service.cc
@@ -10,6 +10,7 @@
#include "base/at_exit.h"
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
@@ -146,7 +147,8 @@ class CrxUpdateService : public ComponentUpdateService, public OnDemandUpdater {
// Overrides for OnDemandUpdater.
virtual Status OnDemandUpdate(const std::string& component_id) OVERRIDE;
- void UpdateCheckComplete(int error,
+ void UpdateCheckComplete(const GURL& original_url,
+ int error,
const std::string& error_message,
const UpdateResponse::Results& results);
void OnUpdateCheckSucceeded(const UpdateResponse::Results& results);
@@ -613,12 +615,12 @@ bool CrxUpdateService::CheckForUpdates() {
if (items_to_check.empty())
return false;
- update_checker_ =
- UpdateChecker::Create(*config_,
- base::Bind(&CrxUpdateService::UpdateCheckComplete,
- base::Unretained(this))).Pass();
- return update_checker_->CheckForUpdates(items_to_check,
- config_->ExtraRequestParams());
+ update_checker_ = UpdateChecker::Create(*config_).Pass();
+ return update_checker_->CheckForUpdates(
+ items_to_check,
+ config_->ExtraRequestParams(),
+ base::Bind(&CrxUpdateService::UpdateCheckComplete,
+ base::Unretained(this)));
}
void CrxUpdateService::UpdateComponent(CrxUpdateItem* workitem) {
@@ -661,10 +663,12 @@ void CrxUpdateService::UpdateComponent(CrxUpdateItem* workitem) {
}
void CrxUpdateService::UpdateCheckComplete(
+ const GURL& original_url,
int error,
const std::string& error_message,
const UpdateResponse::Results& results) {
DCHECK(thread_checker_.CalledOnValidThread());
+ VLOG(1) << "Update check completed from: " << original_url.spec();
update_checker_.reset();
if (!error)
OnUpdateCheckSucceeded(results);