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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from Kent; merge. 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/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index d150c848235c9ef811b0b8e405f15de6e8abe0e5..edd8192ed0aab8393463fe7a50e3c47f090739ef 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -58,10 +58,12 @@
#include "wtf/HashMap.h"
#include "wtf/HashSet.h"
#include "wtf/MathExtras.h"
+#include "wtf/PtrUtil.h"
#include "wtf/text/StringUTF8Adaptor.h"
#include "wtf/text/WTFString.h"
#include <algorithm>
#include <cmath>
+#include <memory>
#include <utility>
#ifndef NDEBUG
@@ -108,9 +110,9 @@ static PaintInvalidationTrackingMap& paintInvalidationTrackingMap()
return map;
}
-PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
+std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
{
- return adoptPtr(new GraphicsLayer(client));
+ return wrapUnique(new GraphicsLayer(client));
}
GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
@@ -149,8 +151,8 @@ GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
m_client->verifyNotPainting();
#endif
- m_contentLayerDelegate = adoptPtr(new ContentLayerDelegate(this));
- m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLayer(m_contentLayerDelegate.get()));
+ m_contentLayerDelegate = wrapUnique(new ContentLayerDelegate(this));
+ m_layer = wrapUnique(Platform::current()->compositorSupport()->createContentLayer(m_contentLayerDelegate.get()));
m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
m_layer->layer()->setLayerClient(this);
}
@@ -1172,7 +1174,7 @@ void GraphicsLayer::setContentsToImage(Image* image, RespectImageOrientationEnum
if (image && skImage) {
if (!m_imageLayer) {
- m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->createImageLayer());
+ m_imageLayer = wrapUnique(Platform::current()->compositorSupport()->createImageLayer());
registerContentsLayer(m_imageLayer->layer());
}
m_imageLayer->setImage(skImage.get());
@@ -1195,14 +1197,14 @@ WebLayer* GraphicsLayer::platformLayer() const
void GraphicsLayer::setFilters(const FilterOperations& filters)
{
- OwnPtr<CompositorFilterOperations> webFilters = adoptPtr(CompositorFactory::current().createFilterOperations());
+ std::unique_ptr<CompositorFilterOperations> webFilters = wrapUnique(CompositorFactory::current().createFilterOperations());
SkiaImageFilterBuilder::buildFilterOperations(filters, webFilters.get());
m_layer->layer()->setFilters(webFilters->asFilterOperations());
}
void GraphicsLayer::setBackdropFilters(const FilterOperations& filters)
{
- OwnPtr<CompositorFilterOperations> webFilters = adoptPtr(CompositorFactory::current().createFilterOperations());
+ std::unique_ptr<CompositorFilterOperations> webFilters = wrapUnique(CompositorFactory::current().createFilterOperations());
SkiaImageFilterBuilder::buildFilterOperations(filters, webFilters.get());
m_layer->layer()->setBackgroundFilters(webFilters->asFilterOperations());
}

Powered by Google App Engine
This is Rietveld 408576698