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. |