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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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/DeferredImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
index 09fa4400069119180fdd326d951d68de6c51edd4..60d65443bb9078e6621f8440674f7661dacdf33c 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -33,7 +33,8 @@
#include "platform/graphics/skia/SkiaUtils.h"
#include "platform/image-decoders/SegmentReader.h"
#include "third_party/skia/include/core/SkImage.h"
-#include "wtf/PassOwnPtr.h"
+#include "wtf/PtrUtil.h"
+#include <memory>
namespace blink {
@@ -56,22 +57,22 @@ public:
uint32_t m_uniqueID;
};
-PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::create(const SharedBuffer& data, ImageDecoder::AlphaOption alphaOption, ImageDecoder::GammaAndColorProfileOption colorOptions)
+std::unique_ptr<DeferredImageDecoder> DeferredImageDecoder::create(const SharedBuffer& data, ImageDecoder::AlphaOption alphaOption, ImageDecoder::GammaAndColorProfileOption colorOptions)
{
- OwnPtr<ImageDecoder> actualDecoder = ImageDecoder::create(data, alphaOption, colorOptions);
+ std::unique_ptr<ImageDecoder> actualDecoder = ImageDecoder::create(data, alphaOption, colorOptions);
if (!actualDecoder)
return nullptr;
- return adoptPtr(new DeferredImageDecoder(std::move(actualDecoder)));
+ return wrapUnique(new DeferredImageDecoder(std::move(actualDecoder)));
}
-PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(PassOwnPtr<ImageDecoder> actualDecoder)
+std::unique_ptr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(std::unique_ptr<ImageDecoder> actualDecoder)
{
- return adoptPtr(new DeferredImageDecoder(std::move(actualDecoder)));
+ return wrapUnique(new DeferredImageDecoder(std::move(actualDecoder)));
}
-DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder)
+DeferredImageDecoder::DeferredImageDecoder(std::unique_ptr<ImageDecoder> actualDecoder)
: m_allDataReceived(false)
, m_actualDecoder(std::move(actualDecoder))
, m_repetitionCount(cAnimationNone)
@@ -129,7 +130,7 @@ void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived)
if (m_frameGenerator) {
if (!m_rwBuffer)
- m_rwBuffer = adoptPtr(new SkRWBuffer(data.size()));
+ m_rwBuffer = wrapUnique(new SkRWBuffer(data.size()));
const char* segment = 0;
for (size_t length = data.getSomeData(segment, m_rwBuffer->size());

Powered by Google App Engine
This is Rietveld 408576698