Index: net/http/http_stream_factory_impl_request.cc |
diff --git a/net/http/http_stream_factory_impl_request.cc b/net/http/http_stream_factory_impl_request.cc |
index 6195552031f462bc023d920d8552089f60c4ef80..538a7b9ec7546795b185a5688e2931be67002169 100644 |
--- a/net/http/http_stream_factory_impl_request.cc |
+++ b/net/http/http_stream_factory_impl_request.cc |
@@ -16,7 +16,8 @@ namespace net { |
HttpStreamFactoryImpl::Request::Request(const GURL& url, |
HttpStreamFactoryImpl* factory, |
HttpStreamRequest::Delegate* delegate, |
- const BoundNetLog& net_log) |
+ const BoundNetLog& net_log, |
+ bool for_websocket) |
: url_(url), |
factory_(factory), |
delegate_(delegate), |
@@ -24,7 +25,8 @@ HttpStreamFactoryImpl::Request::Request(const GURL& url, |
completed_(false), |
was_npn_negotiated_(false), |
protocol_negotiated_(kProtoUnknown), |
- using_spdy_(false) { |
+ using_spdy_(false), |
+ for_websocket_(for_websocket) { |
DCHECK(factory_); |
DCHECK(delegate_); |
@@ -94,14 +96,7 @@ void HttpStreamFactoryImpl::Request::Complete( |
net_log_.source().ToEventParametersCallback()); |
} |
-void HttpStreamFactoryImpl::Request::OnStreamReady( |
- Job* job, |
- const SSLConfig& used_ssl_config, |
- const ProxyInfo& used_proxy_info, |
- HttpStreamBase* stream) { |
- DCHECK(stream); |
- DCHECK(completed_); |
- |
+void HttpStreamFactoryImpl::Request::Orphan(Job* job) { |
// |job| should only be NULL if we're being serviced by a late bound |
// SpdySession or HttpPipelinedConnection (one that was not created by a job |
// in our |jobs_| set). |
@@ -123,9 +118,48 @@ void HttpStreamFactoryImpl::Request::OnStreamReady( |
} else { |
DCHECK(jobs_.empty()); |
} |
+} |
+ |
+void HttpStreamFactoryImpl::Request::OnStreamReady( |
+ Job* job, |
+ const SSLConfig& used_ssl_config, |
+ const ProxyInfo& used_proxy_info, |
+ HttpStreamBase* stream) { |
+ DCHECK(stream); |
+ DCHECK(completed_); |
mmenke
2013/05/23 20:26:20
I'd like a some more DCHECKs on for_websocket_ in
yhirano
2013/05/24 14:11:16
Done.
|
+ |
+ Orphan(job); |
delegate_->OnStreamReady(used_ssl_config, used_proxy_info, stream); |
} |
+void HttpStreamFactoryImpl::Request::OnSocketReadyForWebSocket( |
+ Job* job, |
+ const SSLConfig& used_ssl_config, |
+ const ProxyInfo& used_proxy_info, |
+ ClientSocketHandle* connection) { |
+ DCHECK(connection); |
+ DCHECK(completed_); |
+ |
+ Orphan(job); |
+ delegate_->OnSocketReadyForWebSocket(used_ssl_config, |
+ used_proxy_info, |
+ connection); |
+} |
+ |
+void HttpStreamFactoryImpl::Request::OnSpdySessionReadyForWebSocket( |
+ Job* job, |
+ const SSLConfig& used_ssl_config, |
+ const ProxyInfo& used_proxy_info, |
+ scoped_refptr<SpdySession> session) { |
+ DCHECK(session); |
+ DCHECK(completed_); |
+ |
+ Orphan(job); |
+ delegate_->OnSpdySessionReadyForWebSocket(used_ssl_config, |
+ used_proxy_info, |
+ session.get()); |
+} |
+ |
void HttpStreamFactoryImpl::Request::OnStreamFailed( |
Job* job, |
int status, |
@@ -280,7 +314,7 @@ HttpStreamFactoryImpl::Request::RemoveRequestFromHttpPipeliningRequestMap() { |
} |
} |
-void HttpStreamFactoryImpl::Request::OnSpdySessionReady( |
+void HttpStreamFactoryImpl::Request::OnNewSpdySessionReady( |
Job* job, |
scoped_refptr<SpdySession> spdy_session, |
bool direct) { |
mmenke
2013/05/23 20:26:20
For functions that cannot be called when using web
yhirano
2013/05/24 14:11:16
In PS13 (or newer), OnNewSpdySessionReady is calle
|
@@ -290,7 +324,7 @@ void HttpStreamFactoryImpl::Request::OnSpdySessionReady( |
// The first case is the usual case. |
if (!bound_job_.get()) { |
OrphanJobsExcept(job); |
- } else { // This is the case for HTTPS proxy tunneling. |
+ } else { // This is the case for HTTPS proxy tunneling. |
DCHECK_EQ(bound_job_.get(), job); |
DCHECK(jobs_.empty()); |
} |
@@ -315,7 +349,7 @@ void HttpStreamFactoryImpl::Request::OnSpdySessionReady( |
job->proxy_info(), |
new SpdyHttpStream(spdy_session, use_relative_url)); |
// |this| may be deleted after this point. |
- factory->OnSpdySessionReady( |
+ factory->OnNewSpdySessionReady( |
spdy_session, direct, used_ssl_config, used_proxy_info, |
was_npn_negotiated, protocol_negotiated, using_spdy, net_log); |
} |