Chromium Code Reviews| 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; |
| } |
| } |