| 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_H_ | 5 #ifndef NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
| 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 6 #define NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // error code if any error occurred. If returns 0, there is no more data to | 140 // error code if any error occurred. If returns 0, there is no more data to |
| 141 // read. This should not be called before Delegate::OnHeadersReceived is | 141 // read. This should not be called before Delegate::OnHeadersReceived is |
| 142 // invoked, and should not be called again unless it returns with number | 142 // invoked, and should not be called again unless it returns with number |
| 143 // greater than 0 or until Delegate::OnDataRead is invoked. | 143 // greater than 0 or until Delegate::OnDataRead is invoked. |
| 144 int ReadData(IOBuffer* buf, int buf_len); | 144 int ReadData(IOBuffer* buf, int buf_len); |
| 145 | 145 |
| 146 // Sends data. This should not be called before Delegate::OnHeadersSent is | 146 // Sends data. This should not be called before Delegate::OnHeadersSent is |
| 147 // invoked, and should not be called again until Delegate::OnDataSent is | 147 // invoked, and should not be called again until Delegate::OnDataSent is |
| 148 // invoked. If |end_stream| is true, the DATA frame will have an END_STREAM | 148 // invoked. If |end_stream| is true, the DATA frame will have an END_STREAM |
| 149 // flag. | 149 // flag. |
| 150 void SendData(const scoped_refptr<IOBuffer>& data, | |
| 151 int length, | |
| 152 bool end_stream); | |
| 153 | |
| 154 // Same as SendData except this takes in a vector of IOBuffers. | |
| 155 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, | 150 void SendvData(const std::vector<scoped_refptr<IOBuffer>>& buffers, |
| 156 const std::vector<int>& lengths, | 151 const std::vector<int>& lengths, |
| 157 bool end_stream); | 152 bool end_stream); |
| 158 | 153 |
| 159 // Returns the protocol used by this stream. If stream has not been | 154 // Returns the protocol used by this stream. If stream has not been |
| 160 // established, return kProtoUnknown. | 155 // established, return kProtoUnknown. |
| 161 NextProto GetProtocol() const; | 156 NextProto GetProtocol() const; |
| 162 | 157 |
| 163 // Total number of bytes received over the network of SPDY data, headers, and | 158 // Total number of bytes received over the network of SPDY data, headers, and |
| 164 // push_promise frames associated with this stream, including the size of | 159 // push_promise frames associated with this stream, including the size of |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 LoadTimingInfo load_timing_info_; | 250 LoadTimingInfo load_timing_info_; |
| 256 | 251 |
| 257 base::WeakPtrFactory<BidirectionalStream> weak_factory_; | 252 base::WeakPtrFactory<BidirectionalStream> weak_factory_; |
| 258 | 253 |
| 259 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); | 254 DISALLOW_COPY_AND_ASSIGN(BidirectionalStream); |
| 260 }; | 255 }; |
| 261 | 256 |
| 262 } // namespace net | 257 } // namespace net |
| 263 | 258 |
| 264 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ | 259 #endif // NET_HTTP_BIDIRECTIONAL_STREAM_H_ |
| OLD | NEW |