Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: net/tools/quic/quic_spdy_server_stream.h

Issue 111073003: Cleanup of QUIC stream classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream_test.cc ('k') | net/tools/quic/quic_spdy_server_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream_test.cc ('k') | net/tools/quic/quic_spdy_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698