rtc::Buffer: Rename length to size, for conformance with the STL

And add a constructor for creating an uninitialized Buffer of a
specified size.

(I intend to follow up with more Buffer changes, but since it's rather
widely used, the rename is quite noisy and works better as a separate
CL.)

R=tommi@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8841}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8841 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kwiberg@webrtc.org
2015-03-24 09:19:06 +00:00
parent e815290828
commit eebcab5ce9
33 changed files with 168 additions and 188 deletions

View File

@@ -143,8 +143,8 @@ class RtpDataMediaChannelTest : public testing::Test {
// Assume RTP header of length 12
rtc::scoped_ptr<const rtc::Buffer> packet(
iface_->GetRtpPacket(index));
if (packet->length() > 12) {
return std::string(packet->data() + 12, packet->length() - 12);
if (packet->size() > 12) {
return std::string(packet->data() + 12, packet->size() - 12);
} else {
return "";
}
@@ -154,7 +154,7 @@ class RtpDataMediaChannelTest : public testing::Test {
rtc::scoped_ptr<const rtc::Buffer> packet(
iface_->GetRtpPacket(index));
cricket::RtpHeader header;
GetRtpHeader(packet->data(), packet->length(), &header);
GetRtpHeader(packet->data(), packet->size(), &header);
return header;
}