diff options
Diffstat (limited to 'media/base/data_buffer.h')
-rw-r--r-- | media/base/data_buffer.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/media/base/data_buffer.h b/media/base/data_buffer.h index 26ecb8a..36fbb85 100644 --- a/media/base/data_buffer.h +++ b/media/base/data_buffer.h @@ -1,9 +1,9 @@ -// Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// A simple implementation of WritableBuffer that takes ownership of -// the given data pointer. +// A simple implementation of Buffer that takes ownership of the given data +// pointer. // // DataBuffer assumes that memory was allocated with new uint8[]. @@ -15,7 +15,7 @@ namespace media { -class DataBuffer : public WritableBuffer { +class DataBuffer : public Buffer { public: // Takes ownership of the passed |buffer|, assumes valid data of size // |buffer_size|. @@ -29,9 +29,14 @@ class DataBuffer : public WritableBuffer { virtual const uint8* GetData() const; virtual size_t GetDataSize() const; - // WritableBuffer implementation. + // Returns a read-write pointer to the buffer data. virtual uint8* GetWritableData(); + + // Updates the size of valid data in bytes, which must be less than or equal + // to GetBufferSize(). virtual void SetDataSize(size_t data_size); + + // Returns the size of the underlying buffer. virtual size_t GetBufferSize() const; protected: @@ -41,6 +46,8 @@ class DataBuffer : public WritableBuffer { scoped_array<uint8> data_; size_t buffer_size_; size_t data_size_; + + DISALLOW_COPY_AND_ASSIGN(DataBuffer); }; } // namespace media |