| 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_CONNECTION_H_ | 5 #ifndef NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ |
| 6 #define NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ | 6 #define NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
| 10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 class BoundNetLog; | 14 class BoundNetLog; |
| 15 class ClientSocketHandle; | 15 class ClientSocketHandle; |
| 16 class HttpPipelinedStream; | 16 class HttpPipelinedStream; |
| 17 class ProxyInfo; | 17 class ProxyInfo; |
| 18 struct SSLConfig; | 18 struct SSLConfig; |
| 19 | 19 |
| 20 class NET_EXPORT_PRIVATE HttpPipelinedConnection { | 20 class NET_EXPORT_PRIVATE HttpPipelinedConnection { |
| 21 public: | 21 public: |
| 22 enum Feedback { |
| 23 OK, |
| 24 SOCKET_ERROR, |
| 25 OLD_HTTP_VERSION, |
| 26 MUST_CLOSE_CONNECTION, |
| 27 }; |
| 28 |
| 22 class Delegate { | 29 class Delegate { |
| 23 public: | 30 public: |
| 24 // Called when a pipeline has newly available capacity. This may be because | 31 // Called when a pipeline has newly available capacity. This may be because |
| 25 // the first request has been sent and the pipeline is now active. Or, it | 32 // the first request has been sent and the pipeline is now active. Or, it |
| 26 // may be because a request successfully completed. | 33 // may be because a request successfully completed. |
| 27 virtual void OnPipelineHasCapacity(HttpPipelinedConnection* pipeline) = 0; | 34 virtual void OnPipelineHasCapacity(HttpPipelinedConnection* pipeline) = 0; |
| 35 |
| 36 // Called every time a pipeline receives headers. Lets the delegate know if |
| 37 // the headers indicate that pipelining can be used. |
| 38 virtual void OnPipelineFeedback(HttpPipelinedConnection* pipeline, |
| 39 Feedback feedback) = 0; |
| 28 }; | 40 }; |
| 29 | 41 |
| 30 class Factory { | 42 class Factory { |
| 31 public: | 43 public: |
| 32 virtual ~Factory() {} | 44 virtual ~Factory() {} |
| 33 | 45 |
| 34 virtual HttpPipelinedConnection* CreateNewPipeline( | 46 virtual HttpPipelinedConnection* CreateNewPipeline( |
| 35 ClientSocketHandle* connection, | 47 ClientSocketHandle* connection, |
| 36 Delegate* delegate, | 48 Delegate* delegate, |
| 37 const SSLConfig& used_ssl_config, | 49 const SSLConfig& used_ssl_config, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 65 // The source of this pipelined connection. | 77 // The source of this pipelined connection. |
| 66 virtual const NetLog::Source& source() const = 0; | 78 virtual const NetLog::Source& source() const = 0; |
| 67 | 79 |
| 68 // True if this connection was NPN negotiated. | 80 // True if this connection was NPN negotiated. |
| 69 virtual bool was_npn_negotiated() const = 0; | 81 virtual bool was_npn_negotiated() const = 0; |
| 70 }; | 82 }; |
| 71 | 83 |
| 72 } // namespace net | 84 } // namespace net |
| 73 | 85 |
| 74 #endif // NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ | 86 #endif // NET_HTTP_HTTP_PIPELINED_CONNECTION_H_ |
| OLD | NEW |