| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 STLDeleteContainerPointers(tmp_job_set.begin(), tmp_job_set.end()); | 27 STLDeleteContainerPointers(tmp_job_set.begin(), tmp_job_set.end()); |
| 28 DCHECK(preconnect_job_set_.empty()); | 28 DCHECK(preconnect_job_set_.empty()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 HttpStreamRequest* HttpStreamFactoryImpl::RequestStream( | 31 HttpStreamRequest* HttpStreamFactoryImpl::RequestStream( |
| 32 const HttpRequestInfo& request_info, | 32 const HttpRequestInfo& request_info, |
| 33 const SSLConfig& ssl_config, | 33 const SSLConfig& ssl_config, |
| 34 HttpStreamRequest::Delegate* delegate, | 34 HttpStreamRequest::Delegate* delegate, |
| 35 const BoundNetLog& net_log) { | 35 const BoundNetLog& net_log) { |
| 36 Job* job = new Job(this, session_); | 36 Job* job = new Job(this, session_); |
| 37 Request* request = new Request(request_info.url, this, delegate); | 37 Request* request = new Request(request_info.url, this, delegate, net_log); |
| 38 request_map_[job] = request; | 38 request_map_[job] = request; |
| 39 request->BindJob(job); | 39 request->BindJob(job); |
| 40 job->Start(request, request_info, ssl_config, net_log); | 40 job->Start(request, request_info, ssl_config, net_log); |
| 41 return request; | 41 return request; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void HttpStreamFactoryImpl::PreconnectStreams( | 44 void HttpStreamFactoryImpl::PreconnectStreams( |
| 45 int num_streams, | 45 int num_streams, |
| 46 const HttpRequestInfo& request_info, | 46 const HttpRequestInfo& request_info, |
| 47 const SSLConfig& ssl_config, | 47 const SSLConfig& ssl_config, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 66 | 66 |
| 67 void HttpStreamFactoryImpl::OnSpdySessionReady( | 67 void HttpStreamFactoryImpl::OnSpdySessionReady( |
| 68 const Job* job, | 68 const Job* job, |
| 69 scoped_refptr<SpdySession> spdy_session, | 69 scoped_refptr<SpdySession> spdy_session, |
| 70 bool direct) { | 70 bool direct) { |
| 71 DCHECK(job->using_spdy()); | 71 DCHECK(job->using_spdy()); |
| 72 DCHECK(ContainsKey(request_map_, job)); | 72 DCHECK(ContainsKey(request_map_, job)); |
| 73 Request* request = request_map_[job]; | 73 Request* request = request_map_[job]; |
| 74 request->Complete(job->was_alternate_protocol_available(), | 74 request->Complete(job->was_alternate_protocol_available(), |
| 75 job->was_npn_negotiated(), | 75 job->was_npn_negotiated(), |
| 76 job->using_spdy()); | 76 job->using_spdy(), |
| 77 job->net_log().source()); |
| 77 bool use_relative_url = direct || request->url().SchemeIs("https"); | 78 bool use_relative_url = direct || request->url().SchemeIs("https"); |
| 78 request->OnStreamReady( | 79 request->OnStreamReady( |
| 79 job->ssl_config(), | 80 job->ssl_config(), |
| 80 job->proxy_info(), | 81 job->proxy_info(), |
| 81 new SpdyHttpStream(spdy_session, use_relative_url)); | 82 new SpdyHttpStream(spdy_session, use_relative_url)); |
| 82 } | 83 } |
| 83 | 84 |
| 84 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 85 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
| 85 preconnect_job_set_.erase(job); | 86 preconnect_job_set_.erase(job); |
| 86 delete job; | 87 delete job; |
| 87 OnPreconnectsCompleteInternal(); | 88 OnPreconnectsCompleteInternal(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 } // namespace net | 91 } // namespace net |
| OLD | NEW |