OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_IMPL_H_ | 5 #ifndef NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ |
6 #define NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ | 6 #define NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "net/base/host_port_pair.h" | 14 #include "net/base/host_port_pair.h" |
15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
16 #include "net/http/http_pipelined_connection.h" | 16 #include "net/http/http_pipelined_connection.h" |
17 #include "net/http/http_pipelined_host.h" | 17 #include "net/http/http_pipelined_host.h" |
| 18 #include "net/http/http_pipelined_host_capability.h" |
18 | 19 |
19 namespace net { | 20 namespace net { |
20 | 21 |
21 class BoundNetLog; | 22 class BoundNetLog; |
22 class ClientSocketHandle; | 23 class ClientSocketHandle; |
23 class HttpPipelinedStream; | 24 class HttpPipelinedStream; |
24 class ProxyInfo; | 25 class ProxyInfo; |
25 struct SSLConfig; | 26 struct SSLConfig; |
26 | 27 |
27 // Manages all of the pipelining state for specific host with active pipelined | 28 // Manages all of the pipelining state for specific host with active pipelined |
28 // HTTP requests. Manages connection jobs, constructs pipelined streams, and | 29 // HTTP requests. Manages connection jobs, constructs pipelined streams, and |
29 // assigns requests to the least loaded pipelined connection. | 30 // assigns requests to the least loaded pipelined connection. |
30 class NET_EXPORT_PRIVATE HttpPipelinedHostImpl | 31 class NET_EXPORT_PRIVATE HttpPipelinedHostImpl |
31 : public HttpPipelinedHost, | 32 : public HttpPipelinedHost, |
32 public HttpPipelinedConnection::Delegate { | 33 public HttpPipelinedConnection::Delegate { |
33 public: | 34 public: |
34 HttpPipelinedHostImpl(HttpPipelinedHost::Delegate* delegate, | 35 HttpPipelinedHostImpl(HttpPipelinedHost::Delegate* delegate, |
35 const HostPortPair& origin, | 36 const HostPortPair& origin, |
36 HttpPipelinedConnection::Factory* factory, | 37 HttpPipelinedConnection::Factory* factory, |
37 Capability capability); | 38 HttpPipelinedHostCapability capability); |
38 virtual ~HttpPipelinedHostImpl(); | 39 virtual ~HttpPipelinedHostImpl(); |
39 | 40 |
40 // HttpPipelinedHost interface | 41 // HttpPipelinedHost interface |
41 virtual HttpPipelinedStream* CreateStreamOnNewPipeline( | 42 virtual HttpPipelinedStream* CreateStreamOnNewPipeline( |
42 ClientSocketHandle* connection, | 43 ClientSocketHandle* connection, |
43 const SSLConfig& used_ssl_config, | 44 const SSLConfig& used_ssl_config, |
44 const ProxyInfo& used_proxy_info, | 45 const ProxyInfo& used_proxy_info, |
45 const BoundNetLog& net_log, | 46 const BoundNetLog& net_log, |
46 bool was_npn_negotiated) OVERRIDE; | 47 bool was_npn_negotiated) OVERRIDE; |
47 | 48 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bool CanPipelineAcceptRequests(HttpPipelinedConnection* pipeline) const; | 92 bool CanPipelineAcceptRequests(HttpPipelinedConnection* pipeline) const; |
92 | 93 |
93 // Called when |this| moves from UNKNOWN |capability_| to PROBABLY_CAPABLE. | 94 // Called when |this| moves from UNKNOWN |capability_| to PROBABLY_CAPABLE. |
94 // Causes all pipelines to increase capacity to start pipelining. | 95 // Causes all pipelines to increase capacity to start pipelining. |
95 void NotifyAllPipelinesHaveCapacity(); | 96 void NotifyAllPipelinesHaveCapacity(); |
96 | 97 |
97 HttpPipelinedHost::Delegate* delegate_; | 98 HttpPipelinedHost::Delegate* delegate_; |
98 const HostPortPair origin_; | 99 const HostPortPair origin_; |
99 PipelineInfoMap pipelines_; | 100 PipelineInfoMap pipelines_; |
100 scoped_ptr<HttpPipelinedConnection::Factory> factory_; | 101 scoped_ptr<HttpPipelinedConnection::Factory> factory_; |
101 Capability capability_; | 102 HttpPipelinedHostCapability capability_; |
102 | 103 |
103 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl); | 104 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl); |
104 }; | 105 }; |
105 | 106 |
106 } // namespace net | 107 } // namespace net |
107 | 108 |
108 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ | 109 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ |
OLD | NEW |