Index: net/quic/quartc/quartc_reliable_stream_interface.h |
diff --git a/net/quic/quartc/quartc_reliable_stream_interface.h b/net/quic/quartc/quartc_reliable_stream_interface.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6851c48e75b8ee982188e8b5dd580c9ebd43738f |
--- /dev/null |
+++ b/net/quic/quartc/quartc_reliable_stream_interface.h |
@@ -0,0 +1,44 @@ |
+// Copyright (c) 2012 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. |
+ |
+#ifndef NET_QUIC_QUARTC_QUARTC_RELIABLE_STREAM_INTERFACE_H_ |
+#define NET_QUIC_QUARTC_QUARTC_RELIABLE_STREAM_INTERFACE_H_ |
+ |
+namespace net { |
+class QuartcReliableStreamInterface { |
+ public: |
+ virtual uint32_t stream_id() = 0; |
+ virtual uint64_t buffered_amount() = 0; |
+ |
+ // For forward-compatibility |
+ struct WriteParameters { |
+ bool fin = false; |
+ }; |
+ virtual void Write(const char* data, |
honghaiz
2016/09/22 18:57:00
Can you add comments for each of the method except
zhihuang1
2016/09/22 19:24:40
Done.
|
+ size_t size, |
+ const WriteParameters& param) = 0; |
+ virtual void Close() = 0; |
+ |
+ // Implemented on the WebRTC side. |
+ class Observer { |
+ public: |
+ // Called when the data are ready. |
+ virtual void OnReceived(QuartcReliableStreamInterface* stream, |
+ const char* data, |
+ size_t size) = 0; |
+ |
+ // TODO(zhihuang) Create a map from the integer error_code to WebRTC native |
honghaiz
2016/09/22 18:57:00
Use singular verbs for method comments ("Creates"
zhihuang1
2016/09/22 19:24:40
Done.
|
+ // error code. |
+ virtual void OnClose(QuartcReliableStreamInterface* stream, |
+ int error_code) = 0; |
+ |
+ // Called when the buffered data has been sent. |
+ virtual void OnBufferedAmountChanged( |
+ QuartcReliableStreamInterface* stream) = 0; |
+ }; |
+ virtual void SetObserver(Observer*) = 0; |
+}; |
+} |
honghaiz
2016/09/22 18:57:01
comment on the namespace.
zhihuang1
2016/09/22 19:24:40
Done.
|
+ |
+#endif // NET_QUIC_QUARTC_QUARTC_RELIABLE_STREAM_INTERFACE_H_ |