OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
11 #include "net/base/net_util.h" | 11 #include "net/base/net_util.h" |
12 #include "net/http/http_network_session.h" | 12 #include "net/http/http_network_session.h" |
| 13 #include "net/http/http_pipelined_connection.h" |
| 14 #include "net/http/http_pipelined_host.h" |
| 15 #include "net/http/http_pipelined_stream.h" |
13 #include "net/http/http_stream_factory_impl_job.h" | 16 #include "net/http/http_stream_factory_impl_job.h" |
14 #include "net/http/http_stream_factory_impl_request.h" | 17 #include "net/http/http_stream_factory_impl_request.h" |
15 #include "net/spdy/spdy_http_stream.h" | 18 #include "net/spdy/spdy_http_stream.h" |
16 | 19 |
17 namespace net { | 20 namespace net { |
18 | 21 |
19 namespace { | 22 namespace { |
20 | 23 |
21 GURL UpgradeUrlToHttps(const GURL& original_url) { | 24 GURL UpgradeUrlToHttps(const GURL& original_url) { |
22 GURL::Replacements replacements; | 25 GURL::Replacements replacements; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 orphaned_job_set_.erase(job); | 207 orphaned_job_set_.erase(job); |
205 delete job; | 208 delete job; |
206 } | 209 } |
207 | 210 |
208 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 211 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
209 preconnect_job_set_.erase(job); | 212 preconnect_job_set_.erase(job); |
210 delete job; | 213 delete job; |
211 OnPreconnectsCompleteInternal(); | 214 OnPreconnectsCompleteInternal(); |
212 } | 215 } |
213 | 216 |
| 217 void HttpStreamFactoryImpl::OnHttpPipelinedHostHasAdditionalCapacity( |
| 218 HttpPipelinedHost* host) { |
| 219 const HostPortPair& origin = host->origin(); |
| 220 HttpPipelinedConnection* pipeline; |
| 221 while ((pipeline = host->FindAvailablePipeline())) { |
| 222 if (!ContainsKey(http_pipelining_request_map_, origin)) { |
| 223 break; |
| 224 } |
| 225 Request* request = *http_pipelining_request_map_[origin].begin(); |
| 226 request->Complete(pipeline->was_npn_negotiated(), |
| 227 false, // not using_spdy |
| 228 pipeline->source()); |
| 229 request->OnStreamReady(NULL, |
| 230 pipeline->used_ssl_config(), |
| 231 pipeline->used_proxy_info(), |
| 232 pipeline->CreateNewStream()); |
| 233 } |
| 234 } |
| 235 |
214 } // namespace net | 236 } // namespace net |
OLD | NEW |