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

Unified Diff: net/quic/quic_message_stream.h

Issue 474383003: Initial P2P implementation for WebRTC on QUIC prototype Base URL: https://chromium.googlesource.com/chromium/src.git@tests-squashed
Patch Set: Created 6 years, 4 months 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/net.gypi ('k') | net/quic/quic_message_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_message_stream.h
diff --git a/net/quic/quic_message_stream.h b/net/quic/quic_message_stream.h
new file mode 100644
index 0000000000000000000000000000000000000000..ee63b9b8e94dbfc77bdeea61d228ebc4dc5b3594
--- /dev/null
+++ b/net/quic/quic_message_stream.h
@@ -0,0 +1,49 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// The base class for streams which deliver data to/from an application.
+// In each direction, the data on such a stream first contains compressed
+// headers then body data.
+
+#ifndef NET_QUIC_QUIC_MESSAGE_STREAM_H_
+#define NET_QUIC_QUIC_MESSAGE_STREAM_H_
+
+#include "net/quic/quic_data_stream.h"
+
+namespace net {
+
+// TODO(dmz) This should actually be a ReliableQuicStream
+class NET_EXPORT_PRIVATE QuicMessageStream : public QuicDataStream {
+ public:
+ // Implement this to listen for reads
+ class ReadDelegate {
+ public:
+ virtual ~ReadDelegate() {}
+
+ virtual void OnStreamRead(QuicStreamId id,
+ const char* data,
+ uint32 data_len) = 0;
+ virtual void OnStreamClose(QuicStreamId) = 0;
+ };
+
+ QuicMessageStream(QuicStreamId id,
+ QuicSession* session,
+ ReadDelegate* delegate);
+
+ virtual ~QuicMessageStream();
+
+ int WriteStreamData(base::StringPiece data, bool fin);
+
+ virtual void OnClose() OVERRIDE;
+ virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE;
+
+ private:
+ ReadDelegate* delegate_; // Not owned
+
+ DISALLOW_COPY_AND_ASSIGN(QuicMessageStream);
+};
+
+} // namespace net
+
+#endif // NET_QUIC_QUIC_MESSAGE_STREAM_H_
« no previous file with comments | « net/net.gypi ('k') | net/quic/quic_message_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698