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

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

Issue 2641973003: Implement server-suggested update check backoff (Closed)
Patch Set: 2 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 2d17c84918a80ebbe6e541a35974d4458cc193b5..8bab7e2afcef0ec02843b7e507786f4045e02305 100644
--- a/chrome/browser/android/webapk/webapk_installer.cc
+++ b/chrome/browser/android/webapk/webapk_installer.cc
@@ -352,6 +352,7 @@ WebApkInstaller::WebApkInstaller(content::BrowserContext* browser_context,
server_url_(GetServerUrl()),
webapk_download_url_timeout_ms_(kWebApkDownloadUrlTimeoutMs),
download_timeout_ms_(kDownloadTimeoutMs),
+ less_updates_(false),
task_type_(UNDEFINED),
weak_ptr_factory_(this) {
CreateJavaRef();
@@ -416,9 +417,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()) {
+ less_updates_ = response->infrequent_updates();
pkotwicz 2017/02/14 00:15:13 Nit: Rename the field in the proto to |less_update
dominickn 2017/02/14 04:13:34 I'd call it relax_updates
Xi Han 2017/02/14 22:25:47 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;
}
@@ -625,11 +627,11 @@ void WebApkInstaller::OnTimeout() {
}
void WebApkInstaller::OnSuccess() {
- finish_callback_.Run(true, webapk_package_);
+ finish_callback_.Run(true, webapk_package_, less_updates_);
delete this;
}
void WebApkInstaller::OnFailure() {
- finish_callback_.Run(false, webapk_package_);
+ finish_callback_.Run(false, webapk_package_, less_updates_);
delete this;
}

Powered by Google App Engine
This is Rietveld 408576698