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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // code if any error occurred. If returns 0, there is no more data to read. | 121 // code if any error occurred. If returns 0, there is no more data to read. |
122 // This should not be called before Delegate::OnHeadersReceived is invoked, | 122 // This should not be called before Delegate::OnHeadersReceived is invoked, |
123 // and should not be called again unless it returns with number greater than | 123 // and should not be called again unless it returns with number greater than |
124 // 0 or until Delegate::OnDataRead is invoked. | 124 // 0 or until Delegate::OnDataRead is invoked. |
125 virtual int ReadData(IOBuffer* buf, int buf_len) = 0; | 125 virtual int ReadData(IOBuffer* buf, int buf_len) = 0; |
126 | 126 |
127 // Sends data. This should not be called be called before | 127 // Sends data. This should not be called be called before |
128 // Delegate::OnHeadersSent is invoked, and should not be called again until | 128 // Delegate::OnHeadersSent is invoked, and should not be called again until |
129 // Delegate::OnDataSent is invoked. If |end_stream| is true, the DATA frame | 129 // Delegate::OnDataSent is invoked. If |end_stream| is true, the DATA frame |
130 // will have an END_STREAM flag. | 130 // will have an END_STREAM flag. |
131 virtual void SendData(const scoped_refptr<IOBuffer>& data, | |
132 int length, | |
133 bool end_stream) = 0; | |
134 | |
135 virtual void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, | 131 virtual void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, |
136 const std::vector<int>& lengths, | 132 const std::vector<int>& lengths, |
137 bool end_stream) = 0; | 133 bool end_stream) = 0; |
138 | 134 |
139 // Returns the protocol used by this stream. If stream has not been | 135 // Returns the protocol used by this stream. If stream has not been |
140 // established, return kProtoUnknown. | 136 // established, return kProtoUnknown. |
141 virtual NextProto GetProtocol() const = 0; | 137 virtual NextProto GetProtocol() const = 0; |
142 | 138 |
143 // Total number of bytes received over the network of SPDY data, headers, and | 139 // Total number of bytes received over the network of SPDY data, headers, and |
144 // push_promise frames associated with this stream, including the size of | 140 // push_promise frames associated with this stream, including the size of |
(...skipping 11 matching lines...) Expand all Loading... |
156 // and false otherwise. | 152 // and false otherwise. |
157 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; | 153 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; |
158 | 154 |
159 private: | 155 private: |
160 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); | 156 DISALLOW_COPY_AND_ASSIGN(BidirectionalStreamImpl); |
161 }; | 157 }; |
162 | 158 |
163 } // namespace net | 159 } // namespace net |
164 | 160 |
165 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ | 161 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_IMPL_H_ |
OLD | NEW |