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

Unified Diff: media/base/data_buffer.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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
Index: media/base/data_buffer.cc
diff --git a/media/base/data_buffer.cc b/media/base/data_buffer.cc
index 9d6afaf8d2f4e2ce7d964f2b2a47875683c39b1f..3879969b982bd8e1dafe5875ede8d35bc251dfbd 100644
--- a/media/base/data_buffer.cc
+++ b/media/base/data_buffer.cc
@@ -4,41 +4,37 @@
#include "media/base/data_buffer.h"
-
namespace media {
DataBuffer::DataBuffer(int buffer_size)
: buffer_size_(buffer_size),
data_size_(0) {
CHECK_GE(buffer_size, 0);
- data_.reset(new uint8[buffer_size_]);
+ data_.reset(new uint8_t[buffer_size_]);
}
-DataBuffer::DataBuffer(scoped_ptr<uint8[]> buffer, int buffer_size)
- : data_(buffer.Pass()),
- buffer_size_(buffer_size),
- data_size_(buffer_size) {
+DataBuffer::DataBuffer(scoped_ptr<uint8_t[]> buffer, int buffer_size)
+ : data_(buffer.Pass()), buffer_size_(buffer_size), data_size_(buffer_size) {
CHECK(data_.get());
CHECK_GE(buffer_size, 0);
}
-DataBuffer::DataBuffer(const uint8* data, int data_size)
- : buffer_size_(data_size),
- data_size_(data_size) {
+DataBuffer::DataBuffer(const uint8_t* data, int data_size)
+ : buffer_size_(data_size), data_size_(data_size) {
if (!data) {
CHECK_EQ(data_size, 0);
return;
}
CHECK_GE(data_size, 0);
- data_.reset(new uint8[buffer_size_]);
+ data_.reset(new uint8_t[buffer_size_]);
memcpy(data_.get(), data, data_size_);
}
DataBuffer::~DataBuffer() {}
// static
-scoped_refptr<DataBuffer> DataBuffer::CopyFrom(const uint8* data, int size) {
+scoped_refptr<DataBuffer> DataBuffer::CopyFrom(const uint8_t* data, int size) {
// If you hit this CHECK you likely have a bug in a demuxer. Go fix it.
CHECK(data);
return make_scoped_refptr(new DataBuffer(data, size));

Powered by Google App Engine
This is Rietveld 408576698