summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSelim Gurun <sgurun@google.com>2011-12-09 14:57:58 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-09 14:57:58 -0800
commitfcb1cf52f4e77de290b17b3c11b60ef2f486ee59 (patch)
treedf08f42fb13d09fb00df47cd9ea8e5e540c11798
parent46ded0d896cca693053fe2459c1930de95b65cd9 (diff)
parentaa81668752d33ae7a345626ab61f1ea9fc931392 (diff)
downloadexternal_webkit-fcb1cf52f4e77de290b17b3c11b60ef2f486ee59.zip
external_webkit-fcb1cf52f4e77de290b17b3c11b60ef2f486ee59.tar.gz
external_webkit-fcb1cf52f4e77de290b17b3c11b60ef2f486ee59.tar.bz2
am aa816687: Merge "Prevent native crashes on client cert request" into ics-mr1
* commit 'aa81668752d33ae7a345626ab61f1ea9fc931392': Prevent native crashes on client cert request
-rw-r--r--Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp20
-rw-r--r--Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h3
2 files changed, 12 insertions, 11 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
index 3ca841f..d401f9b 100644
--- a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
+++ b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
@@ -325,16 +325,6 @@ void WebUrlLoaderClient::cancelSslCertError(int cert_error)
this->Release();
}
-void WebUrlLoaderClient::sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain)
-{
- base::Thread* thread = ioThread();
- scoped_refptr<net::X509Certificate> scopedChain(chain);
- if (isActive() && thread)
- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request.get(), &WebRequest::sslClientCert, pkey, scopedChain));
- this->Release();
-}
-
-
void WebUrlLoaderClient::finish()
{
m_finished = true;
@@ -493,12 +483,22 @@ void WebUrlLoaderClient::reportSslCertError(int cert_error, net::X509Certificate
m_webFrame->reportSslCertError(this, cert_error, chain_bytes[0], m_request->getUrl());
}
+void WebUrlLoaderClient::sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain)
+{
+ base::Thread* thread = ioThread();
+ scoped_refptr<net::X509Certificate> scopedChain(chain);
+ if (isActive() && thread)
+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request.get(), &WebRequest::sslClientCert, pkey, scopedChain));
+ this->Release();
+}
+
void WebUrlLoaderClient::requestClientCert(net::SSLCertRequestInfo* cert_request_info)
{
if (!isActive())
return;
std::string host_and_port = cert_request_info->host_and_port;
+ this->AddRef();
m_webFrame->requestClientCert(this, host_and_port);
}
diff --git a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
index 5f03339..4463dfb 100644
--- a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
+++ b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
@@ -74,7 +74,6 @@ public:
void cancelAuth();
void proceedSslCertError();
void cancelSslCertError(int cert_error);
- void sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain);
typedef void CallbackFunction(void*);
@@ -92,6 +91,8 @@ public:
void willSendRequest(PassOwnPtr<WebResponse>);
void authRequired(scoped_refptr<net::AuthChallengeInfo>, bool firstTime, bool suppressDialog);
void reportSslCertError(int cert_error, net::X509Certificate* cert);
+
+ void sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain);
void requestClientCert(net::SSLCertRequestInfo* cert);
// Handle to the chrome IO thread