Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-webkit: Commit

external/webkit


Commit MetaInfo

Revisionaa81668752d33ae7a345626ab61f1ea9fc931392 (tree)
Time2011-12-09 03:19:59
AuthorSelim Gurun <sgurun@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "Prevent native crashes on client cert request" into ics-mr1

Change Summary

Incremental Difference

--- a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
+++ b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
@@ -324,16 +324,6 @@ void WebUrlLoaderClient::cancelSslCertError(int cert_error)
324324 this->Release();
325325 }
326326
327-void WebUrlLoaderClient::sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain)
328-{
329- base::Thread* thread = ioThread();
330- scoped_refptr<net::X509Certificate> scopedChain(chain);
331- if (isActive() && thread)
332- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request.get(), &WebRequest::sslClientCert, pkey, scopedChain));
333- this->Release();
334-}
335-
336-
337327 void WebUrlLoaderClient::finish()
338328 {
339329 m_finished = true;
@@ -492,12 +482,22 @@ void WebUrlLoaderClient::reportSslCertError(int cert_error, net::X509Certificate
492482 m_webFrame->reportSslCertError(this, cert_error, chain_bytes[0], m_request->getUrl());
493483 }
494484
485+void WebUrlLoaderClient::sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain)
486+{
487+ base::Thread* thread = ioThread();
488+ scoped_refptr<net::X509Certificate> scopedChain(chain);
489+ if (isActive() && thread)
490+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request.get(), &WebRequest::sslClientCert, pkey, scopedChain));
491+ this->Release();
492+}
493+
495494 void WebUrlLoaderClient::requestClientCert(net::SSLCertRequestInfo* cert_request_info)
496495 {
497496 if (!isActive())
498497 return;
499498
500499 std::string host_and_port = cert_request_info->host_and_port;
500+ this->AddRef();
501501 m_webFrame->requestClientCert(this, host_and_port);
502502 }
503503
--- a/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
+++ b/Source/WebKit/android/WebCoreSupport/WebUrlLoaderClient.h
@@ -74,7 +74,6 @@ public:
7474 void cancelAuth();
7575 void proceedSslCertError();
7676 void cancelSslCertError(int cert_error);
77- void sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain);
7877
7978 typedef void CallbackFunction(void*);
8079
@@ -92,6 +91,8 @@ public:
9291 void willSendRequest(PassOwnPtr<WebResponse>);
9392 void authRequired(scoped_refptr<net::AuthChallengeInfo>, bool firstTime, bool suppressDialog);
9493 void reportSslCertError(int cert_error, net::X509Certificate* cert);
94+
95+ void sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain);
9596 void requestClientCert(net::SSLCertRequestInfo* cert);
9697
9798 // Handle to the chrome IO thread
Show on old repository browser