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 #ifndef NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_ | 5 #ifndef NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_ |
6 #define NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_ | 6 #define NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "net/http/http_pipelined_host.h" | 13 #include "net/http/http_pipelined_host.h" |
14 #include "net/http/http_pipelined_host_capability.h" | 14 #include "net/http/http_pipelined_host_capability.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class Value; | 17 class Value; |
18 } | 18 } |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 | 21 |
22 class HostPortPair; | 22 class HostPortPair; |
23 class HttpPipelinedStream; | 23 class HttpPipelinedStream; |
24 class HttpServerProperties; | 24 class HttpServerProperties; |
25 | 25 |
26 // Manages all of the pipelining state for specific host with active pipelined | 26 // Manages all of the pipelining state for specific host with active pipelined |
27 // HTTP requests. Manages connection jobs, constructs pipelined streams, and | 27 // HTTP requests. Manages connection jobs, constructs pipelined streams, and |
28 // assigns requests to the least loaded pipelined connection. | 28 // assigns requests to the least loaded pipelined connection. |
29 class NET_EXPORT_PRIVATE HttpPipelinedHostPool | 29 class NET_EXPORT_PRIVATE HttpPipelinedHostPool |
30 : public HttpPipelinedHost::Delegate { | 30 : public NON_EXPORTED_BASE(HttpPipelinedHost::Delegate) { |
31 public: | 31 public: |
32 class Delegate { | 32 class Delegate { |
33 public: | 33 public: |
| 34 virtual ~Delegate() {} |
| 35 |
34 // Called when a HttpPipelinedHost has new capacity. Attempts to allocate | 36 // Called when a HttpPipelinedHost has new capacity. Attempts to allocate |
35 // any pending pipeline-capable requests to pipelines. | 37 // any pending pipeline-capable requests to pipelines. |
36 virtual void OnHttpPipelinedHostHasAdditionalCapacity( | 38 virtual void OnHttpPipelinedHostHasAdditionalCapacity( |
37 HttpPipelinedHost* host) = 0; | 39 HttpPipelinedHost* host) = 0; |
38 }; | 40 }; |
39 | 41 |
40 HttpPipelinedHostPool(Delegate* delegate, | 42 HttpPipelinedHostPool(Delegate* delegate, |
41 HttpPipelinedHost::Factory* factory, | 43 HttpPipelinedHost::Factory* factory, |
42 HttpServerProperties* http_server_properties_, | 44 HttpServerProperties* http_server_properties_, |
43 bool force_pipelining); | 45 bool force_pipelining); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 HostMap host_map_; | 93 HostMap host_map_; |
92 HttpServerProperties* http_server_properties_; | 94 HttpServerProperties* http_server_properties_; |
93 bool force_pipelining_; | 95 bool force_pipelining_; |
94 | 96 |
95 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostPool); | 97 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostPool); |
96 }; | 98 }; |
97 | 99 |
98 } // namespace net | 100 } // namespace net |
99 | 101 |
100 #endif // NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_ | 102 #endif // NET_HTTP_HTTP_PIPELINED_HOST_POOL_H_ |
OLD | NEW |