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

Unified Diff: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java

Issue 2056383002: Upstream: Initialize ChromeWebApkHost in WebappLaunchActivity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
index 3d9eb4a5f7aaa07878b0817ef08515fe287f0acd..a6b790cfa50f2b0bbcd82236ce712e1e3690413d 100644
--- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
+++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
@@ -26,6 +26,7 @@ public class WebApkValidator {
private static final String TAG = "WebApkValidator";
private static byte[] sExpectedSignature;
+ private static boolean sIsInitialized = false;
/**
* Queries the PackageManager to determine whether a WebAPK can handle the URL. Ignores
@@ -118,6 +119,10 @@ public class WebApkValidator {
* @param expectedSignature
*/
public static void initWithBrowserHostSignature(byte[] expectedSignature) {
+ if (sIsInitialized) {
pkotwicz 2016/06/10 21:34:14 Can we return if sExpectedSignature != null ?
Xi Han 2016/06/13 20:10:53 Done.
+ return;
+ }
sExpectedSignature = Arrays.copyOf(expectedSignature, expectedSignature.length);
+ sIsInitialized = true;
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698