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

Side by Side Diff: webrtc/api/datachannelinterface.h

Issue 2414613003: DataChannelInterface default impl of [messages/bytes]_[sent/received]. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // implemented these APIs. They should all just return the values the 118 // implemented these APIs. They should all just return the values the
119 // DataChannel was created with. 119 // DataChannel was created with.
120 virtual bool ordered() const { return false; } 120 virtual bool ordered() const { return false; }
121 virtual uint16_t maxRetransmitTime() const { return 0; } 121 virtual uint16_t maxRetransmitTime() const { return 0; }
122 virtual uint16_t maxRetransmits() const { return 0; } 122 virtual uint16_t maxRetransmits() const { return 0; }
123 virtual std::string protocol() const { return std::string(); } 123 virtual std::string protocol() const { return std::string(); }
124 virtual bool negotiated() const { return false; } 124 virtual bool negotiated() const { return false; }
125 125
126 virtual int id() const = 0; 126 virtual int id() const = 0;
127 virtual DataState state() const = 0; 127 virtual DataState state() const = 0;
128 virtual uint32_t messages_sent() const = 0; 128 // TODO(hbos): Default implementations of [messages/bytes]_[sent/received] as
129 virtual uint64_t bytes_sent() const = 0; 129 // to not break Chromium. Fix Chromium's implementation as soon as this rolls.
130 virtual uint32_t messages_received() const = 0; 130 // crbug.com/654927
131 virtual uint64_t bytes_received() const = 0; 131 virtual uint32_t messages_sent() const { return 0; }
132 virtual uint64_t bytes_sent() const { return 0; }
133 virtual uint32_t messages_received() const { return 0; }
134 virtual uint64_t bytes_received() const { return 0; }
132 // The buffered_amount returns the number of bytes of application data 135 // The buffered_amount returns the number of bytes of application data
133 // (UTF-8 text and binary data) that have been queued using SendBuffer but 136 // (UTF-8 text and binary data) that have been queued using SendBuffer but
134 // have not yet been transmitted to the network. 137 // have not yet been transmitted to the network.
135 virtual uint64_t buffered_amount() const = 0; 138 virtual uint64_t buffered_amount() const = 0;
136 virtual void Close() = 0; 139 virtual void Close() = 0;
137 // Sends |data| to the remote peer. 140 // Sends |data| to the remote peer.
138 virtual bool Send(const DataBuffer& buffer) = 0; 141 virtual bool Send(const DataBuffer& buffer) = 0;
139 142
140 protected: 143 protected:
141 virtual ~DataChannelInterface() {} 144 virtual ~DataChannelInterface() {}
142 }; 145 };
143 146
144 } // namespace webrtc 147 } // namespace webrtc
145 148
146 #endif // WEBRTC_API_DATACHANNELINTERFACE_H_ 149 #endif // WEBRTC_API_DATACHANNELINTERFACE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698