Index: net/tools/quic/quic_spdy_server_stream.h |
diff --git a/net/tools/quic/quic_spdy_server_stream.h b/net/tools/quic/quic_spdy_server_stream.h |
index b5f100bed4b19c9262164097c451da8115d9c62e..ad587cff5e2079f6ffe2eae49c496b9c5748f01f 100644 |
--- a/net/tools/quic/quic_spdy_server_stream.h |
+++ b/net/tools/quic/quic_spdy_server_stream.h |
@@ -8,7 +8,9 @@ |
#include <string> |
#include "net/base/io_buffer.h" |
-#include "net/tools/quic/quic_reliable_server_stream.h" |
+#include "net/quic/quic_protocol.h" |
+#include "net/quic/reliable_quic_stream.h" |
+#include "net/tools/balsa/balsa_headers.h" |
namespace net { |
@@ -16,9 +18,13 @@ class QuicSession; |
namespace tools { |
-// All this does right now is aggregate data, and on fin, send a cached |
+namespace test { |
+class QuicSpdyServerStreamPeer; |
+} // namespace test |
+ |
+// All this does right now is aggregate data, and on fin, send an HTTP |
// response. |
-class QuicSpdyServerStream : public QuicReliableServerStream { |
+class QuicSpdyServerStream : public ReliableQuicStream { |
public: |
QuicSpdyServerStream(QuicStreamId id, QuicSession* session); |
virtual ~QuicSpdyServerStream(); |
@@ -27,13 +33,33 @@ class QuicSpdyServerStream : public QuicReliableServerStream { |
// data for us. |
virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE; |
- virtual void SendHeaders(const BalsaHeaders& response_headers) OVERRIDE; |
+ virtual void SendHeaders(const BalsaHeaders& response_headers); |
int ParseRequestHeaders(); |
+ // Sends a basic 200 response using SendHeaders for the headers and WriteData |
+ // for the body. |
+ void SendResponse(); |
+ // Sends a basic 500 response using SendHeaders for the headers and WriteData |
+ // for the body |
+ void SendErrorResponse(); |
+ // Make sure that as soon as we start writing data, we stop reading. |
+ virtual QuicConsumedData WriteData(base::StringPiece data, bool fin) OVERRIDE; |
+ |
+ // Returns whatever headers have been received for this stream. |
+ const BalsaHeaders& headers() { return headers_; } |
+ |
+ const string& body() { return body_; } |
+ |
protected: |
virtual void OnFinRead() OVERRIDE; |
+ private: |
+ friend class test::QuicSpdyServerStreamPeer; |
+ |
+ BalsaHeaders headers_; |
+ string body_; |
+ |
// Buffer into which response header data is read. |
scoped_refptr<GrowableIOBuffer> read_buf_; |
bool request_headers_received_; |