| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_QUIC_QUIC_SPDY_SERVER_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_ |
| 6 #define NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_ | 6 #define NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class QuicSpdyServerStream : public QuicDataStream { | 26 class QuicSpdyServerStream : public QuicDataStream { |
| 27 public: | 27 public: |
| 28 QuicSpdyServerStream(QuicStreamId id, QuicSession* session); | 28 QuicSpdyServerStream(QuicStreamId id, QuicSession* session); |
| 29 virtual ~QuicSpdyServerStream(); | 29 virtual ~QuicSpdyServerStream(); |
| 30 | 30 |
| 31 // ReliableQuicStream implementation called by the session when there's | 31 // ReliableQuicStream implementation called by the session when there's |
| 32 // data for us. | 32 // data for us. |
| 33 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE; | 33 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE; |
| 34 virtual void OnFinRead() OVERRIDE; | 34 virtual void OnFinRead() OVERRIDE; |
| 35 | 35 |
| 36 int ParseRequestHeaders(); | 36 size_t ParseRequestHeaders(); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 friend class test::QuicSpdyServerStreamPeer; | 39 friend class test::QuicSpdyServerStreamPeer; |
| 40 | 40 |
| 41 // Sends a basic 200 response using SendHeaders for the headers and WriteData | 41 // Sends a basic 200 response using SendHeaders for the headers and WriteData |
| 42 // for the body. | 42 // for the body. |
| 43 void SendResponse(); | 43 void SendResponse(); |
| 44 | 44 |
| 45 // Sends a basic 500 response using SendHeaders for the headers and WriteData | 45 // Sends a basic 500 response using SendHeaders for the headers and WriteData |
| 46 // for the body | 46 // for the body |
| 47 void SendErrorResponse(); | 47 void SendErrorResponse(); |
| 48 | 48 |
| 49 void SendHeadersAndBody(const BalsaHeaders& response_headers, | 49 void SendHeadersAndBody(const BalsaHeaders& response_headers, |
| 50 base::StringPiece body); | 50 base::StringPiece body); |
| 51 | 51 |
| 52 BalsaHeaders headers_; | 52 BalsaHeaders headers_; |
| 53 string body_; | 53 string body_; |
| 54 | 54 |
| 55 // Buffer into which response header data is read. | 55 // Buffer into which response header data is read. |
| 56 scoped_refptr<GrowableIOBuffer> read_buf_; | 56 scoped_refptr<GrowableIOBuffer> read_buf_; |
| 57 bool request_headers_received_; | 57 bool request_headers_received_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(QuicSpdyServerStream); | 59 DISALLOW_COPY_AND_ASSIGN(QuicSpdyServerStream); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace net | 62 } // namespace net |
| 63 | 63 |
| 64 #endif // NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_ | 64 #endif // NET_QUIC_QUIC_SPDY_SERVER_STREAM_H_ |
| OLD | NEW |