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> |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // the connection. | 78 // the connection. |
79 void OnPipelineEmpty(HttpPipelinedConnection* pipeline); | 79 void OnPipelineEmpty(HttpPipelinedConnection* pipeline); |
80 | 80 |
81 // Adds the next pending request to the pipeline if it's still usuable. | 81 // Adds the next pending request to the pipeline if it's still usuable. |
82 void AddRequestToPipeline(HttpPipelinedConnection* connection); | 82 void AddRequestToPipeline(HttpPipelinedConnection* connection); |
83 | 83 |
84 // Returns the current pipeline capacity based on |capability_|. This should | 84 // Returns the current pipeline capacity based on |capability_|. This should |
85 // not be called if |capability_| is INCAPABLE. | 85 // not be called if |capability_| is INCAPABLE. |
86 int GetPipelineCapacity() const; | 86 int GetPipelineCapacity() const; |
87 | 87 |
| 88 // Returns true if |pipeline| can handle a new request. This is true if the |
| 89 // |pipeline| is active, usable, has capacity, and |capability_| is |
| 90 // sufficient. |
| 91 bool CanPipelineAcceptRequests(HttpPipelinedConnection* pipeline) const; |
| 92 |
| 93 // Called when |this| moves from UNKNOWN |capability_| to PROBABLY_CAPABLE. |
| 94 // Causes all pipelines to increase capacity to start pipelining. |
| 95 void NotifyAllPipelinesHaveCapacity(); |
| 96 |
88 HttpPipelinedHost::Delegate* delegate_; | 97 HttpPipelinedHost::Delegate* delegate_; |
89 const HostPortPair origin_; | 98 const HostPortPair origin_; |
90 PipelineInfoMap pipelines_; | 99 PipelineInfoMap pipelines_; |
91 scoped_ptr<HttpPipelinedConnection::Factory> factory_; | 100 scoped_ptr<HttpPipelinedConnection::Factory> factory_; |
92 Capability capability_; | 101 Capability capability_; |
93 | 102 |
94 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl); | 103 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl); |
95 }; | 104 }; |
96 | 105 |
97 } // namespace net | 106 } // namespace net |
98 | 107 |
99 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ | 108 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ |
OLD | NEW |