summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
diff options
context:
space:
mode:
authorHuahui Wu <hwu@google.com>2011-06-27 10:53:00 -0700
committerHuahui Wu <hwu@google.com>2011-06-27 11:24:02 -0700
commitf072ccf633e8c2c2812289f0e65f18320f2147c8 (patch)
tree21201527b740a972320338a6386d79112c993493 /Source/WebKit/android/jni/WebCoreFrameBridge.cpp
parentfc4c5f6f54a106674454dee955a0b4fbd455aeb7 (diff)
downloadexternal_webkit-f072ccf633e8c2c2812289f0e65f18320f2147c8.zip
external_webkit-f072ccf633e8c2c2812289f0e65f18320f2147c8.tar.gz
external_webkit-f072ccf633e8c2c2812289f0e65f18320f2147c8.tar.bz2
Bubbles up the url that has the invalid certificate.
b/2689122 SSL error shows the wrong page when triggered by an image/javascript in the page This CL bubbles the url, which has the invalid cert, up to framework to display it. Related CLs are: Framework: https://android-git.corp.google.com/g/#change,117828 Browser: https://android-git.corp.google.com/g/#change,117835 Change-Id: If01ea2320aa50450a6d3d409123bed5a9f101d61
Diffstat (limited to 'Source/WebKit/android/jni/WebCoreFrameBridge.cpp')
-rw-r--r--Source/WebKit/android/jni/WebCoreFrameBridge.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
index cd9cdba..9d78a40 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 = stdStringToJstring(env, url, true);
+
+ env->CallVoidMethod(javaFrame.get(), mJavaFrame->mReportSslCertError, jHandle, cert_error, jCert, jUrl);
env->DeleteLocalRef(jCert);
+ env->DeleteLocalRef(jUrl);
checkException(env);
}