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

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.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/DeferredImageDecoderTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
index c0a04cccfa3091c7206b08cfc580b807309aa87f..09d3da1df0e6e61b539272d302ff442864f4e248 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
@@ -42,9 +42,7 @@
#include "third_party/skia/include/core/SkPixmap.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "wtf/PassRefPtr.h"
-#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
-#include <memory>
namespace blink {
@@ -101,7 +99,7 @@ public:
ImageDecodingStore::instance().setCacheLimitInBytes(1024 * 1024);
m_data = SharedBuffer::create(whitePNG, sizeof(whitePNG));
m_frameCount = 1;
- std::unique_ptr<MockImageDecoder> decoder = MockImageDecoder::create(this);
+ OwnPtr<MockImageDecoder> decoder = MockImageDecoder::create(this);
m_actualDecoder = decoder.get();
m_actualDecoder->setSize(1, 1);
m_lazyDecoder = DeferredImageDecoder::createForTesting(std::move(decoder));
@@ -162,7 +160,7 @@ protected:
// Don't own this but saves the pointer to query states.
MockImageDecoder* m_actualDecoder;
- std::unique_ptr<DeferredImageDecoder> m_lazyDecoder;
+ OwnPtr<DeferredImageDecoder> m_lazyDecoder;
sk_sp<SkSurface> m_surface;
int m_decodeRequestCount;
RefPtr<SharedBuffer> m_data;
@@ -245,7 +243,7 @@ TEST_F(DeferredImageDecoderTest, decodeOnOtherThread)
EXPECT_EQ(0, m_decodeRequestCount);
// Create a thread to rasterize SkPicture.
- std::unique_ptr<WebThread> thread = wrapUnique(Platform::current()->createThread("RasterThread"));
+ OwnPtr<WebThread> thread = adoptPtr(Platform::current()->createThread("RasterThread"));
thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&rasterizeMain, AllowCrossThreadAccess(m_surface->getCanvas()), AllowCrossThreadAccess(picture.get())));
thread.reset();
EXPECT_EQ(0, m_decodeRequestCount);
@@ -360,9 +358,9 @@ TEST_F(DeferredImageDecoderTest, smallerFrameCount)
TEST_F(DeferredImageDecoderTest, frameOpacity)
{
- std::unique_ptr<ImageDecoder> actualDecoder = ImageDecoder::create(*m_data,
+ OwnPtr<ImageDecoder> actualDecoder = ImageDecoder::create(*m_data,
ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileApplied);
- std::unique_ptr<DeferredImageDecoder> decoder = DeferredImageDecoder::createForTesting(std::move(actualDecoder));
+ OwnPtr<DeferredImageDecoder> decoder = DeferredImageDecoder::createForTesting(std::move(actualDecoder));
decoder->setData(*m_data, true);
SkImageInfo pixInfo = SkImageInfo::MakeN32Premul(1, 1);

Powered by Google App Engine
This is Rietveld 408576698