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

Unified Diff: webrtc/api/sctputils.cc

Issue 1821083002: Split ByteBuffer into writer/reader objects. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | webrtc/base/bitbuffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/sctputils.cc
diff --git a/webrtc/api/sctputils.cc b/webrtc/api/sctputils.cc
index f2d1b0f54af921d79f6bebbef238efde76a2684b..d6ea601fc37b7b19d6df963811d6c64dfec07627 100644
--- a/webrtc/api/sctputils.cc
+++ b/webrtc/api/sctputils.cc
@@ -49,9 +49,7 @@ bool ParseDataChannelOpenMessage(const rtc::CopyOnWriteBuffer& payload,
// Format defined at
// http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-04
- // TODO(jbauch): avoid copying the payload data into the ByteBuffer, see
- // https://bugs.chromium.org/p/webrtc/issues/detail?id=5670
- rtc::ByteBuffer buffer(payload.data<char>(), payload.size());
+ rtc::ByteBufferReader buffer(payload.data<char>(), payload.size());
uint8_t message_type;
if (!buffer.ReadUInt8(&message_type)) {
LOG(LS_WARNING) << "Could not read OPEN message type.";
@@ -166,7 +164,7 @@ bool WriteDataChannelOpenMessage(const std::string& label,
}
}
- rtc::ByteBuffer buffer(
+ rtc::ByteBufferWriter buffer(
NULL, 20 + label.length() + config.protocol.length(),
rtc::ByteBuffer::ORDER_NETWORK);
// TODO(tommi): Add error handling and check resulting length.
« no previous file with comments | « no previous file | webrtc/base/bitbuffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698