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

Unified Diff: third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/ImageFrameGenerator.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
index cebc233f45f5b01518cb3024353dc6b7cfe270b2..faf1444149966d4a3ee2162dcf4274f1cad25473 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -30,8 +30,6 @@
#include "platform/graphics/ImageDecodingStore.h"
#include "platform/image-decoders/ImageDecoder.h"
#include "third_party/skia/include/core/SkYUVSizeInfo.h"
-#include "wtf/PtrUtil.h"
-#include <memory>
namespace blink {
@@ -160,13 +158,13 @@ bool ImageFrameGenerator::decodeToYUV(SegmentReader* data, size_t index, const S
return false;
}
- std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(*data, ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied);
+ OwnPtr<ImageDecoder> decoder = ImageDecoder::create(*data, ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied);
// getYUVComponentSizes was already called and was successful, so ImageDecoder::create must succeed.
ASSERT(decoder);
decoder->setData(data, true);
- std::unique_ptr<ImagePlanes> imagePlanes = wrapUnique(new ImagePlanes(planes, rowBytes));
+ OwnPtr<ImagePlanes> imagePlanes = adoptPtr(new ImagePlanes(planes, rowBytes));
decoder->setImagePlanes(std::move(imagePlanes));
ASSERT(decoder->canDecodeToYUV());
@@ -201,9 +199,9 @@ SkBitmap ImageFrameGenerator::tryToResumeDecode(SegmentReader* data, bool allDat
// If we are not resuming decoding that means the decoder is freshly
// created and we have ownership. If we are resuming decoding then
// the decoder is owned by ImageDecodingStore.
- std::unique_ptr<ImageDecoder> decoderContainer;
+ OwnPtr<ImageDecoder> decoderContainer;
if (!resumeDecoding)
- decoderContainer = wrapUnique(decoder);
+ decoderContainer = adoptPtr(decoder);
if (fullSizeImage.isNull()) {
// If decoding has failed, we can save work in the future by
@@ -264,10 +262,10 @@ bool ImageFrameGenerator::decode(SegmentReader* data, bool allDataReceived, size
if (!*decoder) {
newDecoder = true;
if (m_imageDecoderFactory)
- *decoder = m_imageDecoderFactory->create().release();
+ *decoder = m_imageDecoderFactory->create().leakPtr();
if (!*decoder)
- *decoder = ImageDecoder::create(*data, ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied).release();
+ *decoder = ImageDecoder::create(*data, ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied).leakPtr();
if (!*decoder)
return false;
@@ -327,13 +325,13 @@ bool ImageFrameGenerator::getYUVComponentSizes(SegmentReader* data, SkYUVSizeInf
if (m_yuvDecodingFailed)
return false;
- std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(*data, ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied);
+ OwnPtr<ImageDecoder> decoder = ImageDecoder::create(*data, ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied);
if (!decoder)
return false;
// Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding.
decoder->setData(data, true);
- std::unique_ptr<ImagePlanes> dummyImagePlanes = wrapUnique(new ImagePlanes);
+ OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes);
decoder->setImagePlanes(std::move(dummyImagePlanes));
return updateYUVComponentSizes(decoder.get(), sizeInfo->fSizes, sizeInfo->fWidthBytes);

Powered by Google App Engine
This is Rietveld 408576698