| 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..4985aad60e7ed71d58855d047ded6cdf197355c4
|
| --- /dev/null
|
| +++ b/net/quic/quartc/quartc_reliable_stream_interface.h
|
| @@ -0,0 +1,44 @@
|
| +// Copyright (c) 2016 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,
|
| + 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
|
| + // 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;
|
| +};
|
| +}
|
| +
|
| +#endif // NET_QUIC_QUARTC_QUARTC_RELIABLE_STREAM_INTERFACE_H_
|
|
|