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

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

Issue 2528073002: Add a flag in WebAPK's proto when the Web App Manifest is no longer available. (Closed)
Patch Set: Try to fix the compile error. Created 4 years 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
« no previous file with comments | « chrome/browser/android/webapk/webapk.proto ('k') | chrome/browser/android/webapk/webapk_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1b102c2f09dd84b0e216bbf3daecdd28f0450206 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,
+ 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,
+ 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);
@@ -121,6 +125,8 @@ class WebApkInstaller : public net::URLFetcherDelegate {
void OnSuccess();
private:
+ friend class WebApkInstallerRunner;
+
enum TaskType {
UNDEFINED,
INSTALL,
@@ -198,6 +204,14 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// installed.
void OnFailure();
+ // Populates webapk::WebApk and returns it.
+ // Must be called on a worker thread because it encodes an SkBitmap.
+ static std::unique_ptr<webapk::WebApk> BuildWebApkProtoInBackground(
dominickn 2016/12/15 03:33:40 A private static method with a friended test is ve
pkotwicz 2016/12/15 04:21:52 Dominick, how do you suggest making this cleaner.
dominickn 2016/12/15 04:30:35 Friending a test class is fine - what's ugly here
+ const ShortcutInfo& shortcut_info,
+ const SkBitmap& shortcut_icon,
+ bool stale_manifest,
+ std::map<std::string, std::string> icon_url_to_murmur2_hash_map);
dominickn 2016/12/15 03:33:40 Make this a const reference.
+
net::URLRequestContextGetter* request_context_getter_;
// Sends HTTP request to WebAPK server.
@@ -222,10 +236,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_;
« no previous file with comments | « chrome/browser/android/webapk/webapk.proto ('k') | chrome/browser/android/webapk/webapk_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698