summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebKit/android/jni/WebCoreFrameBridge.cpp13
-rw-r--r--Source/WebKit/android/jni/WebCoreFrameBridge.h2
2 files changed, 6 insertions, 9 deletions
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
index 46499b1..4350eb6 100644
--- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -289,7 +289,7 @@ WebFrame::WebFrame(JNIEnv* env, jobject obj, jobject historyList, WebCore::Page*
mJavaFrame->mDidReceiveAuthenticationChallenge = env->GetMethodID(clazz, "didReceiveAuthenticationChallenge",
"(ILjava/lang/String;Ljava/lang/String;ZZ)V");
mJavaFrame->mReportSslCertError = env->GetMethodID(clazz, "reportSslCertError", "(II[BLjava/lang/String;)V");
- mJavaFrame->mRequestClientCert = env->GetMethodID(clazz, "requestClientCert", "(I[B)V");
+ mJavaFrame->mRequestClientCert = env->GetMethodID(clazz, "requestClientCert", "(ILjava/lang/String;)V");
mJavaFrame->mDownloadStart = env->GetMethodID(clazz, "downloadStart",
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V");
mJavaFrame->mDidReceiveData = env->GetMethodID(clazz, "didReceiveData", "([BI)V");
@@ -1009,7 +1009,7 @@ WebFrame::reportSslCertError(WebUrlLoaderClient* client, int cert_error, const s
}
void
-WebFrame::requestClientCert(WebUrlLoaderClient* client, const std::string& host_and_port)
+WebFrame::requestClientCert(WebUrlLoaderClient* client, const std::string& hostAndPort)
{
#ifdef ANDROID_INSTRUMENT
TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter);
@@ -1017,13 +1017,10 @@ WebFrame::requestClientCert(WebUrlLoaderClient* client, const std::string& host_
JNIEnv* env = getJNIEnv();
int jHandle = reinterpret_cast<int>(client);
- int len = host_and_port.length();
- jbyteArray jHostAndPort = env->NewByteArray(len);
- jbyte* bytes = env->GetByteArrayElements(jHostAndPort, NULL);
- host_and_port.copy(reinterpret_cast<char*>(bytes), len);
+ int len = hostAndPort.length();
+ ScopedLocalRef<jstring> jHostAndPort(env, stdStringToJstring(env, hostAndPort, true));
- env->CallVoidMethod(mJavaFrame->frame(env).get(), mJavaFrame->mRequestClientCert, jHandle, jHostAndPort);
- env->DeleteLocalRef(jHostAndPort);
+ env->CallVoidMethod(mJavaFrame->frame(env).get(), mJavaFrame->mRequestClientCert, jHandle, jHostAndPort.get());
checkException(env);
}
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.h b/Source/WebKit/android/jni/WebCoreFrameBridge.h
index e49bf35..2b3f5bd 100644
--- a/Source/WebKit/android/jni/WebCoreFrameBridge.h
+++ b/Source/WebKit/android/jni/WebCoreFrameBridge.h
@@ -121,7 +121,7 @@ class WebFrame : public WebCoreRefObject {
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);
+ void requestClientCert(WebUrlLoaderClient* client, const std::string& hostAndPort);
void downloadStart(const std::string& url, const std::string& userAgent, const std::string& contentDisposition, const std::string& mimetype, long long contentLength);