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

Unified Diff: third_party/WebKit/Source/platform/DragImage.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/DragImage.cpp
diff --git a/third_party/WebKit/Source/platform/DragImage.cpp b/third_party/WebKit/Source/platform/DragImage.cpp
index 52e7c7edd48643c70f71dc8a44a583c37341764c..35e3a2cc620c557e6b31fc85e64e66b9b0e05631 100644
--- a/third_party/WebKit/Source/platform/DragImage.cpp
+++ b/third_party/WebKit/Source/platform/DragImage.cpp
@@ -50,11 +50,11 @@
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkSurface.h"
-#include "wtf/PassOwnPtr.h"
+#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
-
#include <algorithm>
+#include <memory>
namespace blink {
@@ -132,7 +132,7 @@ FloatSize DragImage::clampedImageScale(const IntSize& imageSize, const IntSize&
return imageScale;
}
-PassOwnPtr<DragImage> DragImage::create(Image* image,
+std::unique_ptr<DragImage> DragImage::create(Image* image,
RespectImageOrientationEnum shouldRespectImageOrientation, float deviceScaleFactor,
InterpolationQuality interpolationQuality, float opacity, FloatSize imageScale)
{
@@ -153,7 +153,7 @@ PassOwnPtr<DragImage> DragImage::create(Image* image,
if (!resizedImage || !resizedImage->asLegacyBitmap(&bm, SkImage::kRO_LegacyBitmapMode))
return nullptr;
- return adoptPtr(new DragImage(bm, deviceScaleFactor, interpolationQuality));
+ return wrapUnique(new DragImage(bm, deviceScaleFactor, interpolationQuality));
}
static Font deriveDragLabelFont(int size, FontWeight fontWeight, const FontDescription& systemFont)
@@ -167,7 +167,7 @@ static Font deriveDragLabelFont(int size, FontWeight fontWeight, const FontDescr
return result;
}
-PassOwnPtr<DragImage> DragImage::create(const KURL& url, const String& inLabel, const FontDescription& systemFont, float deviceScaleFactor)
+std::unique_ptr<DragImage> DragImage::create(const KURL& url, const String& inLabel, const FontDescription& systemFont, float deviceScaleFactor)
{
const Font labelFont = deriveDragLabelFont(kDragLinkLabelFontSize, FontWeightBold, systemFont);
const Font urlFont = deriveDragLabelFont(kDragLinkUrlFontSize, FontWeightNormal, systemFont);
@@ -213,7 +213,7 @@ PassOwnPtr<DragImage> DragImage::create(const KURL& url, const String& inLabel,
// fill the background
IntSize scaledImageSize = imageSize;
scaledImageSize.scale(deviceScaleFactor);
- OwnPtr<ImageBuffer> buffer(ImageBuffer::create(scaledImageSize));
+ std::unique_ptr<ImageBuffer> buffer(ImageBuffer::create(scaledImageSize));
if (!buffer)
return nullptr;
« no previous file with comments | « third_party/WebKit/Source/platform/DragImage.h ('k') | third_party/WebKit/Source/platform/DragImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698