OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import org.chromium.base.ThreadUtils; | 7 import org.chromium.base.ThreadUtils; |
8 import org.chromium.base.annotations.CalledByNative; | 8 import org.chromium.base.annotations.CalledByNative; |
9 import org.chromium.base.annotations.JNINamespace; | 9 import org.chromium.base.annotations.JNINamespace; |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 getClientCertLookupTable().clear(); | 40 getClientCertLookupTable().clear(); |
41 nativeClearClientCertPreferences(callback); | 41 nativeClearClientCertPreferences(callback); |
42 } | 42 } |
43 | 43 |
44 @CalledByNative | 44 @CalledByNative |
45 private static void clientCertificatesCleared(Runnable callback) { | 45 private static void clientCertificatesCleared(Runnable callback) { |
46 if (callback == null) return; | 46 if (callback == null) return; |
47 callback.run(); | 47 callback.run(); |
48 } | 48 } |
49 | 49 |
50 /** | |
51 * Set Data Reduction Proxy key for authentication. | |
52 */ | |
53 public static void setDataReductionProxyKey(String key) { | |
54 ThreadUtils.assertOnUiThread(); | |
55 nativeSetDataReductionProxyKey(key); | |
56 } | |
57 | |
58 /* | |
59 * Enable or disable data reduction proxy. | |
60 */ | |
61 public static void setDataReductionProxyEnabled(boolean enabled) { | |
62 ThreadUtils.assertOnUiThread(); | |
63 nativeSetDataReductionProxyEnabled(enabled); | |
64 } | |
65 | |
66 public static String getUnreachableWebDataUrl() { | 50 public static String getUnreachableWebDataUrl() { |
67 // Note that this method may be called from both IO and UI threads, | 51 // Note that this method may be called from both IO and UI threads, |
68 // but as it only retrieves a value of a constant from native, even if | 52 // but as it only retrieves a value of a constant from native, even if |
69 // two calls will be running at the same time, this should not cause | 53 // two calls will be running at the same time, this should not cause |
70 // any harm. | 54 // any harm. |
71 if (sUnreachableWebDataUrl == null) { | 55 if (sUnreachableWebDataUrl == null) { |
72 sUnreachableWebDataUrl = nativeGetUnreachableWebDataUrl(); | 56 sUnreachableWebDataUrl = nativeGetUnreachableWebDataUrl(); |
73 } | 57 } |
74 return sUnreachableWebDataUrl; | 58 return sUnreachableWebDataUrl; |
75 } | 59 } |
(...skipping 16 matching lines...) Expand all Loading... |
92 | 76 |
93 public static void setServiceWorkerIoThreadClient(AwContentsIoThreadClient i
oThreadClient, | 77 public static void setServiceWorkerIoThreadClient(AwContentsIoThreadClient i
oThreadClient, |
94 AwBrowserContext browserContext) { | 78 AwBrowserContext browserContext) { |
95 nativeSetServiceWorkerIoThreadClient(ioThreadClient, browserContext); | 79 nativeSetServiceWorkerIoThreadClient(ioThreadClient, browserContext); |
96 } | 80 } |
97 | 81 |
98 //--------------------------------------------------------------------------
------------------ | 82 //--------------------------------------------------------------------------
------------------ |
99 // Native methods | 83 // Native methods |
100 //--------------------------------------------------------------------------
------------------ | 84 //--------------------------------------------------------------------------
------------------ |
101 private static native void nativeClearClientCertPreferences(Runnable callbac
k); | 85 private static native void nativeClearClientCertPreferences(Runnable callbac
k); |
102 private static native void nativeSetDataReductionProxyKey(String key); | |
103 private static native void nativeSetDataReductionProxyEnabled(boolean enable
d); | |
104 private static native String nativeGetUnreachableWebDataUrl(); | 86 private static native String nativeGetUnreachableWebDataUrl(); |
105 private static native void nativeSetLegacyCacheRemovalDelayForTest(long time
outMs); | 87 private static native void nativeSetLegacyCacheRemovalDelayForTest(long time
outMs); |
106 private static native String nativeGetProductVersion(); | 88 private static native String nativeGetProductVersion(); |
107 private static native void nativeSetServiceWorkerIoThreadClient( | 89 private static native void nativeSetServiceWorkerIoThreadClient( |
108 AwContentsIoThreadClient ioThreadClient, AwBrowserContext browserCon
text); | 90 AwContentsIoThreadClient ioThreadClient, AwBrowserContext browserCon
text); |
109 } | 91 } |
OLD | NEW |