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