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

Side by Side Diff: net/http/http_pipelined_host_pool.h

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 2 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
« no previous file with comments | « net/http/http_pipelined_host.cc ('k') | net/http/http_pipelined_host_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_
6 #define NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_
7 #pragma once
8
9 #include <map>
10
11 #include "base/basictypes.h"
12 #include "net/http/http_pipelined_host.h"
13
14 namespace net {
15
16 class HostPortPair;
17 class HttpPipelinedStream;
18 class HttpStreamFactoryImpl;
19
20 // Manages all of the pipelining state for specific host with active pipelined
21 // HTTP requests. Manages connection jobs, constructs pipelined streams, and
22 // assigns requests to the least loaded pipelined connection.
23 class HttpPipelinedHostPool : public HttpPipelinedHost::Delegate {
24 public:
25 explicit HttpPipelinedHostPool(HttpStreamFactoryImpl* factory);
26 ~HttpPipelinedHostPool();
27
28 // Constructs a new pipeline on |connection| and returns a new
29 // HttpPipelinedStream that uses it.
30 HttpPipelinedStream* CreateStreamOnNewPipeline(
31 const HostPortPair& origin,
32 ClientSocketHandle* connection,
33 const SSLConfig& used_ssl_config,
34 const ProxyInfo& used_proxy_info,
35 const BoundNetLog& net_log,
36 bool was_npn_negotiated);
37
38 // Tries to find an existing pipeline with capacity for a new request. If
39 // successful, returns a new stream on that pipeline. Otherwise, returns NULL.
40 HttpPipelinedStream* CreateStreamOnExistingPipeline(
41 const HostPortPair& origin);
42
43 // Returns true if a pipelined connection already exists for this origin and
44 // can accept new requests.
45 bool IsExistingPipelineAvailableForOrigin(const HostPortPair& origin);
46
47 // Callbacks for HttpPipelinedHost.
48 virtual void OnHostIdle(HttpPipelinedHost* host) OVERRIDE;
49
50 virtual void OnHostHasAdditionalCapacity(HttpPipelinedHost* host) OVERRIDE;
51
52 private:
53 typedef std::map<const HostPortPair, HttpPipelinedHost*> HostMap;
54
55 HttpPipelinedHost* GetPipelinedHost(const HostPortPair& origin,
56 bool create_if_not_found);
57
58 HttpStreamFactoryImpl* factory_;
59 HostMap host_map_;
60
61 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostPool);
62 };
63
64 } // namespace net
65
66 #endif // NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_
OLDNEW
« no previous file with comments | « net/http/http_pipelined_host.cc ('k') | net/http/http_pipelined_host_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698