summaryrefslogtreecommitdiffstats
path: root/net/socket_stream
diff options
context:
space:
mode:
authortoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 23:25:16 +0000
committertoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 23:25:16 +0000
commit734e5d88bfa0d11f6d6042766e6c0ea4361d6102 (patch)
tree07bdd479b8a26bd3fef11e43379da6bde5525c17 /net/socket_stream
parenta9fbb096c17043dce4780bc5c77de24c78b5b596 (diff)
downloadchromium_src-734e5d88bfa0d11f6d6042766e6c0ea4361d6102.zip
chromium_src-734e5d88bfa0d11f6d6042766e6c0ea4361d6102.tar.gz
chromium_src-734e5d88bfa0d11f6d6042766e6c0ea4361d6102.tar.bz2
Use SSLManager to handle SSL error in SocketStreamDispatcherHost
- Provide render_process_id from RenderProcessHostImpl and WorkerProcessHost to SocketStreamDispatcherHost. - Provide render_view_id from SocketStreamHost to SocketStreamDispatcherHost. - Implement SSLErrorHandler::Delegate in SocketStreamDispatcherHost. - Then use SSLManager in SocketStreamDispatcherHost. BUG=53836 TEST=none Review URL: http://codereview.chromium.org/9704045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r--net/socket_stream/socket_stream.cc11
-rw-r--r--net/socket_stream/socket_stream.h15
-rw-r--r--net/socket_stream/socket_stream_job.cc14
-rw-r--r--net/socket_stream/socket_stream_job.h7
4 files changed, 36 insertions, 11 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index 8604d28..8560733 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -255,14 +255,17 @@ void SocketStream::SetClientSocketFactory(
factory_ = factory;
}
-void SocketStream::CancelBecauseOfCertError(const SSLInfo& ssl_info) {
+void SocketStream::CancelWithError(int error) {
MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(&SocketStream::DoLoop, this,
- MapCertStatusToNetError(ssl_info.cert_status)));
+ base::Bind(&SocketStream::DoLoop, this, error));
}
-void SocketStream::ContinueDespiteCertError() {
+void SocketStream::CancelWithSSLError(const SSLInfo& ssl_info) {
+ CancelWithError(MapCertStatusToNetError(ssl_info.cert_status));
+}
+
+void SocketStream::ContinueDespiteError() {
MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&SocketStream::DoLoop, this, OK));
diff --git a/net/socket_stream/socket_stream.h b/net/socket_stream/socket_stream.h
index cf678d9..7f07196 100644
--- a/net/socket_stream/socket_stream.h
+++ b/net/socket_stream/socket_stream.h
@@ -99,7 +99,7 @@ class NET_EXPORT SocketStream
virtual void OnSSLCertificateError(SocketStream* socket,
const SSLInfo& ssl_info,
bool fatal) {
- socket->CancelBecauseOfCertError(ssl_info);
+ socket->CancelWithSSLError(ssl_info);
}
// Called when an error occured.
@@ -175,14 +175,17 @@ class NET_EXPORT SocketStream
// |factory|. For testing purposes only.
void SetClientSocketFactory(ClientSocketFactory* factory);
- // Cancel the connection because of receiving a certificate with an error.
+ // Cancels the connection because of an error.
// |error| is net::Error which represents the error.
- void CancelBecauseOfCertError(const SSLInfo& ssl_info);
+ void CancelWithError(int error);
- // Continue to establish the connection in spite of receiving a certificate
- // with an error. Usually this case happens because users allow it by manual
+ // Cancels the connection because of receiving a certificate with an error.
+ void CancelWithSSLError(const SSLInfo& ssl_info);
+
+ // Continues to establish the connection in spite of an error. Usually this
+ // case happens because users allow certificate with an error by manual
// actions on alert dialog or browser cached such kinds of user actions.
- void ContinueDespiteCertError();
+ void ContinueDespiteError();
protected:
friend class base::RefCountedThreadSafe<SocketStream>;
diff --git a/net/socket_stream/socket_stream_job.cc b/net/socket_stream/socket_stream_job.cc
index b575109..6672df6 100644
--- a/net/socket_stream/socket_stream_job.cc
+++ b/net/socket_stream/socket_stream_job.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -66,6 +66,18 @@ void SocketStreamJob::RestartWithAuth(const AuthCredentials& credentials) {
socket_->RestartWithAuth(credentials);
}
+void SocketStreamJob::CancelWithError(int error) {
+ socket_->CancelWithError(error);
+}
+
+void SocketStreamJob::CancelWithSSLError(const net::SSLInfo& ssl_info) {
+ socket_->CancelWithSSLError(ssl_info);
+}
+
+void SocketStreamJob::ContinueDespiteError() {
+ socket_->ContinueDespiteError();
+}
+
void SocketStreamJob::DetachDelegate() {
socket_->DetachDelegate();
}
diff --git a/net/socket_stream/socket_stream_job.h b/net/socket_stream/socket_stream_job.h
index 6665919..9e6c8f5 100644
--- a/net/socket_stream/socket_stream_job.h
+++ b/net/socket_stream/socket_stream_job.h
@@ -17,6 +17,7 @@ class GURL;
namespace net {
class SSLConfigService;
+class SSLInfo;
class TransportSecurityState;
// SocketStreamJob represents full-duplex communication over SocketStream.
@@ -64,6 +65,12 @@ class NET_EXPORT SocketStreamJob
virtual void RestartWithAuth(const AuthCredentials& credentials);
+ virtual void CancelWithError(int error);
+
+ virtual void CancelWithSSLError(const net::SSLInfo& ssl_info);
+
+ virtual void ContinueDespiteError();
+
virtual void DetachDelegate();
protected: