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

Unified Diff: third_party/WebKit/Source/platform/testing/ImageDecodeBench.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/testing/ImageDecodeBench.cpp
diff --git a/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp b/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
index 83259b1d8b7146f0900268232dbc98af271cfa61..a14525d90dff87b031587cba0cfcbc5dad2ccc77 100644
--- a/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
+++ b/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
@@ -21,9 +21,8 @@
#include "platform/SharedBuffer.h"
#include "platform/image-decoders/ImageDecoder.h"
#include "public/platform/Platform.h"
+#include "wtf/OwnPtr.h"
#include "wtf/PassRefPtr.h"
-#include "wtf/PtrUtil.h"
-#include <memory>
#if defined(_WIN32)
#include <mmsystem.h>
@@ -247,7 +246,7 @@ PassRefPtr<SharedBuffer> readFile(const char* fileName)
if (s.st_size <= 0)
return SharedBuffer::create();
- std::unique_ptr<unsigned char[]> buffer = wrapArrayUnique(new unsigned char[fileSize]);
+ OwnPtr<unsigned char[]> buffer = adoptArrayPtr(new unsigned char[fileSize]);
if (fileSize != fread(buffer.get(), 1, fileSize, fp)) {
fprintf(stderr, "Error reading file %s\n", fileName);
exit(2);
@@ -259,7 +258,7 @@ PassRefPtr<SharedBuffer> readFile(const char* fileName)
bool decodeImageData(SharedBuffer* data, bool colorCorrection, size_t packetSize)
{
- std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(*data,
+ OwnPtr<ImageDecoder> decoder = ImageDecoder::create(*data,
ImageDecoder::AlphaPremultiplied, colorCorrection ?
ImageDecoder::GammaAndColorProfileApplied : ImageDecoder::GammaAndColorProfileIgnored);

Powered by Google App Engine
This is Rietveld 408576698