summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/WebRequest.cpp
diff options
context:
space:
mode:
authorHuahui Wu <hwu@google.com>2010-12-08 15:22:43 -0800
committerHuahui Wu <hwu@google.com>2010-12-15 09:36:28 -0800
commit1f9212cd9a5e957562b12e8c3294b7f357fa1f85 (patch)
treed3ad74023aa22e8a3edbec1c8a1089126e06428e /WebKit/android/WebCoreSupport/WebRequest.cpp
parent0d7cec732e3f00f89749d4946fd22168d8d4111c (diff)
downloadexternal_webkit-1f9212cd9a5e957562b12e8c3294b7f357fa1f85.zip
external_webkit-1f9212cd9a5e957562b12e8c3294b7f357fa1f85.tar.gz
external_webkit-1f9212cd9a5e957562b12e8c3294b7f357fa1f85.tar.bz2
b/2864818 Prompt SSL cert error dialog to user and proceed or cancel the request. Java side CL: https://android-git.corp.google.com/g/#change,84530
Change-Id: I2a16be691ba3846f3ecb1fd533905d7b6ac374fc
Diffstat (limited to 'WebKit/android/WebCoreSupport/WebRequest.cpp')
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp
index 468a3cd..cd496df 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequest.cpp
@@ -318,12 +318,12 @@ void WebRequest::OnAuthRequired(URLRequest* request, net::AuthChallengeInfo* aut
m_urlLoader.get(), &WebUrlLoaderClient::authRequired, authInfoPtr, firstTime));
}
-// Called when we received an SSL certificate error. Right now, we only
-// set the appropriate error code. FIXME: the delegate should provide
+// Called when we received an SSL certificate error. The delegate will provide
// the user the options to proceed, cancel, or view certificates.
void WebRequest::OnSSLCertificateError(URLRequest* request, int cert_error, net::X509Certificate* cert)
{
- request->SimulateError(cert_error);
+ m_urlLoader->maybeCallOnMainThread(NewRunnableMethod(
+ m_urlLoader.get(), &WebUrlLoaderClient::reportSslCertError, cert_error, cert));
}
// After calling Start(), the delegate will receive an OnResponseStarted
@@ -370,6 +370,16 @@ void WebRequest::followDeferredRedirect()
m_request->FollowDeferredRedirect();
}
+void WebRequest::proceedSslCertError()
+{
+ m_request->ContinueDespiteLastError();
+}
+
+void WebRequest::cancelSslCertError(int cert_error)
+{
+ m_request->SimulateError(cert_error);
+}
+
void WebRequest::startReading()
{
ASSERT(m_loadState == Response || m_loadState == GotData, "StartReading in state other than RESPONSE and GOTDATA");