Chromium Code Reviews| Index: net/quic/chromium/quic_chromium_client_stream.h |
| diff --git a/net/quic/chromium/quic_chromium_client_stream.h b/net/quic/chromium/quic_chromium_client_stream.h |
| index 14901d8edcfdfbbc67c6c7b1fd53a7a1f3410581..82841a470fb16953b732758920bb2e14bfaae578 100644 |
| --- a/net/quic/chromium/quic_chromium_client_stream.h |
| +++ b/net/quic/chromium/quic_chromium_client_stream.h |
| @@ -157,6 +157,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream { |
| void OnTrailingHeadersAvailable(const SpdyHeaderBlock& headers, |
| size_t frame_len); |
| void OnDataAvailable(); |
| + void OnCanWrite(); |
| void OnClose(); |
| void OnError(int error); |
| @@ -166,13 +167,19 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream { |
| QuicChromiumClientStream* stream_; // Unowned. |
| Delegate* delegate_; // Owns this. |
| + // Callback to be invoked when ReadHeaders completes asynchronously. |
| CompletionCallback read_headers_callback_; |
| SpdyHeaderBlock* read_headers_buffer_; |
| + // Callback to be invoked when ReadBody completes asynchronously. |
| CompletionCallback read_body_callback_; |
| IOBuffer* read_body_buffer_; |
| int read_body_buffer_len_; |
| + // Callback to be invoked when WriteStreamData or WritevStreamData completes |
| + // asynchronously. |
| + CompletionCallback write_callback_; |
| + |
| QuicStreamId id_; |
| QuicErrorCode connection_error_; |
| QuicRstStreamErrorCode stream_error_; |
| @@ -217,15 +224,15 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream { |
| // of client-side streams should be able to set the priority. |
| using QuicSpdyStream::SetPriority; |
| - int WriteStreamData(QuicStringPiece data, |
| - bool fin, |
| - const CompletionCallback& callback); |
| + // Writes |data| to the peer, loses the write side if |fin| is true and |
|
xunjieli
2017/05/15 15:48:36
minor nit: Maybe break the sentence after "and" or
xunjieli
2017/05/15 15:48:36
nit: loses/closes
Ryan Hamilton
2017/05/20 22:24:54
Done.
Ryan Hamilton
2017/05/20 22:24:54
Done.
|
| + // returns true if the data could actually be written. Returns false |
|
xunjieli
2017/05/15 15:48:37
nit: "could actually be written" isn't as precise.
Ryan Hamilton
2017/05/20 22:24:54
Done.
|
| + // otherwise. |
| + bool WriteStreamData(QuicStringPiece data, bool fin); |
| // Same as WriteStreamData except it writes data from a vector of IOBuffers, |
| // with the length of each buffer at the corresponding index in |lengths|. |
| - int WritevStreamData(const std::vector<scoped_refptr<IOBuffer>>& buffers, |
| - const std::vector<int>& lengths, |
| - bool fin, |
| - const CompletionCallback& callback); |
| + bool WritevStreamData(const std::vector<scoped_refptr<IOBuffer>>& buffers, |
| + const std::vector<int>& lengths, |
| + bool fin); |
| // Creates a new Handle for this stream and sets |delegate| on the handle. |
| // Must only be called once. |
| @@ -274,10 +281,6 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream : public QuicSpdyStream { |
| // True when initial headers have been sent. |
| bool initial_headers_sent_; |
| - // Callback to be invoked when WriteStreamData or WritevStreamData completes |
| - // asynchronously. |
| - CompletionCallback write_callback_; |
| - |
| QuicClientSessionBase* session_; |
| // Set to false if this stream to not be migrated during connection migration. |