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

Unified Diff: third_party/WebKit/Source/platform/image-encoders/PNGImageEncoder.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/image-encoders/PNGImageEncoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-encoders/PNGImageEncoder.cpp b/third_party/WebKit/Source/platform/image-encoders/PNGImageEncoder.cpp
index cfaae3f159f23f773b9a2b2a62cf7b69dbd47bc1..77ccf5e09a69faa97587a03c198bfdd466130016 100644
--- a/third_party/WebKit/Source/platform/image-encoders/PNGImageEncoder.cpp
+++ b/third_party/WebKit/Source/platform/image-encoders/PNGImageEncoder.cpp
@@ -31,7 +31,8 @@
#include "platform/image-encoders/PNGImageEncoder.h"
#include "platform/graphics/ImageBuffer.h"
-#include "wtf/OwnPtr.h"
+#include "wtf/PtrUtil.h"
+#include <memory>
namespace blink {
@@ -45,7 +46,7 @@ static void writeOutput(png_structp png, png_bytep data, png_size_t size)
static_cast<Vector<unsigned char>*>(png_get_io_ptr(png))->append(data, size);
}
-PassOwnPtr<PNGImageEncoderState> PNGImageEncoderState::create(const IntSize& imageSize, Vector<unsigned char>* output)
+std::unique_ptr<PNGImageEncoderState> PNGImageEncoderState::create(const IntSize& imageSize, Vector<unsigned char>* output)
{
if (imageSize.width() <= 0 || imageSize.height() <= 0)
return nullptr;
@@ -73,7 +74,7 @@ PassOwnPtr<PNGImageEncoderState> PNGImageEncoderState::create(const IntSize& ima
png_set_IHDR(png, info, imageSize.width(), imageSize.height(), 8, PNG_COLOR_TYPE_RGB_ALPHA, 0, 0, 0);
png_write_info(png, info);
- return adoptPtr(new PNGImageEncoderState(png, info));
+ return wrapUnique(new PNGImageEncoderState(png, info));
}
void PNGImageEncoder::writeOneRowToPng(unsigned char* pixels, PNGImageEncoderState* encoderState)
@@ -88,7 +89,7 @@ void PNGImageEncoder::finalizePng(PNGImageEncoderState* encoderState)
static bool encodePixels(const IntSize& imageSize, const unsigned char* inputPixels, Vector<unsigned char>* output)
{
- OwnPtr<PNGImageEncoderState> encoderState = PNGImageEncoderState::create(imageSize, output);
+ std::unique_ptr<PNGImageEncoderState> encoderState = PNGImageEncoderState::create(imageSize, output);
if (!encoderState.get())
return false;

Powered by Google App Engine
This is Rietveld 408576698