Index: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp |
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp |
index 6295e54a5ffc2f5807ed765f31a1eba4f5fb118c..4de383f72f2bde3bb713fc54b07ba97d30421b69 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp |
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp |
@@ -36,9 +36,9 @@ |
#include "public/platform/WebData.h" |
#include "public/platform/WebSize.h" |
#include "testing/gtest/include/gtest/gtest.h" |
-#include "wtf/PtrUtil.h" |
+#include "wtf/OwnPtr.h" |
+#include "wtf/PassOwnPtr.h" |
#include "wtf/typed_arrays/ArrayBuffer.h" |
-#include <memory> |
namespace blink { |
@@ -46,12 +46,12 @@ static const size_t LargeEnoughSize = 1000 * 1000; |
namespace { |
-std::unique_ptr<ImageDecoder> createDecoder(size_t maxDecodedBytes) |
+PassOwnPtr<ImageDecoder> createDecoder(size_t maxDecodedBytes) |
{ |
- return wrapUnique(new JPEGImageDecoder(ImageDecoder::AlphaNotPremultiplied, ImageDecoder::GammaAndColorProfileApplied, maxDecodedBytes)); |
+ return adoptPtr(new JPEGImageDecoder(ImageDecoder::AlphaNotPremultiplied, ImageDecoder::GammaAndColorProfileApplied, maxDecodedBytes)); |
} |
-std::unique_ptr<ImageDecoder> createDecoder() |
+PassOwnPtr<ImageDecoder> createDecoder() |
{ |
return createDecoder(ImageDecoder::noDecodedImageByteLimit); |
} |
@@ -63,7 +63,7 @@ void downsample(size_t maxDecodedBytes, unsigned* outputWidth, unsigned* outputH |
RefPtr<SharedBuffer> data = readFile(imageFilePath); |
ASSERT_TRUE(data); |
- std::unique_ptr<ImageDecoder> decoder = createDecoder(maxDecodedBytes); |
+ OwnPtr<ImageDecoder> decoder = createDecoder(maxDecodedBytes); |
decoder->setData(data.get(), true); |
ImageFrame* frame = decoder->frameBufferAtIndex(0); |
@@ -78,11 +78,11 @@ void readYUV(size_t maxDecodedBytes, unsigned* outputYWidth, unsigned* outputYHe |
RefPtr<SharedBuffer> data = readFile(imageFilePath); |
ASSERT_TRUE(data); |
- std::unique_ptr<ImageDecoder> decoder = createDecoder(maxDecodedBytes); |
+ OwnPtr<ImageDecoder> decoder = createDecoder(maxDecodedBytes); |
decoder->setData(data.get(), true); |
// Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding. |
- std::unique_ptr<ImagePlanes> dummyImagePlanes = wrapUnique(new ImagePlanes()); |
+ OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes()); |
decoder->setImagePlanes(std::move(dummyImagePlanes)); |
bool sizeIsAvailable = decoder->isSizeAvailable(); |
@@ -114,7 +114,7 @@ void readYUV(size_t maxDecodedBytes, unsigned* outputYWidth, unsigned* outputYHe |
planes[1] = ((char*) planes[0]) + rowBytes[0] * ySize.height(); |
planes[2] = ((char*) planes[1]) + rowBytes[1] * uSize.height(); |
- std::unique_ptr<ImagePlanes> imagePlanes = wrapUnique(new ImagePlanes(planes, rowBytes)); |
+ OwnPtr<ImagePlanes> imagePlanes = adoptPtr(new ImagePlanes(planes, rowBytes)); |
decoder->setImagePlanes(std::move(imagePlanes)); |
ASSERT_TRUE(decoder->decodeToYUV()); |
@@ -123,7 +123,7 @@ void readYUV(size_t maxDecodedBytes, unsigned* outputYWidth, unsigned* outputYHe |
// Tests failure on a too big image. |
TEST(JPEGImageDecoderTest, tooBig) |
{ |
- std::unique_ptr<ImageDecoder> decoder = createDecoder(100); |
+ OwnPtr<ImageDecoder> decoder = createDecoder(100); |
EXPECT_FALSE(decoder->setSize(10000, 10000)); |
EXPECT_TRUE(decoder->failed()); |
} |
@@ -247,10 +247,10 @@ TEST(JPEGImageDecoderTest, yuv) |
RefPtr<SharedBuffer> data = readFile(jpegFile); |
ASSERT_TRUE(data); |
- std::unique_ptr<ImageDecoder> decoder = createDecoder(230 * 230 * 4); |
+ OwnPtr<ImageDecoder> decoder = createDecoder(230 * 230 * 4); |
decoder->setData(data.get(), true); |
- std::unique_ptr<ImagePlanes> imagePlanes = wrapUnique(new ImagePlanes()); |
+ OwnPtr<ImagePlanes> imagePlanes = adoptPtr(new ImagePlanes()); |
decoder->setImagePlanes(std::move(imagePlanes)); |
ASSERT_TRUE(decoder->isSizeAvailable()); |
ASSERT_FALSE(decoder->canDecodeToYUV()); |