| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_ | 5 #ifndef NET_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_ |
| 6 #define NET_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_ | 6 #define NET_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Override the base class to parse and store trailers. | 39 // Override the base class to parse and store trailers. |
| 40 void OnTrailingHeadersComplete(bool fin, | 40 void OnTrailingHeadersComplete(bool fin, |
| 41 size_t frame_len, | 41 size_t frame_len, |
| 42 const QuicHeaderList& header_list) override; | 42 const QuicHeaderList& header_list) override; |
| 43 | 43 |
| 44 // Override the base class to handle creation of the push stream. | 44 // Override the base class to handle creation of the push stream. |
| 45 void OnPromiseHeaderList(QuicStreamId promised_id, | 45 void OnPromiseHeaderList(QuicStreamId promised_id, |
| 46 size_t frame_len, | 46 size_t frame_len, |
| 47 const QuicHeaderList& header_list) override; | 47 const QuicHeaderList& header_list) override; |
| 48 | 48 |
| 49 // ReliableQuicStream implementation called by the session when there's | 49 // QuicStream implementation called by the session when there's data for us. |
| 50 // data for us. | |
| 51 void OnDataAvailable() override; | 50 void OnDataAvailable() override; |
| 52 | 51 |
| 53 // Serializes the headers and body, sends it to the server, and | 52 // Serializes the headers and body, sends it to the server, and |
| 54 // returns the number of bytes sent. | 53 // returns the number of bytes sent. |
| 55 size_t SendRequest(SpdyHeaderBlock headers, base::StringPiece body, bool fin); | 54 size_t SendRequest(SpdyHeaderBlock headers, base::StringPiece body, bool fin); |
| 56 | 55 |
| 57 // Returns the response data. | 56 // Returns the response data. |
| 58 const std::string& data() { return data_; } | 57 const std::string& data() { return data_; } |
| 59 | 58 |
| 60 // Returns whatever headers have been received for this stream. | 59 // Returns whatever headers have been received for this stream. |
| 61 const SpdyHeaderBlock& response_headers() { return response_headers_; } | 60 const SpdyHeaderBlock& response_headers() { return response_headers_; } |
| 62 | 61 |
| 63 size_t header_bytes_read() const { return header_bytes_read_; } | 62 size_t header_bytes_read() const { return header_bytes_read_; } |
| 64 | 63 |
| 65 size_t header_bytes_written() const { return header_bytes_written_; } | 64 size_t header_bytes_written() const { return header_bytes_written_; } |
| 66 | 65 |
| 67 size_t trailer_bytes_read() const { return header_bytes_read_; } | |
| 68 | |
| 69 int response_code() const { return response_code_; } | 66 int response_code() const { return response_code_; } |
| 70 | 67 |
| 71 // While the server's SetPriority shouldn't be called externally, the creator | 68 // While the server's SetPriority shouldn't be called externally, the creator |
| 72 // of client-side streams should be able to set the priority. | 69 // of client-side streams should be able to set the priority. |
| 73 using QuicSpdyStream::SetPriority; | 70 using QuicSpdyStream::SetPriority; |
| 74 | 71 |
| 75 private: | 72 private: |
| 76 // The parsed headers received from the server. | 73 // The parsed headers received from the server. |
| 77 SpdyHeaderBlock response_headers_; | 74 SpdyHeaderBlock response_headers_; |
| 78 | 75 |
| 79 // The parsed content-length, or -1 if none is specified. | 76 // The parsed content-length, or -1 if none is specified. |
| 80 int64_t content_length_; | 77 int64_t content_length_; |
| 81 int response_code_; | 78 int response_code_; |
| 82 std::string data_; | 79 std::string data_; |
| 83 size_t header_bytes_read_; | 80 size_t header_bytes_read_; |
| 84 size_t header_bytes_written_; | 81 size_t header_bytes_written_; |
| 85 | 82 |
| 86 QuicClientSession* session_; | 83 QuicClientSession* session_; |
| 87 | 84 |
| 88 DISALLOW_COPY_AND_ASSIGN(QuicSpdyClientStream); | 85 DISALLOW_COPY_AND_ASSIGN(QuicSpdyClientStream); |
| 89 }; | 86 }; |
| 90 | 87 |
| 91 } // namespace net | 88 } // namespace net |
| 92 | 89 |
| 93 #endif // NET_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_ | 90 #endif // NET_TOOLS_QUIC_QUIC_SPDY_CLIENT_STREAM_H_ |
| OLD | NEW |