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

Unified Diff: chrome/browser/android/webapk/webapk_installer.cc

Issue 2641973003: Implement server-suggested update check backoff (Closed)
Patch Set: Rebase. Created 3 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: chrome/browser/android/webapk/webapk_installer.cc
diff --git a/chrome/browser/android/webapk/webapk_installer.cc b/chrome/browser/android/webapk/webapk_installer.cc
index 7df48b20facd97280314ca703e2ea27735ab8632..93f7ab95c4a4d75fd3f25ce6bba6602defe4ee2e 100644
--- a/chrome/browser/android/webapk/webapk_installer.cc
+++ b/chrome/browser/android/webapk/webapk_installer.cc
@@ -353,6 +353,7 @@ WebApkInstaller::WebApkInstaller(content::BrowserContext* browser_context,
server_url_(GetServerUrl()),
webapk_download_url_timeout_ms_(kWebApkDownloadUrlTimeoutMs),
download_timeout_ms_(kDownloadTimeoutMs),
+ relax_updates_(false),
pkotwicz 2017/03/04 00:20:47 Nit: Can you initialize |webapk_version_| ?
Xi Han 2017/03/06 22:14:21 Done.
task_type_(UNDEFINED),
weak_ptr_factory_(this) {
CreateJavaRef();
@@ -420,9 +421,10 @@ void WebApkInstaller::OnURLFetchComplete(const net::URLFetcher* source) {
}
GURL signed_download_url(response->signed_download_url());
- // https://crbug.com/680131. The server sends an empty URL if the server does
- // not have a newer WebAPK to update to.
if (task_type_ == UPDATE && signed_download_url.is_empty()) {
+ relax_updates_ = response->relax_updates();
pkotwicz 2017/03/04 00:20:47 Nit: Move the setting of |relax_updates_| after th
Xi Han 2017/03/06 22:14:21 Done.
+ // https://crbug.com/680131. The server sends an empty URL if the server
+ // does not have a newer WebAPK to update to.
OnSuccess();
return;
}
@@ -627,11 +629,11 @@ void WebApkInstaller::OnTimeout() {
}
void WebApkInstaller::OnSuccess() {
- finish_callback_.Run(true, webapk_package_);
+ finish_callback_.Run(true, relax_updates_, webapk_package_);
delete this;
}
void WebApkInstaller::OnFailure() {
- finish_callback_.Run(false, webapk_package_);
+ finish_callback_.Run(false, relax_updates_, webapk_package_);
delete this;
}

Powered by Google App Engine
This is Rietveld 408576698