external/webkit
Revision | aa81668752d33ae7a345626ab61f1ea9fc931392 (tree) |
---|---|
Time | 2011-12-09 03:19:59 |
Author | Selim Gurun <sgurun@goog...> |
Commiter | Android (Google) Code Review |
Merge "Prevent native crashes on client cert request" into ics-mr1
@@ -324,16 +324,6 @@ void WebUrlLoaderClient::cancelSslCertError(int cert_error) | ||
324 | 324 | this->Release(); |
325 | 325 | } |
326 | 326 | |
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 | - | |
337 | 327 | void WebUrlLoaderClient::finish() |
338 | 328 | { |
339 | 329 | m_finished = true; |
@@ -492,12 +482,22 @@ void WebUrlLoaderClient::reportSslCertError(int cert_error, net::X509Certificate | ||
492 | 482 | m_webFrame->reportSslCertError(this, cert_error, chain_bytes[0], m_request->getUrl()); |
493 | 483 | } |
494 | 484 | |
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 | + | |
495 | 494 | void WebUrlLoaderClient::requestClientCert(net::SSLCertRequestInfo* cert_request_info) |
496 | 495 | { |
497 | 496 | if (!isActive()) |
498 | 497 | return; |
499 | 498 | |
500 | 499 | std::string host_and_port = cert_request_info->host_and_port; |
500 | + this->AddRef(); | |
501 | 501 | m_webFrame->requestClientCert(this, host_and_port); |
502 | 502 | } |
503 | 503 |
@@ -74,7 +74,6 @@ public: | ||
74 | 74 | void cancelAuth(); |
75 | 75 | void proceedSslCertError(); |
76 | 76 | void cancelSslCertError(int cert_error); |
77 | - void sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain); | |
78 | 77 | |
79 | 78 | typedef void CallbackFunction(void*); |
80 | 79 |
@@ -92,6 +91,8 @@ public: | ||
92 | 91 | void willSendRequest(PassOwnPtr<WebResponse>); |
93 | 92 | void authRequired(scoped_refptr<net::AuthChallengeInfo>, bool firstTime, bool suppressDialog); |
94 | 93 | void reportSslCertError(int cert_error, net::X509Certificate* cert); |
94 | + | |
95 | + void sslClientCert(EVP_PKEY* pkey, net::X509Certificate* chain); | |
95 | 96 | void requestClientCert(net::SSLCertRequestInfo* cert); |
96 | 97 | |
97 | 98 | // Handle to the chrome IO thread |