diff options
author | Huahui Wu <hwu@google.com> | 2011-06-28 10:18:05 -0700 |
---|---|---|
committer | Huahui Wu <hwu@google.com> | 2011-06-28 12:25:05 -0700 |
commit | 0529319f6489e97cd51f1a497754c1e2a169ed41 (patch) | |
tree | 9f17bae5390e404c0991c357e8c76a14916ff101 /Source/WebKit/android | |
parent | e452be1935a2ad2683fb2dc3de631ec063e38dc6 (diff) | |
download | external_webkit-0529319f6489e97cd51f1a497754c1e2a169ed41.zip external_webkit-0529319f6489e97cd51f1a497754c1e2a169ed41.tar.gz external_webkit-0529319f6489e97cd51f1a497754c1e2a169ed41.tar.bz2 |
2nd try: Bubbles up the url that has the invalid certificate.
Same as this CL
https://android-git.corp.google.com/g/#change,117817
except one minor change to make the build happy:
Change-Id: Ie863737eee00c42de5d7a289b60aff8c2cfaa8e2
Diffstat (limited to 'Source/WebKit/android')
-rw-r--r-- | Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreFrameBridge.cpp | 9 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreFrameBridge.h | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp index e293e97..9ee0de2 100644 --- a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp +++ b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp @@ -488,7 +488,7 @@ void WebUrlLoaderClient::reportSslCertError(int cert_error, net::X509Certificate std::vector<std::string> chain_bytes; cert->GetChainDEREncodedBytes(&chain_bytes); this->AddRef(); - m_webFrame->reportSslCertError(this, cert_error, chain_bytes[0]); + m_webFrame->reportSslCertError(this, cert_error, chain_bytes[0], m_request->getUrl()); } void WebUrlLoaderClient::requestClientCert(net::SSLCertRequestInfo* cert_request_info) diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp index cd9cdba..fb558c6 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -288,7 +288,7 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page* mJavaFrame->mGetFile = env->GetMethodID(clazz, "getFile", "(Ljava/lang/String;[BII)I"); mJavaFrame->mDidReceiveAuthenticationChallenge = env->GetMethodID(clazz, "didReceiveAuthenticationChallenge", "(ILjava/lang/String;Ljava/lang/String;Z)V"); - mJavaFrame->mReportSslCertError = env->GetMethodID(clazz, "reportSslCertError", "(II[B)V"); + mJavaFrame->mReportSslCertError = env->GetMethodID(clazz, "reportSslCertError", "(II[BLjava/lang/String;)V"); mJavaFrame->mRequestClientCert = env->GetMethodID(clazz, "requestClientCert", "(I[B)V"); mJavaFrame->mDownloadStart = env->GetMethodID(clazz, "downloadStart", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V"); @@ -966,7 +966,7 @@ WebFrame::didReceiveAuthenticationChallenge(WebUrlLoaderClient* client, const st #endif void -WebFrame::reportSslCertError(WebUrlLoaderClient* client, int cert_error, const std::string& cert) +WebFrame::reportSslCertError(WebUrlLoaderClient* client, int cert_error, const std::string& cert, const std::string& url) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); @@ -982,8 +982,11 @@ WebFrame::reportSslCertError(WebUrlLoaderClient* client, int cert_error, const s jbyte* bytes = env->GetByteArrayElements(jCert, NULL); cert.copy(reinterpret_cast<char*>(bytes), len); - env->CallVoidMethod(javaFrame.get(), mJavaFrame->mReportSslCertError, jHandle, cert_error, jCert); + jstring jUrl = env->NewStringUTF(url.c_str()); + + env->CallVoidMethod(javaFrame.get(), mJavaFrame->mReportSslCertError, jHandle, cert_error, jCert, jUrl); env->DeleteLocalRef(jCert); + env->DeleteLocalRef(jUrl); checkException(env); } diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.h b/Source/WebKit/android/jni/WebCoreFrameBridge.h index d74948f..acf4eb4 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.h +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.h @@ -117,7 +117,7 @@ class WebFrame : public WebCoreRefObject { void didReceiveAuthenticationChallenge(WebUrlLoaderClient*, const std::string& host, const std::string& realm, bool useCachedCredentials); - void reportSslCertError(WebUrlLoaderClient* client, int cert_error, const std::string& cert); + void reportSslCertError(WebUrlLoaderClient* client, int cert_error, const std::string& cert, const std::string& url); void requestClientCert(WebUrlLoaderClient* client, const std::string& host_and_port); |