summaryrefslogtreecommitdiffstats
path: root/net/socket_stream
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 22:00:24 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-05 22:00:24 +0000
commit2b83813511561091e570f15a76ae830e7ccdf8bb (patch)
tree12c5c160730417696e9cb49f083bd4cc67302851 /net/socket_stream
parent746750b6d511d7febcbc8d1930f0bb7971dbbab5 (diff)
downloadchromium_src-2b83813511561091e570f15a76ae830e7ccdf8bb.zip
chromium_src-2b83813511561091e570f15a76ae830e7ccdf8bb.tar.gz
chromium_src-2b83813511561091e570f15a76ae830e7ccdf8bb.tar.bz2
Refactor to address URLRequestContext dependency added in
http://codereview.chromium.org/6873029/ BUG=81009 Review URL: http://codereview.chromium.org/6930040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r--net/socket_stream/socket_stream_job.cc10
-rw-r--r--net/socket_stream/socket_stream_job.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/net/socket_stream/socket_stream_job.cc b/net/socket_stream/socket_stream_job.cc
index 0349de8..cfbea3e 100644
--- a/net/socket_stream/socket_stream_job.cc
+++ b/net/socket_stream/socket_stream_job.cc
@@ -5,6 +5,7 @@
#include "net/socket_stream/socket_stream_job.h"
#include "base/memory/singleton.h"
+#include "net/base/ssl_config_service.h"
#include "net/base/transport_security_state.h"
#include "net/socket_stream/socket_stream_job_manager.h"
#include "net/url_request/url_request_context.h"
@@ -22,13 +23,12 @@ SocketStreamJob::ProtocolFactory* SocketStreamJob::RegisterProtocolFactory(
SocketStreamJob* SocketStreamJob::CreateSocketStreamJob(
const GURL& url,
SocketStream::Delegate* delegate,
- const URLRequestContext& context) {
+ TransportSecurityState* sts,
+ SSLConfigService* ssl) {
GURL socket_url(url);
TransportSecurityState::DomainState domain_state;
- if (url.scheme() == "ws" &&
- context.transport_security_state() &&
- context.transport_security_state()->IsEnabledForHost(
- &domain_state, url.host(), context.IsSNIAvailable()) &&
+ if (url.scheme() == "ws" && sts && sts->IsEnabledForHost(
+ &domain_state, url.host(), SSLConfigService::IsSNIAvailable(ssl)) &&
domain_state.mode == TransportSecurityState::DomainState::MODE_STRICT) {
url_canon::Replacements<char> replacements;
static const char kNewScheme[] = "wss";
diff --git a/net/socket_stream/socket_stream_job.h b/net/socket_stream/socket_stream_job.h
index 24eaa19..fdf8d4b 100644
--- a/net/socket_stream/socket_stream_job.h
+++ b/net/socket_stream/socket_stream_job.h
@@ -16,6 +16,9 @@ class GURL;
namespace net {
+class SSLConfigService;
+class TransportSecurityState;
+
// SocketStreamJob represents full-duplex communication over SocketStream.
// If a protocol (e.g. WebSocket protocol) needs to inspect/modify data
// over SocketStream, you can implement protocol specific job (e.g.
@@ -34,7 +37,8 @@ class SocketStreamJob : public base::RefCountedThreadSafe<SocketStreamJob> {
static SocketStreamJob* CreateSocketStreamJob(
const GURL& url,
SocketStream::Delegate* delegate,
- const URLRequestContext& context);
+ TransportSecurityState* sts,
+ SSLConfigService* ssl);
SocketStreamJob();
void InitSocketStream(SocketStream* socket) {