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

Unified Diff: third_party/WebKit/Source/platform/graphics/PictureSnapshot.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/PictureSnapshot.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
index 8cc9f53a6929b0de30319d55d54a03e4150d3c39..5bc8eb1c111c1fab0bf9fd899111083c5cfe1fa4 100644
--- a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
+++ b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
@@ -46,10 +46,8 @@
#include "third_party/skia/include/core/SkStream.h"
#include "wtf/CurrentTime.h"
#include "wtf/HexNumber.h"
-#include "wtf/PtrUtil.h"
#include "wtf/text/Base64.h"
#include "wtf/text/TextEncoding.h"
-#include <memory>
namespace blink {
@@ -60,7 +58,7 @@ PictureSnapshot::PictureSnapshot(PassRefPtr<const SkPicture> picture)
static bool decodeBitmap(const void* data, size_t length, SkBitmap* result)
{
- std::unique_ptr<ImageDecoder> imageDecoder = ImageDecoder::create(static_cast<const char*>(data), length,
+ OwnPtr<ImageDecoder> imageDecoder = ImageDecoder::create(static_cast<const char*>(data), length,
ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileIgnored);
if (!imageDecoder)
return false;
@@ -109,7 +107,7 @@ bool PictureSnapshot::isEmpty() const
return m_picture->cullRect().isEmpty();
}
-std::unique_ptr<Vector<char>> PictureSnapshot::replay(unsigned fromStep, unsigned toStep, double scale) const
+PassOwnPtr<Vector<char>> PictureSnapshot::replay(unsigned fromStep, unsigned toStep, double scale) const
{
const SkIRect bounds = m_picture->cullRect().roundOut();
@@ -129,7 +127,7 @@ std::unique_ptr<Vector<char>> PictureSnapshot::replay(unsigned fromStep, unsigne
canvas.resetStepCount();
m_picture->playback(&canvas, &canvas);
}
- std::unique_ptr<Vector<char>> base64Data = wrapUnique(new Vector<char>());
+ OwnPtr<Vector<char>> base64Data = adoptPtr(new Vector<char>());
Vector<char> encodedImage;
RefPtr<SkImage> image = fromSkSp(SkImage::MakeFromBitmap(bitmap));
@@ -146,9 +144,9 @@ std::unique_ptr<Vector<char>> PictureSnapshot::replay(unsigned fromStep, unsigne
return base64Data;
}
-std::unique_ptr<PictureSnapshot::Timings> PictureSnapshot::profile(unsigned minRepeatCount, double minDuration, const FloatRect* clipRect) const
+PassOwnPtr<PictureSnapshot::Timings> PictureSnapshot::profile(unsigned minRepeatCount, double minDuration, const FloatRect* clipRect) const
{
- std::unique_ptr<PictureSnapshot::Timings> timings = wrapUnique(new PictureSnapshot::Timings());
+ OwnPtr<PictureSnapshot::Timings> timings = adoptPtr(new PictureSnapshot::Timings());
timings->reserveCapacity(minRepeatCount);
const SkIRect bounds = m_picture->cullRect().roundOut();
SkBitmap bitmap;

Powered by Google App Engine
This is Rietveld 408576698