| 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_SIMPLE_SERVER_STREAM_H_ | 5 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ |
| 6 #define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ | 6 #define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual void SendResponse(); | 57 virtual void SendResponse(); |
| 58 | 58 |
| 59 // Sends a basic 500 response using SendHeaders for the headers and WriteData | 59 // Sends a basic 500 response using SendHeaders for the headers and WriteData |
| 60 // for the body. | 60 // for the body. |
| 61 virtual void SendErrorResponse(); | 61 virtual void SendErrorResponse(); |
| 62 | 62 |
| 63 // Sends a basic 404 response using SendHeaders for the headers and WriteData | 63 // Sends a basic 404 response using SendHeaders for the headers and WriteData |
| 64 // for the body. | 64 // for the body. |
| 65 void SendNotFoundResponse(); | 65 void SendNotFoundResponse(); |
| 66 | 66 |
| 67 void SendHeadersAndBody(const SpdyHeaderBlock& response_headers, | 67 void SendHeadersAndBody(SpdyHeaderBlock response_headers, |
| 68 base::StringPiece body); | 68 base::StringPiece body); |
| 69 void SendHeadersAndBodyAndTrailers(const SpdyHeaderBlock& response_headers, | 69 void SendHeadersAndBodyAndTrailers(SpdyHeaderBlock response_headers, |
| 70 base::StringPiece body, | 70 base::StringPiece body, |
| 71 const SpdyHeaderBlock& response_trailers); | 71 SpdyHeaderBlock response_trailers); |
| 72 | 72 |
| 73 SpdyHeaderBlock* request_headers() { return &request_headers_; } | 73 SpdyHeaderBlock* request_headers() { return &request_headers_; } |
| 74 | 74 |
| 75 const std::string& body() { return body_; } | 75 const std::string& body() { return body_; } |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 friend class test::QuicSimpleServerStreamPeer; | 78 friend class test::QuicSimpleServerStreamPeer; |
| 79 | 79 |
| 80 // The parsed headers received from the client. | 80 // The parsed headers received from the client. |
| 81 SpdyHeaderBlock request_headers_; | 81 SpdyHeaderBlock request_headers_; |
| 82 int64_t content_length_; | 82 int64_t content_length_; |
| 83 std::string body_; | 83 std::string body_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServerStream); | 85 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServerStream); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace net | 88 } // namespace net |
| 89 | 89 |
| 90 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ | 90 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_ |
| OLD | NEW |