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

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.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/DeferredImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
index 60d65443bb9078e6621f8440674f7661dacdf33c..09fa4400069119180fdd326d951d68de6c51edd4 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -33,8 +33,7 @@
#include "platform/graphics/skia/SkiaUtils.h"
#include "platform/image-decoders/SegmentReader.h"
#include "third_party/skia/include/core/SkImage.h"
-#include "wtf/PtrUtil.h"
-#include <memory>
+#include "wtf/PassOwnPtr.h"
namespace blink {
@@ -57,22 +56,22 @@ public:
uint32_t m_uniqueID;
};
-std::unique_ptr<DeferredImageDecoder> DeferredImageDecoder::create(const SharedBuffer& data, ImageDecoder::AlphaOption alphaOption, ImageDecoder::GammaAndColorProfileOption colorOptions)
+PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::create(const SharedBuffer& data, ImageDecoder::AlphaOption alphaOption, ImageDecoder::GammaAndColorProfileOption colorOptions)
{
- std::unique_ptr<ImageDecoder> actualDecoder = ImageDecoder::create(data, alphaOption, colorOptions);
+ OwnPtr<ImageDecoder> actualDecoder = ImageDecoder::create(data, alphaOption, colorOptions);
if (!actualDecoder)
return nullptr;
- return wrapUnique(new DeferredImageDecoder(std::move(actualDecoder)));
+ return adoptPtr(new DeferredImageDecoder(std::move(actualDecoder)));
}
-std::unique_ptr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(std::unique_ptr<ImageDecoder> actualDecoder)
+PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(PassOwnPtr<ImageDecoder> actualDecoder)
{
- return wrapUnique(new DeferredImageDecoder(std::move(actualDecoder)));
+ return adoptPtr(new DeferredImageDecoder(std::move(actualDecoder)));
}
-DeferredImageDecoder::DeferredImageDecoder(std::unique_ptr<ImageDecoder> actualDecoder)
+DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder)
: m_allDataReceived(false)
, m_actualDecoder(std::move(actualDecoder))
, m_repetitionCount(cAnimationNone)
@@ -130,7 +129,7 @@ void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived)
if (m_frameGenerator) {
if (!m_rwBuffer)
- m_rwBuffer = wrapUnique(new SkRWBuffer(data.size()));
+ m_rwBuffer = adoptPtr(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