Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: net/http/http_stream_factory_impl.cc

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use HttpStreamFactoryImpl::Job Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 orphaned_job_set_.erase(job); 201 orphaned_job_set_.erase(job);
199 delete job; 202 delete job;
200 } 203 }
201 204
202 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { 205 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) {
203 preconnect_job_set_.erase(job); 206 preconnect_job_set_.erase(job);
204 delete job; 207 delete job;
205 OnPreconnectsCompleteInternal(); 208 OnPreconnectsCompleteInternal();
206 } 209 }
207 210
211 void HttpStreamFactoryImpl::OnHttpPipelinedHostHasAdditionalCapacity(
212 HttpPipelinedHost* host) {
213 const HostPortPair& origin = host->origin();
214 HttpPipelinedConnection* pipeline;
215 while ((pipeline = host->FindAvailablePipeline())) {
216 if (!ContainsKey(http_pipelining_request_map_, origin)) {
217 break;
218 }
219 Request* request = *http_pipelining_request_map_[origin].begin();
220 request->Complete(pipeline->was_npn_negotiated(),
221 false, // not using_spdy
222 pipeline->source());
223 request->OnStreamReady(NULL,
224 pipeline->used_ssl_config(),
225 pipeline->used_proxy_info(),
226 new HttpPipelinedStream(pipeline));
227 }
228 }
229
208 } // namespace net 230 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698