Chromium Code Reviews| 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 052f988e0f7306a196e2799491ae6777f77965eb..97f79fa8162724d07d8a63ac585187c8047d2541 100644 |
| --- a/chrome/browser/android/webapk/webapk_installer.h |
| +++ b/chrome/browser/android/webapk/webapk_installer.h |
| @@ -6,6 +6,7 @@ |
| #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
| #include <jni.h> |
| +#include <map> |
| #include <memory> |
| #include "base/android/scoped_java_ref.h" |
| @@ -63,19 +64,22 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| // Talks to the Chrome WebAPK server to update a WebAPK on the server and to |
| // the Google Play server to install the downloaded WebAPK. Calls |callback| |
| // after the request to install the WebAPK is sent to the Google Play server. |
| - void UpdateAsync(content::BrowserContext* browser_context, |
| - const FinishCallback& callback, |
| - const std::string& icon_murmur2_hash, |
| - const std::string& webapk_package, |
| - int webapk_version); |
| + void UpdateAsync( |
| + content::BrowserContext* browser_context, |
| + const FinishCallback& callback, |
| + const std::string& webapk_package, |
| + int webapk_version, |
| + bool stale_manifest, |
|
dominickn
2016/12/20 05:05:49
is_manifest_stale
Also consider having the bool a
Xi Han
2016/12/20 20:25:09
Done.
|
| + const std::map<std::string, std::string>& icon_url_to_murmur2_hash_map); |
| // Same as UpdateAsync() but uses the passed in |request_context_getter|. |
| void UpdateAsyncWithURLRequestContextGetter( |
| net::URLRequestContextGetter* request_context_getter, |
| const FinishCallback& callback, |
| - const std::string& icon_murmur2_hash, |
| const std::string& webapk_package, |
| - int webapk_version); |
| + int webapk_version, |
| + bool stale_manifest, |
|
dominickn
2016/12/20 05:05:49
is_manifest_stale
Xi Han
2016/12/20 20:25:09
Done.
|
| + const std::map<std::string, std::string>& icon_url_to_murmur2_hash_map); |
| // Sets the timeout for the server requests. |
| void SetTimeoutMs(int timeout_ms); |
| @@ -85,6 +89,13 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| const base::android::JavaParamRef<jobject>& obj, |
| jboolean success); |
| + // Creates a WebApk install or update request. |
| + // Should be used only for testing. |
| + void BuildWebApkProtoInBackgroundForTesting( |
| + const base::Callback<void(std::unique_ptr<webapk::WebApk>)>& callback, |
| + bool stale_manifest, |
|
dominickn
2016/12/20 05:05:49
is_manifest_stale, consider moving it to last.
Xi Han
2016/12/20 20:25:09
Moved it to last and updated other places as well.
|
| + const std::map<std::string, std::string>& icon_url_to_murmur2_hash_map); |
| + |
| // Registers JNI hooks. |
| static bool Register(JNIEnv* env); |
| @@ -222,10 +233,6 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| // WebAPK app icon. |
| const SkBitmap shortcut_icon_; |
| - // Murmur2 hash of the bitmap at the app icon URL prior to any transformations |
| - // being applied to the bitmap (such as encoding/decoding the icon bitmap). |
| - std::string shortcut_icon_murmur2_hash_; |
| - |
| // WebAPK server URL. |
| GURL server_url_; |