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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 12091111: Implement Webviewclient.onReceivedSslError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a bridge for aw_contents_client Created 7 years, 10 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
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));
}
/**

Powered by Google App Engine
This is Rietveld 408576698