Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
| index 06664c71efcd8d4b562fa11ad75a1786e45a3593..4846a939b4a78bab70725b1f72c64496d49ef788 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
| +++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h |
| @@ -41,6 +41,8 @@ |
| #include "wtf/ThreadSafeRefCounted.h" |
| #include "wtf/Vector.h" |
| +class SkData; |
| + |
| namespace blink { |
| class ImageDecoder; |
| @@ -78,8 +80,9 @@ public: |
| void setData(PassRefPtr<SharedBuffer>, bool allDataReceived); |
| - // Creates a new SharedBuffer containing the data received so far. |
| - void copyData(RefPtr<SharedBuffer>*, bool* allDataReceived); |
| + // Return our encoded image data. Caller takes ownership and must unref the data |
| + // according to the contract SkImageGenerator::refEncodedData. |
| + SkData* refEncodedData() const; |
|
Noel Gordon
2015/12/04 12:40:30
Noticed one review question about this "Could this
aleksandar.stojiljkovic
2015/12/04 14:31:15
That is handled by
const void* SkData::data() cons
scroggo_chromium
2015/12/04 16:15:25
SkData also has writable_data() (https://code.goog
|
| SkISize getFullSize() const { return m_fullSize; } |
| @@ -107,7 +110,11 @@ private: |
| bool decode(size_t index, ImageDecoder**, SkBitmap*); |
| SkISize m_fullSize; |
| - ThreadSafeDataTransport m_data; |
| + |
| + // ThreadSafeDataTransport is referenced by ImageFrameGenerator and SkData |
| + // from refEncodedData. In case ImageFrameGenerator get's deleted, SkData |
| + // would hold the reference to it (and underlying data). |
| + RefPtr<ThreadSafeDataTransport> m_data; |
| bool m_isMultiFrame; |
| bool m_decodeFailedAndEmpty; |
| Vector<bool> m_hasAlpha; |