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

R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/44269004

Cr-Commit-Position: refs/heads/master@{#9121}
This commit is contained in:
Karl Wiberg
2015-04-30 14:25:03 +02:00
parent ff019b0b55
commit 9e1a6d7c23
4 changed files with 18 additions and 33 deletions

View File

@@ -512,7 +512,7 @@ bool BaseChannel::SendPacket(bool rtcp, rtc::Buffer* packet,
// Protect if needed.
if (srtp_filter_.IsActive()) {
bool res;
uint8_t* data = packet->data<uint8_t>();
uint8_t* data = packet->data();
int len = static_cast<int>(packet->size());
if (!rtcp) {
// If ENABLE_EXTERNAL_AUTH flag is on then packet authentication is not done