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

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

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.h
diff --git a/chrome/browser/android/webapk/webapk_installer.h b/chrome/browser/android/webapk/webapk_installer.h
index 94b807c84969a34cb7da29275da9b040c4b437b6..36c23a0a8cb7d508ac093d553678fb88b5f26742 100644
--- a/chrome/browser/android/webapk/webapk_installer.h
+++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -39,11 +39,22 @@ class WebApkIconHasher;
// Java WebApkInstaller counterpart.
class WebApkInstaller : public net::URLFetcherDelegate {
public:
+ // This struct is passed to an FinishCallback when a WebAPK install or update
+ // is finished. TODO.
+ struct FinishCallbackData {
pkotwicz 2017/02/10 02:51:22 Can we change FinishCallback to have three argumen
Xi Han 2017/02/13 22:56:15 Done.
+ // The package name of the WebAPK installed or updated.
+ const std::string& webapk_package_name;
+
+ // True if Chrome received a "don't update so frequently" directive from the
+ // WebAPK server.
+ const bool infrequent_updates;
+ };
+
// Called when the creation/updating of a WebAPK is finished or failed.
// Parameters:
// - whether the process succeeds.
// - the package name of the WebAPK.
- using FinishCallback = base::Callback<void(bool, const std::string&)>;
+ using FinishCallback = base::Callback<void(bool, const FinishCallbackData&)>;
~WebApkInstaller() override;
@@ -270,6 +281,9 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// WebAPK package name.
std::string webapk_package_;
+ // Whether to update an WebAPK less frequently.
pkotwicz 2017/02/10 02:51:22 How about: "Whether the server wants the WebAPK to
Xi Han 2017/02/13 22:56:14 Done.
+ bool infrequent_updates_;
+
// WebAPK version code.
int webapk_version_;

Powered by Google App Engine
This is Rietveld 408576698