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 HttpPipelinedStream* stream; |
237 while (ContainsKey(http_pipelining_request_map_, origin) && | 237 while (ContainsKey(http_pipelining_request_map_, host->key()) && |
238 (stream = http_pipelined_host_pool_.CreateStreamOnExistingPipeline( | 238 (stream = http_pipelined_host_pool_.CreateStreamOnExistingPipeline( |
239 origin))) { | 239 host->key()))) { |
mmenke
2012/02/23 18:54:58
[optional]: Think this might be a little easier to
James Simonsen
2012/02/23 23:49:46
Done.
| |
240 Request* request = *http_pipelining_request_map_[origin].begin(); | 240 Request* request = *http_pipelining_request_map_[host->key()].begin(); |
241 request->Complete(stream->was_npn_negotiated(), | 241 request->Complete(stream->was_npn_negotiated(), |
242 stream->protocol_negotiated(), | 242 stream->protocol_negotiated(), |
243 false, // not using_spdy | 243 false, // not using_spdy |
244 stream->net_log()); | 244 stream->net_log()); |
245 request->OnStreamReady(NULL, | 245 request->OnStreamReady(NULL, |
246 stream->used_ssl_config(), | 246 stream->used_ssl_config(), |
247 stream->used_proxy_info(), | 247 stream->used_proxy_info(), |
248 stream); | 248 stream); |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 void HttpStreamFactoryImpl::AbortPipelinedRequestsWithKey( | |
253 const Job* job, const HttpPipelinedHost::Key& key, int status, | |
254 const SSLConfig& used_ssl_config) { | |
255 RequestSet requests_to_fail = http_pipelining_request_map_[key]; | |
256 requests_to_fail.erase(request_map_[job]); | |
257 for (RequestSet::const_iterator it = requests_to_fail.begin(); | |
258 it != requests_to_fail.end(); ++it) { | |
259 Request* request = *it; | |
260 request->OnStreamFailed(NULL, status, used_ssl_config); | |
261 } | |
262 } | |
263 | |
252 } // namespace net | 264 } // namespace net |
OLD | NEW |