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

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

Issue 2641973003: Implement server-suggested update check backoff (Closed)
Patch Set: Created 3 years, 11 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 b7933f47c80c540f71436a80b5e5dbf2782cde7d..a518d1e15bcd7a74d3c232b28b61a3db111bbc79 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),
+ infrequent_updates_(false),
task_type_(UNDEFINED),
weak_ptr_factory_(this) {
CreateJavaRef();
@@ -418,6 +419,7 @@ void WebApkInstaller::OnURLFetchComplete(const net::URLFetcher* source) {
}
pkotwicz 2017/02/10 02:51:22 We should set |less_updates_| from within the if
Xi Han 2017/02/13 22:56:14 Done.
GURL signed_download_url(response->signed_download_url());
+ infrequent_updates_ = response->infrequent_updates();
// 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()) {
@@ -621,11 +623,13 @@ void WebApkInstaller::OnTimeout() {
}
void WebApkInstaller::OnSuccess() {
- finish_callback_.Run(true, webapk_package_);
+ FinishCallbackData data = {webapk_package_, infrequent_updates_};
+ finish_callback_.Run(true, data);
delete this;
}
void WebApkInstaller::OnFailure() {
- finish_callback_.Run(false, webapk_package_);
+ FinishCallbackData data = {webapk_package_, infrequent_updates_};
+ finish_callback_.Run(false, data);
delete this;
}

Powered by Google App Engine
This is Rietveld 408576698