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

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

Issue 2918443003: Remove redundant reading and writing of data about SharedBuffer.
Patch Set: benchmark Created 3 years, 6 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 73eafe8a1b0ddf726c6e12971a7371f2d0a9a968..257e69a7c8153b2ccdc6fcf50c7d442bd03f6afc 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
@@ -28,10 +28,12 @@
#include <memory>
#include "platform/PlatformExport.h"
+#include "platform/SharedBuffer.h"
#include "platform/geometry/IntSize.h"
#include "platform/image-decoders/ImageDecoder.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Forward.h"
+#include "platform/wtf/RefPtr.h"
#include "platform/wtf/Vector.h"
#include "third_party/skia/include/core/SkRWBuffer.h"
#include "third_party/skia/include/core/SkRefCnt.h"
@@ -91,13 +93,13 @@ class PLATFORM_EXPORT DeferredImageDecoder final {
sk_sp<SkImage> CreateFrameImageAtIndex(size_t index, bool known_to_be_opaque);
- void SetDataInternal(RefPtr<SharedBuffer> data,
+ void SetDataInternal(PassRefPtr<SharedBuffer> data,
bool all_data_received,
bool push_data_to_decoder);
// 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> rw_buffer_;
+ RefPtr<SharedBuffer> buffer_;
std::unique_ptr<ImageDecoder> actual_decoder_;
String filename_extension_;

Powered by Google App Engine
This is Rietveld 408576698