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

Unified Diff: net/quic/quartc/quartc_reliable_stream_interface.h

Issue 2324833004: Define Stable API for WebRTC/Quartc (Closed)
Patch Set: Create Quartc API Created 4 years, 3 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
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_

Powered by Google App Engine
This is Rietveld 408576698