OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 delete job; | 225 delete job; |
226 } | 226 } |
227 | 227 |
228 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 228 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
229 preconnect_job_set_.erase(job); | 229 preconnect_job_set_.erase(job); |
230 delete job; | 230 delete job; |
231 OnPreconnectsCompleteInternal(); | 231 OnPreconnectsCompleteInternal(); |
232 } | 232 } |
233 | 233 |
234 void HttpStreamFactoryImpl::OnHttpPipelinedHostHasAdditionalCapacity( | 234 void HttpStreamFactoryImpl::OnHttpPipelinedHostHasAdditionalCapacity( |
235 const HostPortPair& origin) { | 235 HttpPipelinedHost* host) { |
236 HttpPipelinedStream* stream; | 236 while (ContainsKey(http_pipelining_request_map_, host->GetKey())) { |
237 while (ContainsKey(http_pipelining_request_map_, origin) && | 237 HttpPipelinedStream* stream = |
238 (stream = http_pipelined_host_pool_.CreateStreamOnExistingPipeline( | 238 http_pipelined_host_pool_.CreateStreamOnExistingPipeline( |
239 origin))) { | 239 host->GetKey()); |
240 Request* request = *http_pipelining_request_map_[origin].begin(); | 240 if (!stream) { |
| 241 break; |
| 242 } |
| 243 |
| 244 Request* request = *http_pipelining_request_map_[host->GetKey()].begin(); |
241 request->Complete(stream->was_npn_negotiated(), | 245 request->Complete(stream->was_npn_negotiated(), |
242 stream->protocol_negotiated(), | 246 stream->protocol_negotiated(), |
243 false, // not using_spdy | 247 false, // not using_spdy |
244 stream->net_log()); | 248 stream->net_log()); |
245 request->OnStreamReady(NULL, | 249 request->OnStreamReady(NULL, |
246 stream->used_ssl_config(), | 250 stream->used_ssl_config(), |
247 stream->used_proxy_info(), | 251 stream->used_proxy_info(), |
248 stream); | 252 stream); |
249 } | 253 } |
250 } | 254 } |
251 | 255 |
| 256 void HttpStreamFactoryImpl::AbortPipelinedRequestsWithKey( |
| 257 const Job* job, const HttpPipelinedHost::Key& key, int status, |
| 258 const SSLConfig& used_ssl_config) { |
| 259 RequestSet requests_to_fail = http_pipelining_request_map_[key]; |
| 260 requests_to_fail.erase(request_map_[job]); |
| 261 for (RequestSet::const_iterator it = requests_to_fail.begin(); |
| 262 it != requests_to_fail.end(); ++it) { |
| 263 Request* request = *it; |
| 264 request->OnStreamFailed(NULL, status, used_ssl_config); |
| 265 } |
| 266 } |
| 267 |
252 } // namespace net | 268 } // namespace net |
OLD | NEW |