rtc::Buffer: Remove backwards compatibility band-aids
This CL makes two changes to rtc::Buffer that have had to wait for
Chromium's use of it to be modernized:
1. Change default return type of rtc::Buffer::data() from char* to
uint8_t*. uint8_t is a more natural type for bytes, and won't
accidentally convert to a string. (Chromium previously expected
the default return type to be char, which is why
rtc::Buffer::data() initially got char as default return type in
9478437f, but that's been fixed now.)
2. Stop accepting void* inputs in constructors and methods. While
this is convenient, it's also dangerous since any pointer type
will implicitly convert to void*.
(This was previously committed (9e1a6d7c) but had to be reverted
(cbf09274) because Chromium on Android wasn't quite ready for it).
TBR=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/47109004
Cr-Commit-Position: refs/heads/master@{#9132}
This commit is contained in:
@ -82,7 +82,7 @@ class LoopbackTransportTest : public webrtc::Transport {
|
||||
packets_sent_++;
|
||||
rtc::Buffer* buffer =
|
||||
new rtc::Buffer(reinterpret_cast<const uint8_t*>(data), len);
|
||||
last_sent_packet_ = buffer->data<uint8_t>();
|
||||
last_sent_packet_ = buffer->data();
|
||||
last_sent_packet_len_ = len;
|
||||
total_bytes_sent_ += len;
|
||||
sent_packets_.push_back(buffer);
|
||||
|
||||
Reference in New Issue
Block a user