diff options
author | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 00:13:21 +0000 |
---|---|---|
committer | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 00:13:21 +0000 |
commit | da437a560297855295adb2c30e49c05d20ee95ab (patch) | |
tree | 085e28aea8cea82902f489f82238e91a391f50fb /media/base/buffers.h | |
parent | f0109a7d5f18d3fdfb0daf76fd6f9f7270ba85cc (diff) | |
download | chromium_src-da437a560297855295adb2c30e49c05d20ee95ab.zip chromium_src-da437a560297855295adb2c30e49c05d20ee95ab.tar.gz chromium_src-da437a560297855295adb2c30e49c05d20ee95ab.tar.bz2 |
Refactor WritableBuffer interface for more useful ptr management.
BUG=16011
TEST=DataBuffer unittest
Review URL: http://codereview.chromium.org/149573
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/buffers.h')
-rw-r--r-- | media/base/buffers.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/media/base/buffers.h b/media/base/buffers.h index def573e..2b4f25b 100644 --- a/media/base/buffers.h +++ b/media/base/buffers.h @@ -102,18 +102,15 @@ class Buffer : public StreamSample { class WritableBuffer : public Buffer { public: - // Returns a read-write pointer to the buffer data. When this method is - // called, any pointers previously returned from this method are invalid, and - // any data previously written to the buffer is invalid. The buffer size - // is guaranteed to be at least the size of |buffer_size|. The size - // that the GetDataSize() method will return is set to |buffer_size|. - // If, after filling the buffer, the caller wants to set the size to a smaller - // value then they can call the SetDataSize() method. - virtual uint8* GetWritableData(size_t buffer_size) = 0; + // Returns a read-write pointer to the buffer data. + virtual uint8* GetWritableData() = 0; // Updates the size of valid data in bytes, which must be less than or equal - // to the |buffer_size| passed to GetWritableData(). + // to GetBufferSize(). virtual void SetDataSize(size_t data_size) = 0; + + // Returns the size of the underlying buffer. + virtual size_t GetBufferSize() const = 0; }; |