| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BIDIRECTIONAL_STREAM_IMPL_H_ | 5 #ifndef NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
| 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ | 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // Delegate::OnDataSent is invoked. If |end_stream| is true, the DATA frame | 128 // Delegate::OnDataSent is invoked. If |end_stream| is true, the DATA frame |
| 129 // will have an END_STREAM flag. | 129 // will have an END_STREAM flag. |
| 130 virtual void SendData(const scoped_refptr<IOBuffer>& data, | 130 virtual void SendData(const scoped_refptr<IOBuffer>& data, |
| 131 int length, | 131 int length, |
| 132 bool end_stream) = 0; | 132 bool end_stream) = 0; |
| 133 | 133 |
| 134 virtual void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, | 134 virtual void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, |
| 135 const std::vector<int>& lengths, | 135 const std::vector<int>& lengths, |
| 136 bool end_stream) = 0; | 136 bool end_stream) = 0; |
| 137 | 137 |
| 138 // Cancels the stream. No Delegate method will be called. Any pending | |
| 139 // operations may or may not succeed. | |
| 140 virtual void Cancel() = 0; | |
| 141 | |
| 142 // Returns the protocol used by this stream. If stream has not been | 138 // Returns the protocol used by this stream. If stream has not been |
| 143 // established, return kProtoUnknown. | 139 // established, return kProtoUnknown. |
| 144 virtual NextProto GetProtocol() const = 0; | 140 virtual NextProto GetProtocol() const = 0; |
| 145 | 141 |
| 146 // Total number of bytes received over the network of SPDY data, headers, and | 142 // Total number of bytes received over the network of SPDY data, headers, and |
| 147 // push_promise frames associated with this stream, including the size of | 143 // push_promise frames associated with this stream, including the size of |
| 148 // frame headers, after SSL decryption and not including proxy overhead. | 144 // frame headers, after SSL decryption and not including proxy overhead. |
| 149 virtual int64_t GetTotalReceivedBytes() const = 0; | 145 virtual int64_t GetTotalReceivedBytes() const = 0; |
| 150 | 146 |
| 151 // Total number of bytes sent over the network of SPDY frames associated with | 147 // Total number of bytes sent over the network of SPDY frames associated with |
| 152 // this stream, including the size of frame headers, before SSL encryption and | 148 // this stream, including the size of frame headers, before SSL encryption and |
| 153 // not including proxy overhead. Note that some SPDY frames such as pings are | 149 // not including proxy overhead. Note that some SPDY frames such as pings are |
| 154 // not associated with any stream, and are not included in this value. | 150 // not associated with any stream, and are not included in this value. |
| 155 virtual int64_t GetTotalSentBytes() const = 0; | 151 virtual int64_t GetTotalSentBytes() const = 0; |
| 156 | 152 |
| 157 private: | 153 private: |
| 158 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); | 154 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); |
| 159 }; | 155 }; |
| 160 | 156 |
| 161 } // namespace net | 157 } // namespace net |
| 162 | 158 |
| 163 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ | 159 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
| OLD | NEW |