Chromium Code Reviews| Index: media/blink/multibuffer.h |
| diff --git a/media/blink/multibuffer.h b/media/blink/multibuffer.h |
| index d469d43fc146f5c6c323bb371bfc4ecdbd4853e6..e3e7fd0d1ff989e10340019da2904d95e0a9447c 100644 |
| --- a/media/blink/multibuffer.h |
| +++ b/media/blink/multibuffer.h |
| @@ -119,9 +119,6 @@ class MEDIA_BLINK_EXPORT MultiBuffer { |
| // DataBuffer. |
| virtual scoped_refptr<DataBuffer> Read() = 0; |
| - // |cb| is called every time Available() becomes true. |
| - virtual void SetAvailableCallback(const base::Closure& cb) = 0; |
| - |
| // Ask the data provider to stop giving us data. |
| // It's ok if the effect is not immediate. |
| virtual void SetDeferred(bool deferred) = 0; |
| @@ -229,8 +226,8 @@ class MEDIA_BLINK_EXPORT MultiBuffer { |
| // not call it anymore. |
| scoped_ptr<DataProvider> RemoveProvider(DataProvider* provider); |
| - // Add a writer to this cache. Cache takes ownership and |
| - // may choose to destroy it. |
| + // Add a writer to this cache. Cache takes ownership, and may |
| + // destroy |provider| later. (Not during this call.) |
| void AddProvider(scoped_ptr<DataProvider> provider); |
| // Transfer all data from |other| to this. |
| @@ -240,12 +237,18 @@ class MEDIA_BLINK_EXPORT MultiBuffer { |
| const DataMap& map() const { return data_; } |
| int32_t block_size_shift() const { return block_size_shift_; } |
| + // Callback which notifies us that a data provider has |
| + // some data for us. Also called when it might be apprperiate |
| + // for a provider in a deferred state to wake up. |
| + void DataProviderEvent(DataProvider* provider); |
|
xhwang
2015/11/19 23:34:17
In media/ callbacks are often called OnXxx, not su
hubbe
2015/11/20 23:24:23
OnDataProviderEvent() seems ok, can't think of som
|
| + |
| protected: |
| // Create a new writer at |pos| and return it. |
| // Users needs to implemement this method. |
| virtual DataProvider* CreateWriter(const BlockId& pos) = 0; |
|
xhwang
2015/11/19 23:34:17
Who owns the created Writer? If the caller owns it
hubbe
2015/11/20 23:24:22
Done.
|
| virtual bool RangeSupported() const = 0; |
| + virtual void OnEmpty(); |
| private: |
| // For testing. |
| @@ -276,11 +279,6 @@ class MEDIA_BLINK_EXPORT MultiBuffer { |
| void NotifyAvailableRange(const Interval<MultiBufferBlockId>& observer_range, |
| const Interval<MultiBufferBlockId>& new_range); |
| - // Callback which notifies us that a data provider has |
| - // some data for us. Also called when it might be apprperiate |
| - // for a provider in a deferred state to wake up. |
| - void DataProviderEvent(DataProvider* provider); |
| - |
| // Max number of blocks. |
| int64_t max_size_; |