summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-10-12 09:58:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-12 09:58:20 -0700
commitd33401fdd5a0b8f3d82389f1d7cc5168fa14a122 (patch)
tree06f27a74448461bef83d81f4f65bbaca06d670f2 /Source
parent47f387fdb2c9e81ee710f41b1e79f1419817801a (diff)
parent6cf7e07ab895af6265850c3df2da05a09977e9a0 (diff)
downloadexternal_webkit-d33401fdd5a0b8f3d82389f1d7cc5168fa14a122.zip
external_webkit-d33401fdd5a0b8f3d82389f1d7cc5168fa14a122.tar.gz
external_webkit-d33401fdd5a0b8f3d82389f1d7cc5168fa14a122.tar.bz2
Merge "Modify BrowserFrame.requestClientCert() to take the host and port as a String" into ics-mr0
Diffstat (limited to 'Source')
-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);