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

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h

Issue 2257513002: Refactor ImageDecoder factories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 years, 4 months 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: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
index 34ffa5ac0a5142b65f95acd82492a48a7be13593..b2a8aea67fdf6a47341216ff4fea11297ee2bc45 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
@@ -47,7 +47,8 @@ class PLATFORM_EXPORT DeferredImageDecoder final {
WTF_MAKE_NONCOPYABLE(DeferredImageDecoder);
USING_FAST_MALLOC(DeferredImageDecoder);
public:
- static std::unique_ptr<DeferredImageDecoder> create(ImageDecoder::SniffResult, ImageDecoder::AlphaOption, ImageDecoder::GammaAndColorProfileOption);
+ static std::unique_ptr<DeferredImageDecoder> create(PassRefPtr<SharedBuffer> data, bool dataComplete,
+ ImageDecoder::AlphaOption, ImageDecoder::GammaAndColorProfileOption);
static std::unique_ptr<DeferredImageDecoder> createForTesting(std::unique_ptr<ImageDecoder>);
@@ -58,7 +59,7 @@ public:
PassRefPtr<SkImage> createFrameAtIndex(size_t);
PassRefPtr<SharedBuffer> data();
- void setData(SharedBuffer& data, bool allDataReceived);
+ void setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
bool isSizeAvailable();
bool hasColorProfile() const;
@@ -85,6 +86,8 @@ private:
PassRefPtr<SkImage> createFrameImageAtIndex(size_t index, bool knownToBeOpaque);
+ void setDataInternal(PassRefPtr<SharedBuffer> data, bool allDataReceived, bool pushDataToDecoder);
+
// Copy of the data that is passed in, used by deferred decoding.
// Allows creating readonly snapshots that may be read in another thread.
std::unique_ptr<SkRWBuffer> m_rwBuffer;

Powered by Google App Engine
This is Rietveld 408576698