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

Unified Diff: components/update_client/update_checker.cc

Issue 1740333002: Allow fallback from https to http for component update checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: components/update_client/update_checker.cc
diff --git a/components/update_client/update_checker.cc b/components/update_client/update_checker.cc
index dd851d9baf0d6ca059936ef4b704ebb0ae341b67..f398d003728a4fe67e2285233589e87ba922b4cf 100644
--- a/components/update_client/update_checker.cc
+++ b/components/update_client/update_checker.cc
@@ -85,7 +85,9 @@ class UpdateCheckerImpl : public UpdateChecker {
const UpdateCheckCallback& update_check_callback) override;
private:
- void OnRequestSenderComplete(int error, const std::string& response);
+ void OnRequestSenderComplete(int error,
+ const std::string& response,
+ int retry_after_sec);
base::ThreadChecker thread_checker_;
const scoped_refptr<Configurator> config_;
@@ -126,15 +128,16 @@ bool UpdateCheckerImpl::CheckForUpdates(
}
void UpdateCheckerImpl::OnRequestSenderComplete(int error,
- const std::string& response) {
+ const std::string& response,
+ int retry_after_sec) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!error) {
UpdateResponse update_response;
if (update_response.Parse(response)) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(update_check_callback_, error, update_response.results()));
+ FROM_HERE, base::Bind(update_check_callback_, error,
+ update_response.results(), retry_after_sec));
return;
}
@@ -143,8 +146,8 @@ void UpdateCheckerImpl::OnRequestSenderComplete(int error,
}
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(update_check_callback_, error, UpdateResponse::Results()));
+ FROM_HERE, base::Bind(update_check_callback_, error,
+ UpdateResponse::Results(), retry_after_sec));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698