Index: android_webview/java/src/org/chromium/android_webview/AwContents.java |
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
index a0027c3ac6c13b485b1a2bc44d6b6e837cb33444..bd9afa81fb4dca2062af90f4240aa1cbbf073fac 100644 |
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java |
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
@@ -36,17 +36,12 @@ import org.chromium.content.common.CleanupReference; |
import org.chromium.components.navigation_interception.InterceptNavigationDelegate; |
import org.chromium.components.navigation_interception.NavigationParams; |
import org.chromium.net.GURLUtils; |
-import org.chromium.net.X509Util; |
import org.chromium.ui.gfx.DeviceDisplayInfo; |
import org.chromium.ui.gfx.NativeWindow; |
import java.io.File; |
import java.net.MalformedURLException; |
import java.net.URL; |
-import java.security.KeyStoreException; |
-import java.security.NoSuchAlgorithmException; |
-import java.security.cert.CertificateException; |
-import java.security.cert.X509Certificate; |
/** |
* Exposes the native AwContents class, and together these classes wrap the ContentViewCore |
@@ -94,6 +89,7 @@ public class AwContents { |
private ViewGroup mContainerView; |
private ContentViewCore mContentViewCore; |
private AwContentsClient mContentsClient; |
+ private AwContentsClientBridge mContentsClientBridge; |
private AwContentsIoThreadClient mIoThreadClient; |
private InterceptNavigationDelegateImpl mInterceptNavigationDelegate; |
private InternalAccessDelegate mInternalAccessAdapter; |
@@ -277,6 +273,8 @@ public class AwContents { |
ContentVideoView.registerContentVideoViewContextDelegate( |
new AwContentVideoViewDelegate(contentsClient, containerView.getContext())); |
+ |
+ mContentsClientBridge = new AwContentsClientBridge(contentsClient, mNativeAwContents); |
} |
public ContentViewCore getContentViewCore() { |
@@ -300,6 +298,7 @@ public class AwContents { |
public void destroy() { |
mContentViewCore.destroy(); |
+ mContentsClientBridge.destroy(); |
// The native part of AwSettings isn't needed for the IoThreadClient instance. |
mSettings.destroy(); |
// We explicitly do not null out the mContentViewCore reference here |
@@ -610,29 +609,8 @@ public class AwContents { |
*/ |
public SslCertificate getCertificate() { |
if (mNativeAwContents == 0) return null; |
- byte[] derBytes = nativeGetCertificate(mNativeAwContents); |
- if (derBytes == null) { |
- return null; |
- } |
- |
- try { |
- X509Certificate x509Certificate = |
- X509Util.createCertificateFromBytes(derBytes); |
- return new SslCertificate(x509Certificate); |
- } catch (CertificateException e) { |
- // Intentional fall through |
- // A SSL related exception must have occured. This shouldn't happen. |
- Log.w(TAG, "Could not read certificate: " + e); |
- } catch (KeyStoreException e) { |
- // Intentional fall through |
- // A SSL related exception must have occured. This shouldn't happen. |
- Log.w(TAG, "Could not read certificate: " + e); |
- } catch (NoSuchAlgorithmException e) { |
- // Intentional fall through |
- // A SSL related exception must have occured. This shouldn't happen. |
- Log.w(TAG, "Could not read certificate: " + e); |
- } |
- return null; |
+ return AwContentsClientBridge |
+ .getCertificateFromDerBytes(nativeGetCertificate(mNativeAwContents)); |
} |
/** |