Move Source/WebCore/rendering/ code to std::unique_ptr
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Mar 2014 10:12:49 +0000 (10:12 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Mar 2014 10:12:49 +0000 (10:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=129664

Reviewed by Anders Carlsson.

Replace uses of OwnPtr and PassOwnPtr in code under Source/WebCore/rendering/ with std::unique_ptr.

* platform/graphics/FloatPolygon.cpp:
(WebCore::FloatPolygon::FloatPolygon):
* platform/graphics/FloatPolygon.h:
* rendering/ClipPathOperation.h:
* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
* rendering/FlowThreadController.h:
* rendering/HitTestLocation.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::HitTestResult):
(WebCore::HitTestResult::operator=):
(WebCore::HitTestResult::rectBasedTestResult):
(WebCore::HitTestResult::mutableRectBasedTestResult):
* rendering/HitTestResult.h:
* rendering/HitTestingTransformState.cpp:
* rendering/ImageQualityController.h:
* rendering/RenderBlock.cpp:
(WebCore::removeBlockFromDescendantAndContainerMaps):
(WebCore::RenderBlock::finishDelayUpdateScrollInfo):
(WebCore::RenderBlock::addContinuationWithOutline):
(WebCore::RenderBlock::paintContinuationOutlines):
(WebCore::RenderBlock::insertIntoTrackedRendererMaps):
(WebCore::RenderBlock::removeFromTrackedRendererMaps):
(WebCore::RenderBlock::setComputedColumnCountAndWidth):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::createFloatingObjects):
* rendering/RenderBlockFlow.h:
* rendering/RenderBoxRegionInfo.h:
* rendering/RenderButton.cpp:
(WebCore::RenderButton::styleDidChange):
* rendering/RenderButton.h:
* rendering/RenderCounter.cpp:
(WebCore::makeCounterNode):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
(WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
* rendering/RenderFlowThread.h:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::push):
(WebCore::RenderGeometryMap::pushView):
* rendering/RenderGeometryMap.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::resolveGridPositionsFromStyle):
(WebCore::RenderGrid::resolveGridPositionAgainstOppositePosition):
(WebCore::RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition):
(WebCore::RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
(WebCore::RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
* rendering/RenderGrid.h:
* rendering/RenderImageResource.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
(WebCore::RenderLayer::updateTransform):
(WebCore::RenderLayer::setupFilters):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintChildLayerIntoColumns):
(WebCore::RenderLayer::hitTestChildLayerColumns):
(WebCore::RenderLayer::updateClipRects):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::clearZOrderLists):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
* rendering/RenderLayerCompositor.h:
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::map):
(WebCore::RenderLayer::FilterInfo::get):
* rendering/RenderLayerFilterInfo.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::setRenderBoxRegionInfo):
(WebCore::RenderRegion::takeRenderBoxRegionInfo):
* rendering/RenderRegion.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::styleDidChange):
* rendering/RenderTable.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::selectionBounds):
(WebCore::RenderView::setSelection):
(WebCore::RenderView::compositor):
(WebCore::RenderView::flowThreadController):
(WebCore::RenderView::imageQualityController):
* rendering/RenderView.h:
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::appendFloat):
* rendering/TextAutosizer.h:
* rendering/shapes/PolygonShape.cpp:
(WebCore::computeShapePaddingBounds):
(WebCore::computeShapeMarginBounds):
* rendering/shapes/PolygonShape.h:
(WebCore::PolygonShape::PolygonShape):
* rendering/shapes/RasterShape.cpp:
(WebCore::RasterShapeIntervals::computeShapeMarginIntervals):
* rendering/shapes/RasterShape.h:
(WebCore::RasterShape::RasterShape):
* rendering/shapes/Shape.cpp:
(WebCore::createInsetShape):
(WebCore::createRectangleShape):
(WebCore::createCircleShape):
(WebCore::createEllipseShape):
(WebCore::createPolygonShape):
(WebCore::Shape::createShape):
(WebCore::Shape::createRasterShape):
(WebCore::Shape::createLayoutBoxShape):
* rendering/shapes/Shape.h:
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::markShapeAsDirty):
(WebCore::ShapeInfo::isShapeDirty):
* rendering/shapes/ShapeInsideInfo.h:
* rendering/style/ContentData.h:
* rendering/style/CounterDirectives.cpp:
(WebCore::clone):
* rendering/style/CounterDirectives.h:
* rendering/style/GridCoordinate.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCachedPseudoStyle):
(WebCore::RenderStyle::accessCounterDirectives):
(WebCore::RenderStyle::accessAnimations):
(WebCore::RenderStyle::accessTransitions):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::buildPattern):
* rendering/svg/RenderSVGResourcePattern.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::updateShapeFromElement):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/SVGResources.cpp:
(WebCore::SVGResources::setClipper):
(WebCore::SVGResources::setFilter):
(WebCore::SVGResources::setMarkerStart):
(WebCore::SVGResources::setMarkerMid):
(WebCore::SVGResources::setMarkerEnd):
(WebCore::SVGResources::setMasker):
(WebCore::SVGResources::setFill):
(WebCore::SVGResources::setStroke):
* rendering/svg/SVGResources.h:
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::addResourcesFromRenderer):
(WebCore::SVGResourcesCache::removeResourcesFromRenderer):
* rendering/svg/SVGResourcesCache.h:
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
* rendering/svg/SVGTextMetricsBuilder.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166489 268f45cc-cd09-0410-ab3c-d52691b4dbfc

67 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FloatPolygon.cpp
Source/WebCore/platform/graphics/FloatPolygon.h
Source/WebCore/rendering/ClipPathOperation.h
Source/WebCore/rendering/FlowThreadController.cpp
Source/WebCore/rendering/FlowThreadController.h
Source/WebCore/rendering/HitTestLocation.h
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/HitTestResult.h
Source/WebCore/rendering/HitTestingTransformState.cpp
Source/WebCore/rendering/ImageQualityController.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderBoxRegionInfo.h
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderButton.h
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderGeometryMap.cpp
Source/WebCore/rendering/RenderGeometryMap.h
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h
Source/WebCore/rendering/RenderImageResource.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderLayerFilterInfo.cpp
Source/WebCore/rendering/RenderLayerFilterInfo.h
Source/WebCore/rendering/RenderRegion.cpp
Source/WebCore/rendering/RenderRegion.h
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/RootInlineBox.h
Source/WebCore/rendering/TextAutosizer.h
Source/WebCore/rendering/shapes/PolygonShape.cpp
Source/WebCore/rendering/shapes/PolygonShape.h
Source/WebCore/rendering/shapes/RasterShape.cpp
Source/WebCore/rendering/shapes/RasterShape.h
Source/WebCore/rendering/shapes/Shape.cpp
Source/WebCore/rendering/shapes/Shape.h
Source/WebCore/rendering/shapes/ShapeInfo.h
Source/WebCore/rendering/style/ContentData.h
Source/WebCore/rendering/style/CounterDirectives.cpp
Source/WebCore/rendering/style/CounterDirectives.h
Source/WebCore/rendering/style/GridCoordinate.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h
Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceGradient.h
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.h
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGShape.h
Source/WebCore/rendering/svg/SVGResources.cpp
Source/WebCore/rendering/svg/SVGResources.h
Source/WebCore/rendering/svg/SVGResourcesCache.cpp
Source/WebCore/rendering/svg/SVGResourcesCache.h
Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h

index 5b26030..7eedc16 100644 (file)
@@ -1,3 +1,167 @@
+2014-03-23  Zan Dobersek  <zdobersek@igalia.com>
+
+        Move Source/WebCore/rendering/ code to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=129664
+
+        Reviewed by Anders Carlsson.
+
+        Replace uses of OwnPtr and PassOwnPtr in code under Source/WebCore/rendering/ with std::unique_ptr.
+
+        * platform/graphics/FloatPolygon.cpp:
+        (WebCore::FloatPolygon::FloatPolygon):
+        * platform/graphics/FloatPolygon.h:
+        * rendering/ClipPathOperation.h:
+        * rendering/FlowThreadController.cpp:
+        (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
+        * rendering/FlowThreadController.h:
+        * rendering/HitTestLocation.h:
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::HitTestResult):
+        (WebCore::HitTestResult::operator=):
+        (WebCore::HitTestResult::rectBasedTestResult):
+        (WebCore::HitTestResult::mutableRectBasedTestResult):
+        * rendering/HitTestResult.h:
+        * rendering/HitTestingTransformState.cpp:
+        * rendering/ImageQualityController.h:
+        * rendering/RenderBlock.cpp:
+        (WebCore::removeBlockFromDescendantAndContainerMaps):
+        (WebCore::RenderBlock::finishDelayUpdateScrollInfo):
+        (WebCore::RenderBlock::addContinuationWithOutline):
+        (WebCore::RenderBlock::paintContinuationOutlines):
+        (WebCore::RenderBlock::insertIntoTrackedRendererMaps):
+        (WebCore::RenderBlock::removeFromTrackedRendererMaps):
+        (WebCore::RenderBlock::setComputedColumnCountAndWidth):
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::createFloatingObjects):
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBoxRegionInfo.h:
+        * rendering/RenderButton.cpp:
+        (WebCore::RenderButton::styleDidChange):
+        * rendering/RenderButton.h:
+        * rendering/RenderCounter.cpp:
+        (WebCore::makeCounterNode):
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
+        (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
+        * rendering/RenderFlowThread.h:
+        * rendering/RenderGeometryMap.cpp:
+        (WebCore::RenderGeometryMap::push):
+        (WebCore::RenderGeometryMap::pushView):
+        * rendering/RenderGeometryMap.h:
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
+        (WebCore::RenderGrid::placeItemsOnGrid):
+        (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
+        (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
+        (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
+        (WebCore::RenderGrid::resolveGridPositionsFromStyle):
+        (WebCore::RenderGrid::resolveGridPositionAgainstOppositePosition):
+        (WebCore::RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition):
+        (WebCore::RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
+        (WebCore::RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
+        * rendering/RenderGrid.h:
+        * rendering/RenderImageResource.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
+        (WebCore::RenderLayer::updateTransform):
+        (WebCore::RenderLayer::setupFilters):
+        (WebCore::RenderLayer::paintLayerContents):
+        (WebCore::RenderLayer::paintChildLayerIntoColumns):
+        (WebCore::RenderLayer::hitTestChildLayerColumns):
+        (WebCore::RenderLayer::updateClipRects):
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::clearZOrderLists):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
+        (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderLayerFilterInfo.cpp:
+        (WebCore::RenderLayer::FilterInfo::map):
+        (WebCore::RenderLayer::FilterInfo::get):
+        * rendering/RenderLayerFilterInfo.h:
+        * rendering/RenderRegion.cpp:
+        (WebCore::RenderRegion::setRenderBoxRegionInfo):
+        (WebCore::RenderRegion::takeRenderBoxRegionInfo):
+        * rendering/RenderRegion.h:
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::styleDidChange):
+        * rendering/RenderTable.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::selectionBounds):
+        (WebCore::RenderView::setSelection):
+        (WebCore::RenderView::compositor):
+        (WebCore::RenderView::flowThreadController):
+        (WebCore::RenderView::imageQualityController):
+        * rendering/RenderView.h:
+        * rendering/RootInlineBox.h:
+        (WebCore::RootInlineBox::appendFloat):
+        * rendering/TextAutosizer.h:
+        * rendering/shapes/PolygonShape.cpp:
+        (WebCore::computeShapePaddingBounds):
+        (WebCore::computeShapeMarginBounds):
+        * rendering/shapes/PolygonShape.h:
+        (WebCore::PolygonShape::PolygonShape):
+        * rendering/shapes/RasterShape.cpp:
+        (WebCore::RasterShapeIntervals::computeShapeMarginIntervals):
+        * rendering/shapes/RasterShape.h:
+        (WebCore::RasterShape::RasterShape):
+        * rendering/shapes/Shape.cpp:
+        (WebCore::createInsetShape):
+        (WebCore::createRectangleShape):
+        (WebCore::createCircleShape):
+        (WebCore::createEllipseShape):
+        (WebCore::createPolygonShape):
+        (WebCore::Shape::createShape):
+        (WebCore::Shape::createRasterShape):
+        (WebCore::Shape::createLayoutBoxShape):
+        * rendering/shapes/Shape.h:
+        * rendering/shapes/ShapeInfo.h:
+        (WebCore::ShapeInfo::markShapeAsDirty):
+        (WebCore::ShapeInfo::isShapeDirty):
+        * rendering/shapes/ShapeInsideInfo.h:
+        * rendering/style/ContentData.h:
+        * rendering/style/CounterDirectives.cpp:
+        (WebCore::clone):
+        * rendering/style/CounterDirectives.h:
+        * rendering/style/GridCoordinate.h:
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::addCachedPseudoStyle):
+        (WebCore::RenderStyle::accessCounterDirectives):
+        (WebCore::RenderStyle::accessAnimations):
+        (WebCore::RenderStyle::accessTransitions):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        * rendering/style/StyleRareNonInheritedData.h:
+        * rendering/svg/RenderSVGResourceGradient.cpp:
+        (WebCore::RenderSVGResourceGradient::applyResource):
+        * rendering/svg/RenderSVGResourceGradient.h:
+        * rendering/svg/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::buildPattern):
+        * rendering/svg/RenderSVGResourcePattern.h:
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::updateShapeFromElement):
+        * rendering/svg/RenderSVGShape.h:
+        * rendering/svg/SVGResources.cpp:
+        (WebCore::SVGResources::setClipper):
+        (WebCore::SVGResources::setFilter):
+        (WebCore::SVGResources::setMarkerStart):
+        (WebCore::SVGResources::setMarkerMid):
+        (WebCore::SVGResources::setMarkerEnd):
+        (WebCore::SVGResources::setMasker):
+        (WebCore::SVGResources::setFill):
+        (WebCore::SVGResources::setStroke):
+        * rendering/svg/SVGResources.h:
+        * rendering/svg/SVGResourcesCache.cpp:
+        (WebCore::SVGResourcesCache::addResourcesFromRenderer):
+        (WebCore::SVGResourcesCache::removeResourcesFromRenderer):
+        * rendering/svg/SVGResourcesCache.h:
+        * rendering/svg/SVGTextMetricsBuilder.cpp:
+        (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
+        * rendering/svg/SVGTextMetricsBuilder.h:
+
 2014-03-28  Sergio Villar Senin  <svillar@igalia.com>
 
         Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in loader
index c39e285..781bd2d 100644 (file)
@@ -79,8 +79,8 @@ static unsigned findNextEdgeVertexIndex(const FloatPolygon& polygon, unsigned ve
     return vertexIndex2;
 }
 
-FloatPolygon::FloatPolygon(PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule)
-    : m_vertices(vertices)
+FloatPolygon::FloatPolygon(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule)
+    : m_vertices(std::move(vertices))
     , m_fillRule(fillRule)
 {
     unsigned nVertices = numberOfVertices();
index 5666574..e869a8c 100644 (file)
@@ -35,8 +35,7 @@
 #include "PODIntervalTree.h"
 #include "ValueToString.h"
 #include "WindRule.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
+#include <memory>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -45,7 +44,7 @@ class FloatPolygonEdge;
 
 class FloatPolygon {
 public:
-    FloatPolygon(PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule);
+    FloatPolygon(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule);
 
     const FloatPoint& vertexAt(unsigned index) const { return (*m_vertices)[index]; }
     unsigned numberOfVertices() const { return m_vertices->size(); }
@@ -67,7 +66,7 @@ private:
     bool containsNonZero(const FloatPoint&) const;
     bool containsEvenOdd(const FloatPoint&) const;
 
-    OwnPtr<Vector<FloatPoint>> m_vertices;
+    std::unique_ptr<Vector<FloatPoint>> m_vertices;
     WindRule m_fillRule;
     FloatRect m_boundingBox;
     bool m_empty;
index 656e7fd..af60a98 100644 (file)
@@ -33,8 +33,6 @@
 #include "BasicShapes.h"
 #include "Path.h"
 #include "RenderStyleConstants.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
index 2ea586f..d90f3a7 100644 (file)
 
 namespace WebCore {
 
-PassOwnPtr<FlowThreadController> FlowThreadController::create(RenderView* view)
-{
-    return adoptPtr(new FlowThreadController(view));
-}
-
 FlowThreadController::FlowThreadController(RenderView* view)
     : m_view(view)
     , m_currentRenderFlowThread(0)
@@ -60,7 +55,7 @@ FlowThreadController::~FlowThreadController()
 RenderNamedFlowThread& FlowThreadController::ensureRenderFlowThreadWithName(const AtomicString& name)
 {
     if (!m_renderNamedFlowThreadList)
-        m_renderNamedFlowThreadList = adoptPtr(new RenderNamedFlowThreadList());
+        m_renderNamedFlowThreadList = std::make_unique<RenderNamedFlowThreadList>();
     else {
         for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) {
             RenderNamedFlowThread* flowRenderer = *iter;
index 7d3f98d..0cdb56c 100644 (file)
@@ -31,8 +31,8 @@
 #define FlowThreadController_h
 
 #include "RenderView.h"
+#include <memory>
 #include <wtf/ListHashSet.h>
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
@@ -45,7 +45,7 @@ typedef ListHashSet<RenderNamedFlowThread*> RenderNamedFlowThreadList;
 class FlowThreadController {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<FlowThreadController> create(RenderView*);
+    explicit FlowThreadController(RenderView*);
     ~FlowThreadController();
 
     RenderFlowThread* currentRenderFlowThread() const { return m_currentRenderFlowThread; }
@@ -91,7 +91,6 @@ public:
 #endif
 
 protected:
-    explicit FlowThreadController(RenderView*);
     void updateFlowThreadsChainIfNecessary();
     void resetFlowThreadsWithAutoHeightRegions();
 
@@ -100,7 +99,7 @@ private:
     RenderFlowThread* m_currentRenderFlowThread;
     bool m_isRenderNamedFlowThreadOrderDirty;
     unsigned m_flowThreadsWithAutoLogicalHeightRegions;
-    OwnPtr<RenderNamedFlowThreadList> m_renderNamedFlowThreadList;
+    std::unique_ptr<RenderNamedFlowThreadList> m_renderNamedFlowThreadList;
     HashMap<const Element*, RenderNamedFlowThread*> m_mapNamedFlowContentElement;
 };
 
index 75f1f04..c31ba34 100644 (file)
@@ -30,7 +30,6 @@
 #include "TextDirection.h"
 #include <wtf/Forward.h>
 #include <wtf/ListHashSet.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
index 6459da6..20b7ad1 100644 (file)
@@ -92,7 +92,7 @@ HitTestResult::HitTestResult(const HitTestResult& other)
     , m_isOverWidget(other.isOverWidget())
 {
     // Only copy the NodeSet in case of rect hit test.
-    m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*other.m_rectBasedTestResult) : 0);
+    m_rectBasedTestResult = other.m_rectBasedTestResult ? std::make_unique<NodeSet>(*other.m_rectBasedTestResult) : nullptr;
 }
 
 HitTestResult::~HitTestResult()
@@ -111,7 +111,7 @@ HitTestResult& HitTestResult::operator=(const HitTestResult& other)
     m_isOverWidget = other.isOverWidget();
 
     // Only copy the NodeSet in case of rect hit test.
-    m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*other.m_rectBasedTestResult) : 0);
+    m_rectBasedTestResult = other.m_rectBasedTestResult ? std::make_unique<NodeSet>(*other.m_rectBasedTestResult) : nullptr;
 
     return *this;
 }
@@ -637,14 +637,14 @@ void HitTestResult::append(const HitTestResult& other)
 const HitTestResult::NodeSet& HitTestResult::rectBasedTestResult() const
 {
     if (!m_rectBasedTestResult)
-        m_rectBasedTestResult = adoptPtr(new NodeSet);
+        m_rectBasedTestResult = std::make_unique<NodeSet>();
     return *m_rectBasedTestResult;
 }
 
 HitTestResult::NodeSet& HitTestResult::mutableRectBasedTestResult()
 {
     if (!m_rectBasedTestResult)
-        m_rectBasedTestResult = adoptPtr(new NodeSet);
+        m_rectBasedTestResult = std::make_unique<NodeSet>();
     return *m_rectBasedTestResult;
 }
 
index 950ea74..034053c 100644 (file)
@@ -28,9 +28,9 @@
 #include "HitTestRequest.h"
 #include "LayoutRect.h"
 #include "TextDirection.h"
+#include <memory>
 #include <wtf/Forward.h>
 #include <wtf/ListHashSet.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
@@ -158,7 +158,7 @@ private:
     RefPtr<Scrollbar> m_scrollbar;
     bool m_isOverWidget; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example).
 
-    mutable OwnPtr<NodeSet> m_rectBasedTestResult;
+    mutable std::unique_ptr<NodeSet> m_rectBasedTestResult;
 };
 
 String displayString(const String&, const Node*);
index 487c982..6c1b033 100644 (file)
@@ -27,7 +27,6 @@
 #include "HitTestingTransformState.h"
 
 #include "LayoutRect.h"
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
index a06df2b..432d361 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "Timer.h"
 #include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
@@ -42,7 +41,7 @@ class RenderView;
 class ImageQualityController {
     WTF_MAKE_NONCOPYABLE(ImageQualityController)
 public:
-    static PassOwnPtr<ImageQualityController> create(const RenderView& renderView) { return adoptPtr(new ImageQualityController(renderView)); }
+    explicit ImageQualityController(const RenderView&);
 
     bool shouldPaintAtLowQuality(GraphicsContext*, RenderBoxModelObject*, Image*, const void* layer, const LayoutSize&);
     void rendererWillBeDestroyed(RenderBoxModelObject& renderer) { removeObject(&renderer); }
@@ -51,8 +50,6 @@ private:
     typedef HashMap<const void*, LayoutSize> LayerSizeMap;
     typedef HashMap<RenderBoxModelObject*, LayerSizeMap> ObjectLayerSizeMap;
 
-    explicit ImageQualityController(const RenderView&);
-
     void removeLayer(RenderBoxModelObject*, LayerSizeMap* innerMap, const void* layer);
     void set(RenderBoxModelObject*, LayerSizeMap* innerMap, const void* layer, const LayoutSize&);
     void highQualityRepaintTimerFired(Timer<ImageQualityController>&);
index 3548960..6c0ed41 100644 (file)
@@ -86,7 +86,7 @@ struct SameSizeAsRenderBlock : public RenderBox {
 
 COMPILE_ASSERT(sizeof(RenderBlock) == sizeof(SameSizeAsRenderBlock), RenderBlock_should_stay_small);
 
-typedef WTF::HashMap<const RenderBox*, OwnPtr<ColumnInfo>> ColumnInfoMap;
+typedef WTF::HashMap<const RenderBox*, std::unique_ptr<ColumnInfo>> ColumnInfoMap;
 static ColumnInfoMap* gColumnInfoMap = 0;
 
 static TrackedDescendantsMap* gPositionedDescendantsMap = 0;
@@ -95,7 +95,7 @@ static TrackedDescendantsMap* gPercentHeightDescendantsMap = 0;
 static TrackedContainerMap* gPositionedContainerMap = 0;
 static TrackedContainerMap* gPercentHeightContainerMap = 0;
     
-typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*>>> ContinuationOutlineTableMap;
+typedef WTF::HashMap<RenderBlock*, std::unique_ptr<ListHashSet<RenderInline*>>> ContinuationOutlineTableMap;
 
 typedef WTF::HashSet<RenderBlock*> DelayedUpdateScrollInfoSet;
 static int gDelayUpdateScrollInfo = 0;
@@ -189,7 +189,7 @@ RenderBlock::RenderBlock(Document& document, PassRef<RenderStyle> style, unsigne
 
 static void removeBlockFromDescendantAndContainerMaps(RenderBlock* block, TrackedDescendantsMap*& descendantMap, TrackedContainerMap*& containerMap)
 {
-    if (OwnPtr<TrackedRendererListHashSet> descendantSet = descendantMap->take(block)) {
+    if (std::unique_ptr<TrackedRendererListHashSet> descendantSet = descendantMap->take(block)) {
         TrackedRendererListHashSet::iterator end = descendantSet->end();
         for (TrackedRendererListHashSet::iterator descendant = descendantSet->begin(); descendant != end; ++descendant) {
             TrackedContainerMap::iterator it = containerMap->find(*descendant);
@@ -1224,7 +1224,7 @@ void RenderBlock::finishDelayUpdateScrollInfo()
     if (gDelayUpdateScrollInfo == 0) {
         ASSERT(gDelayedUpdateScrollInfoSet);
 
-        OwnPtr<DelayedUpdateScrollInfoSet> infoSet(adoptPtr(gDelayedUpdateScrollInfoSet));
+        std::unique_ptr<DelayedUpdateScrollInfoSet> infoSet(gDelayedUpdateScrollInfoSet);
         gDelayedUpdateScrollInfoSet = 0;
 
         for (DelayedUpdateScrollInfoSet::iterator it = infoSet->begin(); it != infoSet->end(); ++it) {
@@ -2226,7 +2226,7 @@ void RenderBlock::addContinuationWithOutline(RenderInline* flow)
     ListHashSet<RenderInline*>* continuations = table->get(this);
     if (!continuations) {
         continuations = new ListHashSet<RenderInline*>;
-        table->set(this, adoptPtr(continuations));
+        table->set(this, std::unique_ptr<ListHashSet<RenderInline*>>(continuations));
     }
     
     continuations->add(flow);
@@ -2251,7 +2251,7 @@ void RenderBlock::paintContinuationOutlines(PaintInfo& info, const LayoutPoint&
     if (table->isEmpty())
         return;
         
-    OwnPtr<ListHashSet<RenderInline*>> continuations = table->take(this);
+    std::unique_ptr<ListHashSet<RenderInline*>> continuations = table->take(this);
     if (!continuations)
         return;
 
@@ -2656,7 +2656,7 @@ void RenderBlock::insertIntoTrackedRendererMaps(RenderBox& descendant, TrackedDe
     TrackedRendererListHashSet* descendantSet = descendantsMap->get(this);
     if (!descendantSet) {
         descendantSet = new TrackedRendererListHashSet;
-        descendantsMap->set(this, adoptPtr(descendantSet));
+        descendantsMap->set(this, std::unique_ptr<TrackedRendererListHashSet>(descendantSet));
     }
     bool added = descendantSet->add(&descendant).isNewEntry;
     if (!added) {
@@ -2668,7 +2668,7 @@ void RenderBlock::insertIntoTrackedRendererMaps(RenderBox& descendant, TrackedDe
     HashSet<RenderBlock*>* containerSet = containerMap->get(&descendant);
     if (!containerSet) {
         containerSet = new HashSet<RenderBlock*>;
-        containerMap->set(&descendant, adoptPtr(containerSet));
+        containerMap->set(&descendant, std::unique_ptr<HashSet<RenderBlock*>>(containerSet));
     }
     ASSERT(!containerSet->contains(this));
     containerSet->add(this);
@@ -2679,7 +2679,7 @@ void RenderBlock::removeFromTrackedRendererMaps(RenderBox& descendant, TrackedDe
     if (!descendantsMap)
         return;
     
-    OwnPtr<HashSet<RenderBlock*>> containerSet = containerMap->take(&descendant);
+    std::unique_ptr<HashSet<RenderBlock*>> containerSet = containerMap->take(&descendant);
     if (!containerSet)
         return;
     
@@ -3329,7 +3329,7 @@ void RenderBlock::setComputedColumnCountAndWidth(int count, LayoutUnit width)
             if (!gColumnInfoMap)
                 gColumnInfoMap = new ColumnInfoMap;
             info = new ColumnInfo;
-            gColumnInfoMap->add(this, adoptPtr(info));
+            gColumnInfoMap->add(this, std::unique_ptr<ColumnInfo>(info));
             setHasColumns(true);
         }
         info->setDesiredColumnCount(count);
index 2baf996..eaf4e10 100644 (file)
@@ -27,7 +27,7 @@
 #include "GapRects.h"
 #include "RenderBox.h"
 #include "TextRun.h"
-#include <wtf/OwnPtr.h>
+#include <memory>
 #include <wtf/ListHashSet.h>
 
 namespace WebCore {
@@ -42,8 +42,8 @@ struct BidiRun;
 struct PaintInfo;
 
 typedef WTF::ListHashSet<RenderBox*, 16> TrackedRendererListHashSet;
-typedef WTF::HashMap<const RenderBlock*, OwnPtr<TrackedRendererListHashSet>> TrackedDescendantsMap;
-typedef WTF::HashMap<const RenderBox*, OwnPtr<HashSet<RenderBlock*>>> TrackedContainerMap;
+typedef WTF::HashMap<const RenderBlock*, std::unique_ptr<TrackedRendererListHashSet>> TrackedDescendantsMap;
+typedef WTF::HashMap<const RenderBox*, std::unique_ptr<HashSet<RenderBlock*>>> TrackedContainerMap;
 
 enum CaretType { CursorCaret, DragCaret };
 enum ContainingBlockState { NewContainingBlock, SameContainingBlock };
index fc62d2e..6db0337 100644 (file)
@@ -2024,7 +2024,7 @@ void RenderBlockFlow::clipOutFloatingObjects(RenderBlock& rootBlock, const Paint
 
 void RenderBlockFlow::createFloatingObjects()
 {
-    m_floatingObjects = adoptPtr(new FloatingObjects(*this));
+    m_floatingObjects = std::make_unique<FloatingObjects>(*this);
 }
 
 void RenderBlockFlow::removeFloatingObjects()
index dc96ccf..1ba62dc 100644 (file)
@@ -28,6 +28,7 @@
 #include "RenderLineBoxList.h"
 #include "SimpleLineLayout.h"
 #include "TrailingObjects.h"
+#include <memory>
 
 namespace WebCore {
 
@@ -592,7 +593,7 @@ public:
 #endif
 
 protected:
-    OwnPtr<FloatingObjects> m_floatingObjects;
+    std::unique_ptr<FloatingObjects> m_floatingObjects;
     std::unique_ptr<RenderBlockFlowRareData> m_rareBlockFlowData;
     RenderLineBoxList m_lineBoxes;
     std::unique_ptr<SimpleLineLayout::Layout> m_simpleLineLayout;
index d2b182d..623608d 100644 (file)
@@ -28,7 +28,6 @@
 #define RenderBoxRegionInfo_h
 
 #include "RenderOverflow.h"
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
index dbb299a..7372dd0 100644 (file)
@@ -114,12 +114,12 @@ void RenderButton::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
 
     if (!m_default && theme().isDefault(this)) {
         if (!m_timer)
-            m_timer = adoptPtr(new Timer<RenderButton>(this, &RenderButton::timerFired));
+            m_timer = std::make_unique<Timer<RenderButton>>(this, &RenderButton::timerFired);
         m_timer->startRepeating(0.03);
         m_default = true;
     } else if (m_default && !theme().isDefault(this)) {
         m_default = false;
-        m_timer.clear();
+        m_timer = nullptr;
     }
 }
 
index 21a9e2c..81e43ac 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "RenderFlexibleBox.h"
 #include "Timer.h"
-#include <wtf/OwnPtr.h>
+#include <memory>
 
 namespace WebCore {
 
@@ -79,7 +79,7 @@ private:
     RenderTextFragment* m_buttonText;
     RenderBlock* m_inner;
 
-    OwnPtr<Timer<RenderButton>> m_timer;
+    std::unique_ptr<Timer<RenderButton>> m_timer;
     bool m_default;
 };
 
index 1fd9dc9..e9bafe5 100644 (file)
@@ -44,7 +44,7 @@ namespace WebCore {
 using namespace HTMLNames;
 
 typedef HashMap<AtomicString, RefPtr<CounterNode>> CounterMap;
-typedef HashMap<const RenderObject*, OwnPtr<CounterMap>> CounterMaps;
+typedef HashMap<const RenderObject*, std::unique_ptr<CounterMap>> CounterMaps;
 
 static CounterNode* makeCounterNode(RenderObject*, const AtomicString& identifier, bool alwaysCreateCounter);
 
@@ -324,7 +324,7 @@ static CounterNode* makeCounterNode(RenderObject* object, const AtomicString& id
         nodeMap = counterMaps().get(element);
     else {
         nodeMap = new CounterMap;
-        counterMaps().set(element, adoptPtr(nodeMap));
+        counterMaps().set(element, std::unique_ptr<CounterMap>(nodeMap));
         element->setHasCounterNodeMap(true);
     }
     nodeMap->set(identifier, newNode);
index 18f3f5a..ad0f1aa 100644 (file)
@@ -323,11 +323,11 @@ bool RenderFlowThread::updateAllLayerToRegionMappings()
 
     if (needsLayerUpdate) {
         if (!m_layerToRegionMap)
-            m_layerToRegionMap = adoptPtr(new LayerToRegionMap());
+            m_layerToRegionMap = std::make_unique<LayerToRegionMap>();
         m_layerToRegionMap->swap(layerToRegionMap);
 
         if (!m_regionToLayerListMap)
-            m_regionToLayerListMap = adoptPtr(new RegionToLayerListMap());
+            m_regionToLayerListMap = std::make_unique<RegionToLayerListMap>();
         m_regionToLayerListMap->swap(regionToLayerListMap);
     }
 
@@ -645,7 +645,7 @@ void RenderFlowThread::logicalWidthChangedInRegionsForBlock(const RenderBlock* b
         ASSERT(!region->needsLayout() || region->isRenderRegionSet());
 
         // We have no information computed for this region so we need to do it.
-        OwnPtr<RenderBoxRegionInfo> oldInfo = region->takeRenderBoxRegionInfo(block);
+        std::unique_ptr<RenderBoxRegionInfo> oldInfo = region->takeRenderBoxRegionInfo(block);
         if (!oldInfo) {
             relayoutChildren = rangeInvalidated;
             return;
index cf7eb8f..8c84ee7 100644 (file)
@@ -303,10 +303,10 @@ protected:
     };
 
     // Map a layer to the region in which the layer is painted.
-    OwnPtr<LayerToRegionMap> m_layerToRegionMap;
+    std::unique_ptr<LayerToRegionMap> m_layerToRegionMap;
 
     // Map a region to the list of layers that paint in that region.
-    OwnPtr<RegionToLayerListMap> m_regionToLayerListMap;
+    std::unique_ptr<RegionToLayerListMap> m_regionToLayerListMap;
 
     // Map a box to the list of regions in which the box is rendered.
     typedef HashMap<const RenderBox*, RenderRegionRange> RenderRegionRangeMap;
index 40f896d..db72790 100644 (file)
@@ -229,7 +229,7 @@ void RenderGeometryMap::push(const RenderObject* renderer, const TransformationM
     
     RenderGeometryMapStep& step = m_mapping[m_insertionPosition];
     if (!t.isIntegerTranslation())
-        step.m_transform = adoptPtr(new TransformationMatrix(t));
+        step.m_transform = std::make_unique<TransformationMatrix>(t);
     else
         step.m_offset = LayoutSize(t.e(), t.f());
 
@@ -246,7 +246,7 @@ void RenderGeometryMap::pushView(const RenderView* view, const LayoutSize& scrol
     RenderGeometryMapStep& step = m_mapping[m_insertionPosition];
     step.m_offset = scrollOffset;
     if (t)
-        step.m_transform = adoptPtr(new TransformationMatrix(*t));
+        step.m_transform = std::make_unique<TransformationMatrix>(*t);
     
     stepInserted(step);
 }
index c8b453e..ee79fb4 100644 (file)
@@ -32,7 +32,7 @@
 #include "LayoutSize.h"
 #include "RenderObject.h"
 #include "TransformationMatrix.h"
-#include <wtf/OwnPtr.h>
+#include <memory>
 
 namespace WebCore {
 
@@ -64,7 +64,7 @@ struct RenderGeometryMapStep {
     }
     const RenderObject* m_renderer;
     LayoutSize m_offset;
-    OwnPtr<TransformationMatrix> m_transform; // Includes offset if non-null.
+    std::unique_ptr<TransformationMatrix> m_transform; // Includes offset if non-null.
     bool m_accumulatingTransform;
     bool m_isNonUniform; // Mapping depends on the input point, e.g. because of CSS columns.
     bool m_isFixedPosition;
@@ -137,7 +137,7 @@ private:
 } // namespace WebCore
 
 namespace WTF {
-// This is required for a struct with OwnPtr. We know RenderGeometryMapStep is simple enough that
+// This is required for a struct with std::unique_ptr<>. We know RenderGeometryMapStep is simple enough that
 // initializing to 0 and moving with memcpy (and then not destructing the original) will work.
 template<> struct VectorTraits<WebCore::RenderGeometryMapStep> : SimpleClassVectorTraits { };
 }
index 1b6d0ab..f21335f 100644 (file)
@@ -117,7 +117,7 @@ public:
         return 0;
     }
 
-    PassOwnPtr<GridCoordinate> nextEmptyGridArea()
+    std::unique_ptr<GridCoordinate> nextEmptyGridArea()
     {
         if (m_grid.isEmpty())
             return nullptr;
@@ -127,10 +127,10 @@ public:
         for (; varyingTrackIndex < endOfVaryingTrackIndex; ++varyingTrackIndex) {
             const Vector<RenderBox*>& children = m_grid[m_rowIndex][m_columnIndex];
             if (children.isEmpty()) {
-                OwnPtr<GridCoordinate> result = adoptPtr(new GridCoordinate(GridSpan(m_rowIndex, m_rowIndex), GridSpan(m_columnIndex, m_columnIndex)));
+                std::unique_ptr<GridCoordinate> result = std::make_unique<GridCoordinate>(GridSpan(m_rowIndex, m_rowIndex), GridSpan(m_columnIndex, m_columnIndex));
                 // Advance the iterator to avoid an infinite loop where we would return the same grid area over and over.
                 ++varyingTrackIndex;
-                return result.release();
+                return std::move(result);
             }
         }
         return nullptr;
@@ -670,8 +670,8 @@ void RenderGrid::placeItemsOnGrid()
     for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) {
         // FIXME: We never re-resolve positions if the grid is grown during auto-placement which may lead auto / <integer>
         // positions to not match the author's intent. The specification is unclear on what should be done in this case.
-        OwnPtr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows);
-        OwnPtr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns);
+        std::unique_ptr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows);
+        std::unique_ptr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns);
         if (!rowPositions || !columnPositions) {
             GridSpan* majorAxisPositions = (autoPlacementMajorAxisDirection() == ForColumns) ? columnPositions.get() : rowPositions.get();
             if (!majorAxisPositions)
@@ -712,8 +712,8 @@ void RenderGrid::populateExplicitGridAndOrderIterator()
             orderValues.append(order);
 
         // This function bypasses the cache (cachedGridCoordinate()) as it is used to build it.
-        OwnPtr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows);
-        OwnPtr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns);
+        std::unique_ptr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows);
+        std::unique_ptr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns);
 
         // |positions| is 0 if we need to run the auto-placement algorithm. Our estimation ignores
         // this case as the auto-placement algorithm will grow the grid as needed.
@@ -733,15 +733,15 @@ void RenderGrid::populateExplicitGridAndOrderIterator()
 void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*> autoGridItems)
 {
     for (size_t i = 0; i < autoGridItems.size(); ++i) {
-        OwnPtr<GridSpan> majorAxisPositions = resolveGridPositionsFromStyle(autoGridItems[i], autoPlacementMajorAxisDirection());
+        std::unique_ptr<GridSpan> majorAxisPositions = resolveGridPositionsFromStyle(autoGridItems[i], autoPlacementMajorAxisDirection());
         GridIterator iterator(m_grid, autoPlacementMajorAxisDirection(), majorAxisPositions->initialPositionIndex);
-        if (OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
+        if (std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
             insertItemIntoGrid(autoGridItems[i], emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex);
             continue;
         }
 
         growGrid(autoPlacementMinorAxisDirection());
-        OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea();
+        std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea();
         ASSERT(emptyGridArea);
         insertItemIntoGrid(autoGridItems[i], emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex);
     }
@@ -755,13 +755,13 @@ void RenderGrid::placeAutoMajorAxisItemsOnGrid(Vector<RenderBox*> autoGridItems)
 
 void RenderGrid::placeAutoMajorAxisItemOnGrid(RenderBox* gridItem)
 {
-    OwnPtr<GridSpan> minorAxisPositions = resolveGridPositionsFromStyle(gridItem, autoPlacementMinorAxisDirection());
+    std::unique_ptr<GridSpan> minorAxisPositions = resolveGridPositionsFromStyle(gridItem, autoPlacementMinorAxisDirection());
     ASSERT(!resolveGridPositionsFromStyle(gridItem, autoPlacementMajorAxisDirection()));
     size_t minorAxisIndex = 0;
     if (minorAxisPositions) {
         minorAxisIndex = minorAxisPositions->initialPositionIndex;
         GridIterator iterator(m_grid, autoPlacementMinorAxisDirection(), minorAxisIndex);
-        if (OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
+        if (std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
             insertItemIntoGrid(gridItem, emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex);
             return;
         }
@@ -769,7 +769,7 @@ void RenderGrid::placeAutoMajorAxisItemOnGrid(RenderBox* gridItem)
         const size_t endOfMajorAxis = (autoPlacementMajorAxisDirection() == ForColumns) ? gridColumnCount() : gridRowCount();
         for (size_t majorAxisIndex = 0; majorAxisIndex < endOfMajorAxis; ++majorAxisIndex) {
             GridIterator iterator(m_grid, autoPlacementMajorAxisDirection(), majorAxisIndex);
-            if (OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
+            if (std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
                 insertItemIntoGrid(gridItem, emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex);
                 return;
             }
@@ -948,7 +948,7 @@ void RenderGrid::adjustGridPositionsFromStyle(GridPosition& initialPosition, Gri
         adjustNamedGridItemPosition(finalPosition, finalPositionSide);
 }
 
-PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, GridTrackSizingDirection direction) const
+std::unique_ptr<GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, GridTrackSizingDirection direction) const
 {
     GridPosition initialPosition = (direction == ForColumns) ? gridItem->style().gridItemColumnStart() : gridItem->style().gridItemRowStart();
     const GridPositionSide initialPositionSide = (direction == ForColumns) ? ColumnStartSide : RowStartSide;
@@ -959,7 +959,7 @@ PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox*
 
     if (initialPosition.shouldBeResolvedAgainstOppositePosition() && finalPosition.shouldBeResolvedAgainstOppositePosition()) {
         if (style().gridAutoFlow() == AutoFlowNone)
-            return adoptPtr(new GridSpan(0, 0));
+            return std::make_unique<GridSpan>(0, 0);
 
         // We can't get our grid positions without running the auto placement algorithm.
         return nullptr;
@@ -984,7 +984,7 @@ PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox*
     if (resolvedFinalPosition < resolvedInitialPosition)
         resolvedFinalPosition = resolvedInitialPosition;
 
-    return adoptPtr(new GridSpan(resolvedInitialPosition, resolvedFinalPosition));
+    return std::make_unique<GridSpan>(resolvedInitialPosition, resolvedFinalPosition);
 }
 
 size_t RenderGrid::resolveNamedGridLinePositionFromStyle(const GridPosition& position, GridPositionSide side) const
@@ -1059,10 +1059,10 @@ size_t RenderGrid::resolveGridPositionFromStyle(const GridPosition& position, Gr
     return 0;
 }
 
-PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const
+std::unique_ptr<GridSpan> RenderGrid::resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const
 {
     if (position.isAuto())
-        return GridSpan::create(resolvedOppositePosition, resolvedOppositePosition);
+        return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedOppositePosition);
 
     ASSERT(position.isSpan());
     ASSERT(position.spanPosition() > 0);
@@ -1077,13 +1077,13 @@ PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionAgainstOppositePosition(size
     size_t positionOffset = position.spanPosition() - 1;
     if (side == ColumnStartSide || side == RowStartSide) {
         size_t initialResolvedPosition = std::max<int>(0, resolvedOppositePosition - positionOffset);
-        return GridSpan::create(initialResolvedPosition, resolvedOppositePosition);
+        return std::make_unique<GridSpan>(initialResolvedPosition, resolvedOppositePosition);
     }
 
-    return GridSpan::create(resolvedOppositePosition, resolvedOppositePosition + positionOffset);
+    return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedOppositePosition + positionOffset);
 }
 
-PassOwnPtr<GridSpan> RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const
+std::unique_ptr<GridSpan> RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const
 {
     ASSERT(position.isSpan());
     ASSERT(!position.namedGridLine().isNull());
@@ -1096,7 +1096,7 @@ PassOwnPtr<GridSpan> RenderGrid::resolveNamedGridLinePositionAgainstOppositePosi
     // If there is no named grid line of that name, we resolve the position to 'auto' (which is equivalent to 'span 1' in this case).
     // See http://lists.w3.org/Archives/Public/www-style/2013Jun/0394.html.
     if (it == gridLinesNames.end())
-        return GridSpan::create(resolvedOppositePosition, resolvedOppositePosition);
+        return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedOppositePosition);
 
     if (side == RowStartSide || side == ColumnStartSide)
         return resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(resolvedOppositePosition, position, it->value);
@@ -1120,16 +1120,16 @@ static inline size_t firstNamedGridLineBeforePosition(size_t position, const Vec
     return firstLineBeforePositionIndex;
 }
 
-PassOwnPtr<GridSpan> RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const
+std::unique_ptr<GridSpan> RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const
 {
     size_t gridLineIndex = std::max<int>(0, firstNamedGridLineBeforePosition(resolvedOppositePosition, gridLines) - position.spanPosition() + 1);
     size_t resolvedGridLinePosition = gridLines[gridLineIndex];
     if (resolvedGridLinePosition > resolvedOppositePosition)
         resolvedGridLinePosition = resolvedOppositePosition;
-    return GridSpan::create(resolvedGridLinePosition, resolvedOppositePosition);
+    return std::make_unique<GridSpan>(resolvedGridLinePosition, resolvedOppositePosition);
 }
 
-PassOwnPtr<GridSpan> RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const
+std::unique_ptr<GridSpan> RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const
 {
     size_t firstLineAfterOppositePositionIndex = gridLines.size() - 1;
     const size_t* firstLineAfterOppositePosition = std::upper_bound(gridLines.begin(), gridLines.end(), resolvedOppositePosition);
@@ -1140,7 +1140,7 @@ PassOwnPtr<GridSpan> RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgai
     size_t resolvedGridLinePosition = GridPosition::adjustGridPositionForRowEndColumnEndSide(gridLines[gridLineIndex]);
     if (resolvedGridLinePosition < resolvedOppositePosition)
         resolvedGridLinePosition = resolvedOppositePosition;
-    return GridSpan::create(resolvedOppositePosition, resolvedGridLinePosition);
+    return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedGridLinePosition);
 }
 
 LayoutUnit RenderGrid::gridAreaBreadthForChild(const RenderBox* child, GridTrackSizingDirection direction, const Vector<GridTrack>& tracks) const
index 0966105..aa72038 100644 (file)
@@ -113,13 +113,13 @@ private:
     GridSpan resolveGridPositionsFromAutoPlacementPosition(const RenderBox*, GridTrackSizingDirection, size_t) const;
     void adjustNamedGridItemPosition(GridPosition&, GridPositionSide) const;
     void adjustGridPositionsFromStyle(GridPosition& initialPosition, GridPosition& finalPosition, GridPositionSide initialPositionSide, GridPositionSide finalPositionSide) const;
-    PassOwnPtr<GridSpan> resolveGridPositionsFromStyle(const RenderBox*, GridTrackSizingDirection) const;
+    std::unique_ptr<GridSpan> resolveGridPositionsFromStyle(const RenderBox*, GridTrackSizingDirection) const;
     size_t resolveNamedGridLinePositionFromStyle(const GridPosition&, GridPositionSide) const;
     size_t resolveGridPositionFromStyle(const GridPosition&, GridPositionSide) const;
-    PassOwnPtr<GridSpan> resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const;
-    PassOwnPtr<GridSpan> resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const;
-    PassOwnPtr<GridSpan> resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const;
-    PassOwnPtr<GridSpan> resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const;
+    std::unique_ptr<GridSpan> resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const;
+    std::unique_ptr<GridSpan> resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const;
+    std::unique_ptr<GridSpan> resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const;
+    std::unique_ptr<GridSpan> resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const;
 
     LayoutUnit gridAreaBreadthForChild(const RenderBox* child, GridTrackSizingDirection, const Vector<GridTrack>&) const;
 
index 519808f..f182d33 100644 (file)
@@ -29,7 +29,6 @@
 #include "CachedImage.h"
 #include "CachedResourceHandle.h"
 #include "StyleImage.h"
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
index 004bcbe..de68e7b 100644 (file)
@@ -617,8 +617,8 @@ void RenderLayer::updateDescendantsAreContiguousInStackingOrder()
     ASSERT(!m_normalFlowListDirty);
     ASSERT(!m_zOrderListsDirty);
 
-    OwnPtr<Vector<RenderLayer*>> posZOrderList;
-    OwnPtr<Vector<RenderLayer*>> negZOrderList;
+    std::unique_ptr<Vector<RenderLayer*>> posZOrderList;
+    std::unique_ptr<Vector<RenderLayer*>> negZOrderList;
     rebuildZOrderLists(StopAtStackingContexts, posZOrderList, negZOrderList);
 
     // Create a reverse lookup.
@@ -864,12 +864,12 @@ void RenderLayer::updateTransform()
     bool hasTransform = renderer().hasTransform() && renderer().style().hasTransform();
     bool had3DTransform = has3DTransform();
 
-    bool hadTransform = m_transform;
+    bool hadTransform = !!m_transform;
     if (hasTransform != hadTransform) {
         if (hasTransform)
-            m_transform = adoptPtr(new TransformationMatrix);
+            m_transform = std::make_unique<TransformationMatrix>();
         else
-            m_transform.clear();
+            m_transform = nullptr;
         
         // Layers with transforms act as clip rects roots, so clear the cached clip rects here.
         clearClipRectsIncludingDescendants();
@@ -3927,7 +3927,7 @@ bool RenderLayer::setupClipPath(GraphicsContext* context, const LayerPaintingInf
 
 #if ENABLE(CSS_FILTERS)
 
-PassOwnPtr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext* context, LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed)
+std::unique_ptr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext* context, LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed)
 {
     if (context->paintingDisabled())
         return nullptr;
@@ -3940,7 +3940,7 @@ PassOwnPtr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext
     if (!hasPaintedFilter)
         return nullptr;
 
-    OwnPtr<FilterEffectRendererHelper> filterPainter = adoptPtr(new FilterEffectRendererHelper(hasPaintedFilter));
+    auto filterPainter = std::make_unique<FilterEffectRendererHelper>(hasPaintedFilter);
     if (!filterPainter->haveFilterEffect())
         return nullptr;
     
@@ -3967,7 +3967,7 @@ PassOwnPtr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext
         // Otherwise, if for example this layer has overflow:hidden, a drop shadow will not compute correctly.
         // Note that we will still apply the clipping on the final rendering of the filter.
         paintingInfo.clipToDirtyRect = !filterInfo->renderer()->hasFilterThatMovesPixels();
-        return filterPainter.release();
+        return std::move(filterPainter);
     }
     return nullptr;
 }
@@ -4072,7 +4072,7 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
 
     GraphicsContext* transparencyLayerContext = context;
 #if ENABLE(CSS_FILTERS)
-    OwnPtr<FilterEffectRendererHelper> filterPainter = setupFilters(context, localPaintingInfo, paintFlags, offsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
+    std::unique_ptr<FilterEffectRendererHelper> filterPainter = setupFilters(context, localPaintingInfo, paintFlags, offsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
     if (filterPainter) {
         context = filterPainter->filterContext();
         if (context != transparencyLayerContext && haveTransparency) {
@@ -4160,7 +4160,7 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
 #if ENABLE(CSS_FILTERS)
     if (filterPainter) {
         context = applyFilters(filterPainter.get(), transparencyLayerContext, localPaintingInfo, layerFragments);
-        filterPainter.clear();
+        filterPainter = nullptr;
     }
 #endif
     
@@ -4577,16 +4577,16 @@ void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsCo
                 TransformationMatrix newTransform(oldTransform);
                 newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height()));
                 
-                childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));
+                childLayer->m_transform = std::make_unique<TransformationMatrix>(newTransform);
                 
                 LayerPaintingInfo localPaintingInfo(paintingInfo);
                 localPaintingInfo.paintDirtyRect = localDirtyRect;
                 childLayer->paintLayer(context, localPaintingInfo, paintFlags);
 
                 if (oldHasTransform)
-                    childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));
+                    childLayer->m_transform = std::make_unique<TransformationMatrix>(oldTransform);
                 else
-                    childLayer->m_transform.clear();
+                    childLayer->m_transform = nullptr;
             } else {
                 // Adjust the transform such that the renderer's upper left corner will paint at (0,0) in user space.
                 // This involves subtracting out the position of the layer in our current coordinate space.
@@ -5231,12 +5231,12 @@ RenderLayer* RenderLayer::hitTestChildLayerColumns(RenderLayer* childLayer, Rend
                 TransformationMatrix newTransform(oldTransform);
                 newTransform.translateRight(offset.width(), offset.height());
 
-                childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));
+                childLayer->m_transform = std::make_unique<TransformationMatrix>(newTransform);
                 hitLayer = childLayer->hitTestLayer(rootLayer, columnLayers[0], request, result, localClipRect, hitTestLocation, false, transformState, zOffset);
                 if (oldHasTransform)
-                    childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));
+                    childLayer->m_transform = std::make_unique<TransformationMatrix>(oldTransform);
                 else
-                    childLayer->m_transform.clear();
+                    childLayer->m_transform = nullptr;
             } else {
                 // Adjust the transform such that the renderer's upper left corner will be at (0,0) in user space.
                 // This involves subtracting out the position of the layer in our current coordinate space.
@@ -5294,7 +5294,7 @@ void RenderLayer::updateClipRects(const ClipRectsContext& clipRectsContext)
     calculateClipRects(clipRectsContext, clipRects);
 
     if (!m_clipRectsCache)
-        m_clipRectsCache = adoptPtr(new ClipRectsCache);
+        m_clipRectsCache = std::make_unique<ClipRectsCache>();
 
     if (parentLayer && parentLayer->clipRects(clipRectsContext) && clipRects == *parentLayer->clipRects(clipRectsContext))
         m_clipRectsCache->setClipRects(clipRectsType, clipRectsContext.respectOverflowClip, parentLayer->clipRects(clipRectsContext));
@@ -5924,7 +5924,7 @@ void RenderLayer::clearClipRects(ClipRectsType typeToClear)
 RenderLayerBacking* RenderLayer::ensureBacking()
 {
     if (!m_backing) {
-        m_backing = adoptPtr(new RenderLayerBacking(*this));
+        m_backing = std::make_unique<RenderLayerBacking>(*this);
         compositor().layerBecameComposited(*this);
 
 #if ENABLE(CSS_FILTERS)
@@ -5941,7 +5941,7 @@ void RenderLayer::clearBacking(bool layerBeingDestroyed)
 {
     if (m_backing && !renderer().documentBeingDestroyed())
         compositor().layerBecameNonComposited(*this);
-    m_backing.clear();
+    m_backing = nullptr;
 
 #if ENABLE(CSS_FILTERS)
     if (!layerBeingDestroyed)
@@ -6115,7 +6115,7 @@ void RenderLayer::rebuildZOrderLists()
     m_zOrderListsDirty = false;
 }
 
-void RenderLayer::rebuildZOrderLists(CollectLayersBehavior behavior, OwnPtr<Vector<RenderLayer*>>& posZOrderList, OwnPtr<Vector<RenderLayer*>>& negZOrderList)
+void RenderLayer::rebuildZOrderLists(CollectLayersBehavior behavior, std::unique_ptr<Vector<RenderLayer*>>& posZOrderList, std::unique_ptr<Vector<RenderLayer*>>& negZOrderList)
 {
     bool includeHiddenLayers = compositor().inCompositingMode();
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
@@ -6141,7 +6141,7 @@ void RenderLayer::updateNormalFlowList()
         // Ignore non-overflow layers and reflections.
         if (child->isNormalFlowOnly() && (!m_reflection || reflectionLayer() != child)) {
             if (!m_normalFlowList)
-                m_normalFlowList = adoptPtr(new Vector<RenderLayer*>);
+                m_normalFlowList = std::make_unique<Vector<RenderLayer*>>();
             m_normalFlowList->append(child);
         }
     }
@@ -6149,7 +6149,7 @@ void RenderLayer::updateNormalFlowList()
     m_normalFlowListDirty = false;
 }
 
-void RenderLayer::collectLayers(bool includeHiddenLayers, CollectLayersBehavior behavior, OwnPtr<Vector<RenderLayer*>>& posBuffer, OwnPtr<Vector<RenderLayer*>>& negBuffer)
+void RenderLayer::collectLayers(bool includeHiddenLayers, CollectLayersBehavior behavior, std::unique_ptr<Vector<RenderLayer*>>& posBuffer, std::unique_ptr<Vector<RenderLayer*>>& negBuffer)
 {
     updateDescendantDependentFlags();
 
@@ -6158,11 +6158,11 @@ void RenderLayer::collectLayers(bool includeHiddenLayers, CollectLayersBehavior
     bool includeHiddenLayer = includeHiddenLayers || (m_hasVisibleContent || (m_hasVisibleDescendant && isStacking));
     if (includeHiddenLayer && !isNormalFlowOnly()) {
         // Determine which buffer the child should be in.
-        OwnPtr<Vector<RenderLayer*>>& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
+        std::unique_ptr<Vector<RenderLayer*>>& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;
 
         // Create the buffer if it doesn't exist yet.
         if (!buffer)
-            buffer = adoptPtr(new Vector<RenderLayer*>);
+            buffer = std::make_unique<Vector<RenderLayer*>>();
         
         // Append ourselves at the end of the appropriate buffer.
         buffer->append(this);
@@ -6551,11 +6551,11 @@ void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
 
     if (renderer().style().overflowX() == OMARQUEE && renderer().style().marqueeBehavior() != MNONE && renderer().isBox()) {
         if (!m_marquee)
-            m_marquee = adoptPtr(new RenderMarquee(this));
+            m_marquee = std::make_unique<RenderMarquee>(this);
         m_marquee->updateMarqueeStyle();
     }
     else if (m_marquee) {
-        m_marquee.clear();
+        m_marquee = nullptr;
     }
 
     updateScrollbarsAfterStyleChange(oldStyle);
index b7071c2..4811a03 100644 (file)
@@ -49,7 +49,7 @@
 #include "RenderBox.h"
 #include "RenderPtr.h"
 #include "ScrollableArea.h"
-#include <wtf/OwnPtr.h>
+#include <memory>
 
 namespace WebCore {
 
@@ -902,7 +902,7 @@ private:
 
     void updateZOrderLists();
     void rebuildZOrderLists();
-    void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*>>&, OwnPtr<Vector<RenderLayer*>>&);
+    void rebuildZOrderLists(CollectLayersBehavior, std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&);
     void clearZOrderLists();
 
     void updateNormalFlowList();
@@ -970,7 +970,7 @@ private:
 
     LayoutPoint renderBoxLocation() const { return renderer().isBox() ? toRenderBox(renderer()).location() : LayoutPoint(); }
 
-    void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<Vector<RenderLayer*>>&, OwnPtr<Vector<RenderLayer*>>&);
+    void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&);
 
     void updateCompositingAndLayerListsIfNeeded();
 
@@ -998,7 +998,7 @@ private:
     bool setupFontSubpixelQuantization(GraphicsContext*, bool& didQuantizeFonts);
     bool setupClipPath(GraphicsContext*, const LayerPaintingInfo&, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed);
 #if ENABLE(CSS_FILTERS)
-    PassOwnPtr<FilterEffectRendererHelper> setupFilters(GraphicsContext*, LayerPaintingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed);
+    std::unique_ptr<FilterEffectRendererHelper> setupFilters(GraphicsContext*, LayerPaintingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed);
     GraphicsContext* applyFilters(FilterEffectRendererHelper*, GraphicsContext* originalContext, LayerPaintingInfo&, LayerFragments&);
 #endif
 
@@ -1325,24 +1325,24 @@ private:
     // descendant layers within the stacking context that have z-indices of 0 or greater
     // (auto will count as 0).  m_negZOrderList holds descendants within our stacking context with negative
     // z-indices.
-    OwnPtr<Vector<RenderLayer*>> m_posZOrderList;
-    OwnPtr<Vector<RenderLayer*>> m_negZOrderList;
+    std::unique_ptr<Vector<RenderLayer*>> m_posZOrderList;
+    std::unique_ptr<Vector<RenderLayer*>> m_negZOrderList;
 
     // This list contains child layers that cannot create stacking contexts.  For now it is just
     // overflow layers, but that may change in the future.
-    OwnPtr<Vector<RenderLayer*>> m_normalFlowList;
+    std::unique_ptr<Vector<RenderLayer*>> m_normalFlowList;
 
-    OwnPtr<ClipRectsCache> m_clipRectsCache;
+    std::unique_ptr<ClipRectsCache> m_clipRectsCache;
     
     IntPoint m_cachedOverlayScrollbarOffset;
 
-    OwnPtr<RenderMarquee> m_marquee; // Used by layers with overflow:marquee
+    std::unique_ptr<RenderMarquee> m_marquee; // Used by layers with overflow:marquee
     
     // Cached normal flow values for absolute positioned elements with static left/top values.
     LayoutUnit m_staticInlinePosition;
     LayoutUnit m_staticBlockPosition;
 
-    OwnPtr<TransformationMatrix> m_transform;
+    std::unique_ptr<TransformationMatrix> m_transform;
     
     // May ultimately be extended to many replicas (with their own paint order).
     RenderPtr<RenderReplica> m_reflection;
@@ -1356,7 +1356,7 @@ private:
 
     IntRect m_blockSelectionGapsBounds;
 
-    OwnPtr<RenderLayerBacking> m_backing;
+    std::unique_ptr<RenderLayerBacking> m_backing;
 
     class FilterInfo;
 };
@@ -1365,8 +1365,8 @@ inline void RenderLayer::clearZOrderLists()
 {
     ASSERT(!isStackingContainer());
 
-    m_posZOrderList.clear();
-    m_negZOrderList.clear();
+    m_posZOrderList = nullptr;
+    m_negZOrderList = nullptr;
 }
 
 inline void RenderLayer::updateZOrderLists()
index 12edc86..e8d1670 100644 (file)
@@ -536,7 +536,7 @@ void RenderLayerCompositor::notifyFlushBeforeDisplayRefresh(const GraphicsLayer*
         if (Page* page = this->page())
             displayID = page->chrome().displayID();
 
-        m_layerUpdater = adoptPtr(new GraphicsLayerUpdater(this, displayID));
+        m_layerUpdater = std::make_unique<GraphicsLayerUpdater>(this, displayID);
     }
     
     m_layerUpdater->scheduleUpdate();
@@ -3542,7 +3542,7 @@ void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer)
 }
 
 #if PLATFORM(IOS)
-typedef HashMap<PlatformLayer*, OwnPtr<ViewportConstraints>> LayerMap;
+typedef HashMap<PlatformLayer*, std::unique_ptr<ViewportConstraints>> LayerMap;
 typedef HashMap<PlatformLayer*, PlatformLayer*> StickyContainerMap;
 
 void RenderLayerCompositor::registerAllViewportConstrainedLayers()
@@ -3574,7 +3574,7 @@ void RenderLayerCompositor::registerAllViewportConstrainedLayers()
         else
             continue;
 
-        layerMap.add(layer.backing()->graphicsLayer()->platformLayer(), adoptPtr(constraints.release()));
+        layerMap.add(layer.backing()->graphicsLayer()->platformLayer(), std::move(constraints));
     }
     
     if (ChromeClient* client = this->chromeClient())
index ca2c1dd..c208b81 100644 (file)
@@ -501,7 +501,7 @@ private:
     std::unique_ptr<GraphicsLayer> m_layerForFooter;
 #endif
 
-    OwnPtr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.
+    std::unique_ptr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.
 
     Timer<RenderLayerCompositor> m_layerFlushTimer;
     bool m_layerFlushThrottlingEnabled;
index 7414e5b..397eafe 100644 (file)
@@ -43,9 +43,9 @@
 
 namespace WebCore {
 
-HashMap<const RenderLayer*, OwnPtr<RenderLayer::FilterInfo>>& RenderLayer::FilterInfo::map()
+HashMap<const RenderLayer*, std::unique_ptr<RenderLayer::FilterInfo>>& RenderLayer::FilterInfo::map()
 {
-    static NeverDestroyed<HashMap<const RenderLayer*, OwnPtr<FilterInfo>>> map;
+    static NeverDestroyed<HashMap<const RenderLayer*, std::unique_ptr<FilterInfo>>> map;
     return map;
 }
 
@@ -60,9 +60,9 @@ RenderLayer::FilterInfo& RenderLayer::FilterInfo::get(RenderLayer& layer)
 {
     ASSERT(layer.m_hasFilterInfo == map().contains(&layer));
 
-    OwnPtr<FilterInfo>& info = map().add(&layer, nullptr).iterator->value;
+    auto& info = map().add(&layer, nullptr).iterator->value;
     if (!info) {
-        info = adoptPtr(new FilterInfo(layer));
+        info = std::make_unique<FilterInfo>(layer);
         layer.m_hasFilterInfo = true;
     }
     return *info;
index 229ab19..0eb3353 100644 (file)
@@ -36,6 +36,7 @@
 #include "CachedResourceHandle.h"
 #include "CachedSVGDocumentClient.h"
 #include "RenderLayer.h"
+#include <memory>
 
 namespace WebCore {
 
@@ -48,6 +49,9 @@ public:
     static FilterInfo* getIfExists(const RenderLayer&);
     static void remove(RenderLayer&);
 
+    explicit FilterInfo(RenderLayer&);
+    ~FilterInfo();
+
     const LayoutRect& dirtySourceRect() const { return m_dirtySourceRect; }
     void expandDirtySourceRect(const LayoutRect& rect) { m_dirtySourceRect.unite(rect); }
     void resetDirtySourceRect() { m_dirtySourceRect = LayoutRect(); }
@@ -59,16 +63,13 @@ public:
     void removeReferenceFilterClients();
 
 private:
-    explicit FilterInfo(RenderLayer&);
-    ~FilterInfo();
-
     Element* layerElement() const;
 
     friend void WTF::deleteOwnedPtr<FilterInfo>(FilterInfo*);
 
     virtual void notifyFinished(CachedResource*) override;
 
-    static HashMap<const RenderLayer*, OwnPtr<FilterInfo>>& map();
+    static HashMap<const RenderLayer*, std::unique_ptr<FilterInfo>>& map();
 
 #if PLATFORM(IOS)
 #pragma clang diagnostic push
index 3a7abcd..e0e7c8a 100644 (file)
@@ -334,11 +334,11 @@ RenderBoxRegionInfo* RenderRegion::setRenderBoxRegionInfo(const RenderBox* box,
 {
     ASSERT(isValid());
 
-    OwnPtr<RenderBoxRegionInfo>& boxInfo = m_renderBoxRegionInfo.add(box, adoptPtr(new RenderBoxRegionInfo(logicalLeftInset, logicalRightInset, containingBlockChainIsInset))).iterator->value;
+    std::unique_ptr<RenderBoxRegionInfo>& boxInfo = m_renderBoxRegionInfo.add(box, std::make_unique<RenderBoxRegionInfo>(logicalLeftInset, logicalRightInset, containingBlockChainIsInset)).iterator->value;
     return boxInfo.get();
 }
 
-OwnPtr<RenderBoxRegionInfo> RenderRegion::takeRenderBoxRegionInfo(const RenderBox* box)
+std::unique_ptr<RenderBoxRegionInfo> RenderRegion::takeRenderBoxRegionInfo(const RenderBox* box)
 {
     return m_renderBoxRegionInfo.take(box);
 }
index e128ebd..e3c7023 100644 (file)
@@ -33,6 +33,7 @@
 #include "RenderBlockFlow.h"
 #include "StyleInheritedData.h"
 #include "VisiblePosition.h"
+#include <memory>
 
 namespace WebCore {
 
@@ -70,7 +71,7 @@ public:
     RenderBoxRegionInfo* renderBoxRegionInfo(const RenderBox*) const;
     RenderBoxRegionInfo* setRenderBoxRegionInfo(const RenderBox*, LayoutUnit logicalLeftInset, LayoutUnit logicalRightInset,
         bool containingBlockChainIsInset);
-    OwnPtr<RenderBoxRegionInfo> takeRenderBoxRegionInfo(const RenderBox*);
+    std::unique_ptr<RenderBoxRegionInfo> takeRenderBoxRegionInfo(const RenderBox*);
     void removeRenderBoxRegionInfo(const RenderBox*);
 
     void deleteAllRenderBoxRegionInfo();
@@ -172,7 +173,7 @@ private:
     // A RenderBoxRegionInfo* tells us about any layout information for a RenderBox that
     // is unique to the region. For now it just holds logical width information for RenderBlocks, but eventually
     // it will also hold a custom style for any box (for region styling).
-    typedef HashMap<const RenderBox*, OwnPtr<RenderBoxRegionInfo>> RenderBoxRegionInfoMap;
+    typedef HashMap<const RenderBox*, std::unique_ptr<RenderBoxRegionInfo>> RenderBoxRegionInfoMap;
     RenderBoxRegionInfoMap m_renderBoxRegionInfo;
 
     bool m_isValid : 1;
index 5d0afb2..6f57db1 100644 (file)
@@ -113,9 +113,9 @@ void RenderTable::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
         // According to the CSS2 spec, you only use fixed table layout if an
         // explicit width is specified on the table.  Auto width implies auto table layout.
         if (style().tableLayout() == TFIXED && !style().logicalWidth().isAuto())
-            m_tableLayout = adoptPtr(new FixedTableLayout(this));
+            m_tableLayout = std::make_unique<FixedTableLayout>(this);
         else
-            m_tableLayout = adoptPtr(new AutoTableLayout(this));
+            m_tableLayout = std::make_unique<AutoTableLayout>(this);
     }
 
     // If border was changed, invalidate collapsed borders cache.
index 09e0bd8..3f4bb8a 100644 (file)
@@ -28,6 +28,7 @@
 #include "CSSPropertyNames.h"
 #include "CollapsedBorderValue.h"
 #include "RenderBlock.h"
+#include <memory>
 #include <wtf/HashMap.h>
 #include <wtf/Vector.h>
 
@@ -340,7 +341,7 @@ private:
     mutable RenderTableSection* m_foot;
     mutable RenderTableSection* m_firstBody;
 
-    OwnPtr<TableLayout> m_tableLayout;
+    std::unique_ptr<TableLayout> m_tableLayout;
 
     CollapsedBorderValues m_collapsedBorders;
     const CollapsedBorderValue* m_currentBorder;
index 9d25bc9..d556a55 100644 (file)
@@ -659,7 +659,7 @@ static RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset
 
 IntRect RenderView::selectionBounds(bool clipToVisibleContent) const
 {
-    typedef HashMap<RenderObject*, OwnPtr<RenderSelectionInfo>> SelectionMap;
+    typedef HashMap<RenderObject*, std::unique_ptr<RenderSelectionInfo>> SelectionMap;
     SelectionMap selectedObjects;
 
     RenderObject* os = m_selectionStart;
@@ -667,13 +667,13 @@ IntRect RenderView::selectionBounds(bool clipToVisibleContent) const
     while (os && os != stop) {
         if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
             // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well.
-            selectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, clipToVisibleContent)));
+            selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(os, clipToVisibleContent));
             RenderBlock* cb = os->containingBlock();
             while (cb && !cb->isRenderView()) {
-                OwnPtr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).iterator->value;
+                std::unique_ptr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).iterator->value;
                 if (blockInfo)
                     break;
-                blockInfo = adoptPtr(new RenderSelectionInfo(cb, clipToVisibleContent));
+                blockInfo = std::make_unique<RenderSelectionInfo>(cb, clipToVisibleContent);
                 cb = cb->containingBlock();
             }
         }
@@ -773,14 +773,14 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e
     int oldEndPos = m_selectionEndPos;
 
     // Objects each have a single selection rect to examine.
-    typedef HashMap<RenderObject*, OwnPtr<RenderSelectionInfo>> SelectedObjectMap;
+    typedef HashMap<RenderObject*, std::unique_ptr<RenderSelectionInfo>> SelectedObjectMap;
     SelectedObjectMap oldSelectedObjects;
     SelectedObjectMap newSelectedObjects;
 
     // Blocks contain selected objects and fill gaps between them, either on the left, right, or in between lines and blocks.
     // In order to get the repaint rect right, we have to examine left, middle, and right rects individually, since otherwise
     // the union of those rects might remain the same even when changes have occurred.
-    typedef HashMap<RenderBlock*, OwnPtr<RenderBlockSelectionInfo>> SelectedBlockMap;
+    typedef HashMap<RenderBlock*, std::unique_ptr<RenderBlockSelectionInfo>> SelectedBlockMap;
     SelectedBlockMap oldSelectedBlocks;
     SelectedBlockMap newSelectedBlocks;
 
@@ -791,14 +791,14 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e
     while (continueExploring) {
         if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
             // Blocks are responsible for painting line gaps and margin gaps.  They must be examined as well.
-            oldSelectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, true)));
+            oldSelectedObjects.set(os, std::make_unique<RenderSelectionInfo>(os, true));
             if (blockRepaintMode == RepaintNewXOROld) {
                 RenderBlock* cb = os->containingBlock();
                 while (cb && !cb->isRenderView()) {
-                    OwnPtr<RenderBlockSelectionInfo>& blockInfo = oldSelectedBlocks.add(cb, nullptr).iterator->value;
+                    std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = oldSelectedBlocks.add(cb, nullptr).iterator->value;
                     if (blockInfo)
                         break;
-                    blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb));
+                    blockInfo = std::make_unique<RenderBlockSelectionInfo>(cb);
                     cb = cb->containingBlock();
                 }
             }
@@ -847,13 +847,13 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e
     continueExploring = o && (o != stop);
     while (continueExploring) {
         if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionState() != SelectionNone) {
-            newSelectedObjects.set(o, adoptPtr(new RenderSelectionInfo(o, true)));
+            newSelectedObjects.set(o, std::make_unique<RenderSelectionInfo>(o, true));
             RenderBlock* cb = o->containingBlock();
             while (cb && !cb->isRenderView()) {
-                OwnPtr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks.add(cb, nullptr).iterator->value;
+                std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks.add(cb, nullptr).iterator->value;
                 if (blockInfo)
                     break;
-                blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb));
+                blockInfo = std::make_unique<RenderBlockSelectionInfo>(cb);
                 cb = cb->containingBlock();
             }
         }
@@ -1092,7 +1092,7 @@ bool RenderView::usesCompositing() const
 RenderLayerCompositor& RenderView::compositor()
 {
     if (!m_compositor)
-        m_compositor = adoptPtr(new RenderLayerCompositor(*this));
+        m_compositor = std::make_unique<RenderLayerCompositor>(*this);
 
     return *m_compositor;
 }
@@ -1123,7 +1123,7 @@ bool RenderView::checkTwoPassLayoutForAutoHeightRegions() const
 FlowThreadController& RenderView::flowThreadController()
 {
     if (!m_flowThreadController)
-        m_flowThreadController = FlowThreadController::create(this);
+        m_flowThreadController = std::make_unique<FlowThreadController>(this);
 
     return *m_flowThreadController;
 }
@@ -1162,7 +1162,7 @@ IntervalArena* RenderView::intervalArena()
 ImageQualityController& RenderView::imageQualityController()
 {
     if (!m_imageQualityController)
-        m_imageQualityController = ImageQualityController::create(*this);
+        m_imageQualityController = std::make_unique<ImageQualityController>(*this);
     return *m_imageQualityController;
 }
 
index 931b87e..b7bf11b 100644 (file)
@@ -27,8 +27,8 @@
 #include "PODFreeListArena.h"
 #include "Region.h"
 #include "RenderBlockFlow.h"
+#include <memory>
 #include <wtf/HashSet.h>
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
@@ -321,13 +321,13 @@ private:
 
     bool shouldUsePrintingLayout() const;
 
-    OwnPtr<ImageQualityController> m_imageQualityController;
+    std::unique_ptr<ImageQualityController> m_imageQualityController;
     LayoutUnit m_pageLogicalHeight;
     bool m_pageLogicalHeightChanged;
     std::unique_ptr<LayoutState> m_layoutState;
     unsigned m_layoutStateDisableCount;
-    OwnPtr<RenderLayerCompositor> m_compositor;
-    OwnPtr<FlowThreadController> m_flowThreadController;
+    std::unique_ptr<RenderLayerCompositor> m_compositor;
+    std::unique_ptr<FlowThreadController> m_flowThreadController;
     RefPtr<IntervalArena> m_intervalArena;
 
     RenderQuote* m_renderQuoteHead;
index 2043272..681a0ca 100644 (file)
@@ -142,7 +142,7 @@ public:
         if (m_floats)
             m_floats->append(&floatingBox);
         else
-            m_floats = adoptPtr(new Vector<RenderBox*>(1, &floatingBox));
+            m_floats = std::make_unique<Vector<RenderBox*>>(1, &floatingBox);
     }
 
     Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get(); }
@@ -219,7 +219,7 @@ private:
 
     // Floats hanging off the line are pushed into this vector during layout. It is only
     // good for as long as the line has not been marked dirty.
-    OwnPtr<Vector<RenderBox*>> m_floats;
+    std::unique_ptr<Vector<RenderBox*>> m_floats;
 };
 
 INLINE_BOX_OBJECT_TYPE_CASTS(RootInlineBox, isRootInlineBox())
index ee51689..bffd22c 100644 (file)
@@ -31,7 +31,6 @@
 #include "HTMLNames.h"
 #include "WritingMode.h"
 #include <wtf/Noncopyable.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
index aea01ce..fbb7e06 100644 (file)
@@ -126,9 +126,9 @@ static inline void snapVerticesToLayoutUnitGrid(Vector<FloatPoint>& vertices)
         vertices[i].set(LayoutUnit(vertices[i].x()).toFloat(), LayoutUnit(vertices[i].y()).toFloat());
 }
 
-static inline PassOwnPtr<FloatPolygon> computeShapeMarginBounds(const FloatPolygon& polygon, float margin, WindRule fillRule)
+static inline std::unique_ptr<FloatPolygon> computeShapeMarginBounds(const FloatPolygon& polygon, float margin, WindRule fillRule)
 {
-    OwnPtr<Vector<FloatPoint>> marginVertices = adoptPtr(new Vector<FloatPoint>());
+    auto marginVertices = std::make_unique<Vector<FloatPoint>>();
     FloatPoint intersection;
 
     for (unsigned i = 0; i < polygon.numberOfEdges(); ++i) {
@@ -144,7 +144,7 @@ static inline PassOwnPtr<FloatPolygon> computeShapeMarginBounds(const FloatPolyg
     }
 
     snapVerticesToLayoutUnitGrid(*marginVertices);
-    return adoptPtr(new FloatPolygon(marginVertices.release(), fillRule));
+    return std::make_unique<FloatPolygon>(std::move(marginVertices), fillRule);
 }
 
 
index 0e39917..3946260 100644 (file)
@@ -82,8 +82,8 @@ private:
 class PolygonShape : public Shape {
     WTF_MAKE_NONCOPYABLE(PolygonShape);
 public:
-    PolygonShape(PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule)
-        : m_polygon(vertices, fillRule)
+    PolygonShape(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule)
+        : m_polygon(std::move(vertices), fillRule)
         , m_marginBounds(nullptr)
     {
     }
@@ -98,7 +98,7 @@ private:
     const FloatPolygon& shapeMarginBounds() const;
 
     FloatPolygon m_polygon;
-    mutable OwnPtr<FloatPolygon> m_marginBounds;
+    mutable std::unique_ptr<FloatPolygon> m_marginBounds;
 };
 
 } // namespace WebCore
index 3a72fd7..b0e9401 100644 (file)
@@ -163,10 +163,10 @@ void RasterShapeIntervals::getExcludedIntervals(int y1, int y2, IntShapeInterval
     }
 }
 
-PassOwnPtr<RasterShapeIntervals> RasterShapeIntervals::computeShapeMarginIntervals(int shapeMargin) const
+std::unique_ptr<RasterShapeIntervals> RasterShapeIntervals::computeShapeMarginIntervals(int shapeMargin) const
 {
     int marginIntervalsSize = (offset() > shapeMargin) ? size() : size() - offset() * 2 + shapeMargin * 2;
-    OwnPtr<RasterShapeIntervals> result = adoptPtr(new RasterShapeIntervals(marginIntervalsSize, std::max(shapeMargin, offset())));
+    auto result = std::make_unique<RasterShapeIntervals>(marginIntervalsSize, std::max(shapeMargin, offset()));
     MarginIntervalGenerator marginIntervalGenerator(shapeMargin);
 
     for (int y = bounds().y(); y < bounds().maxY(); ++y) {
@@ -193,7 +193,7 @@ PassOwnPtr<RasterShapeIntervals> RasterShapeIntervals::computeShapeMarginInterva
         }
     }
 
-    return result.release();
+    return result;
 }
 
 void RasterShapeIntervals::buildBoundsPath(Path& path) const
index c7c26a8..d07ccdc 100644 (file)
@@ -52,7 +52,7 @@ public:
 
     void getExcludedIntervals(int y1, int y2, IntShapeIntervals& result) const;
 
-    PassOwnPtr<RasterShapeIntervals> computeShapeMarginIntervals(int shapeMargin) const;
+    std::unique_ptr<RasterShapeIntervals> computeShapeMarginIntervals(int shapeMargin) const;
 
     void buildBoundsPath(Path&) const;
 
@@ -91,8 +91,8 @@ private:
 class RasterShape : public Shape {
     WTF_MAKE_NONCOPYABLE(RasterShape);
 public:
-    RasterShape(PassOwnPtr<RasterShapeIntervals> intervals, const IntSize& marginRectSize)
-        : m_intervals(intervals)
+    RasterShape(std::unique_ptr<RasterShapeIntervals> intervals, const IntSize& marginRectSize)
+        : m_intervals(std::move(intervals))
         , m_marginRectSize(marginRectSize)
     {
     }
@@ -111,8 +111,8 @@ public:
 private:
     const RasterShapeIntervals& marginIntervals() const;
 
-    OwnPtr<RasterShapeIntervals> m_intervals;
-    mutable OwnPtr<RasterShapeIntervals> m_marginIntervals;
+    std::unique_ptr<RasterShapeIntervals> m_intervals;
+    mutable std::unique_ptr<RasterShapeIntervals> m_marginIntervals;
     IntSize m_marginRectSize;
 };
 
index 0f6dc42..cdd88a0 100644 (file)
 #include "RectangleShape.h"
 #include "WindRule.h"
 #include <wtf/MathExtras.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
-static PassOwnPtr<Shape> createInsetShape(const FloatRoundedRect& bounds)
+static std::unique_ptr<Shape> createInsetShape(const FloatRoundedRect& bounds)
 {
     ASSERT(bounds.rect().width() >= 0 && bounds.rect().height() >= 0);
-    return adoptPtr(new BoxShape(bounds));
+    return std::make_unique<BoxShape>(bounds);
 }
 
-static PassOwnPtr<Shape> createCircleShape(const FloatPoint& center, float radius)
+static std::unique_ptr<Shape> createCircleShape(const FloatPoint& center, float radius)
 {
     ASSERT(radius >= 0);
-    return adoptPtr(new RectangleShape(FloatRect(center.x() - radius, center.y() - radius, radius*2, radius*2), FloatSize(radius, radius)));
+    return std::make_unique<RectangleShape>(FloatRect(center.x() - radius, center.y() - radius, radius*2, radius*2), FloatSize(radius, radius));
 }
 
-static PassOwnPtr<Shape> createEllipseShape(const FloatPoint& center, const FloatSize& radii)
+static std::unique_ptr<Shape> createEllipseShape(const FloatPoint& center, const FloatSize& radii)
 {
     ASSERT(radii.width() >= 0 && radii.height() >= 0);
-    return adoptPtr(new RectangleShape(FloatRect(center.x() - radii.width(), center.y() - radii.height(), radii.width()*2, radii.height()*2), radii));
+    return std::make_unique<RectangleShape>(FloatRect(center.x() - radii.width(), center.y() - radii.height(), radii.width()*2, radii.height()*2), radii);
 }
 
-static PassOwnPtr<Shape> createPolygonShape(PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule)
+static std::unique_ptr<Shape> createPolygonShape(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule)
 {
-    return adoptPtr(new PolygonShape(vertices, fillRule));
+    return std::make_unique<PolygonShape>(std::move(vertices), fillRule);
 }
 
 static inline FloatRect physicalRectToLogical(const FloatRect& rect, float logicalBoxHeight, WritingMode writingMode)
@@ -94,14 +92,14 @@ static inline FloatSize physicalSizeToLogical(const FloatSize& size, WritingMode
     return size.transposedSize();
 }
 
-PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, Length margin)
+std::unique_ptr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, Length margin)
 {
     ASSERT(basicShape);
 
     bool horizontalWritingMode = isHorizontalWritingMode(writingMode);
     float boxWidth = horizontalWritingMode ? logicalBoxSize.width() : logicalBoxSize.height();
     float boxHeight = horizontalWritingMode ? logicalBoxSize.height() : logicalBoxSize.width();
-    OwnPtr<Shape> shape;
+    std::unique_ptr<Shape> shape;
 
     switch (basicShape->type()) {
 
@@ -133,7 +131,7 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
         const Vector<Length>& values = polygon.values();
         size_t valuesSize = values.size();
         ASSERT(!(valuesSize % 2));
-        OwnPtr<Vector<FloatPoint>> vertices = adoptPtr(new Vector<FloatPoint>(valuesSize / 2));
+        std::unique_ptr<Vector<FloatPoint>> vertices = std::make_unique<Vector<FloatPoint>>(valuesSize / 2);
         for (unsigned i = 0; i < valuesSize; i += 2) {
             FloatPoint vertex(
                 floatValueForLength(values.at(i), boxWidth),
@@ -141,7 +139,7 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
             (*vertices)[i / 2] = physicalPointToLogical(vertex, logicalBoxSize.height(), writingMode);
         }
 
-        shape = createPolygonShape(vertices.release(), polygon.windRule());
+        shape = createPolygonShape(std::move(vertices), polygon.windRule());
         break;
     }
 
@@ -175,14 +173,14 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
     shape->m_writingMode = writingMode;
     shape->m_margin = floatValueForLength(margin, 0);
 
-    return shape.release();
+    return shape;
 }
 
-PassOwnPtr<Shape> Shape::createRasterShape(Image* image, float threshold, const LayoutRect& imageR, const LayoutRect& marginR, WritingMode writingMode, Length margin)
+std::unique_ptr<Shape> Shape::createRasterShape(Image* image, float threshold, const LayoutRect& imageR, const LayoutRect& marginR, WritingMode writingMode, Length margin)
 {
     IntRect imageRect = pixelSnappedIntRect(imageR);
     IntRect marginRect = pixelSnappedIntRect(marginR);
-    OwnPtr<RasterShapeIntervals> intervals = adoptPtr(new RasterShapeIntervals(marginRect.height(), -marginRect.y()));
+    auto intervals = std::make_unique<RasterShapeIntervals>(marginRect.height(), -marginRect.y());
     std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.size());
 
     if (imageBuffer) {
@@ -214,23 +212,23 @@ PassOwnPtr<Shape> Shape::createRasterShape(Image* image, float threshold, const
         }
     }
 
-    OwnPtr<RasterShape> rasterShape = adoptPtr(new RasterShape(intervals.release(), marginRect.size()));
+    auto rasterShape = std::make_unique<RasterShape>(std::move(intervals), marginRect.size());
     rasterShape->m_writingMode = writingMode;
     rasterShape->m_margin = floatValueForLength(margin, 0);
-    return rasterShape.release();
+    return std::move(rasterShape);
 }
 
-PassOwnPtr<Shape> Shape::createBoxShape(const RoundedRect& roundedRect, WritingMode writingMode, Length margin)
+std::unique_ptr<Shape> Shape::createBoxShape(const RoundedRect& roundedRect, WritingMode writingMode, Length margin)
 {
     ASSERT(roundedRect.rect().width() >= 0 && roundedRect.rect().height() >= 0);
 
     FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height());
     FloatRoundedRect bounds(rect, roundedRect.radii());
-    OwnPtr<Shape> shape = adoptPtr(new BoxShape(bounds));
+    auto shape = std::make_unique<BoxShape>(bounds);
     shape->m_writingMode = writingMode;
     shape->m_margin = floatValueForLength(margin, 0);
 
-    return shape.release();
+    return std::move(shape);
 }
 
 } // namespace WebCore
index d2c5100..e08574a 100644 (file)
@@ -36,7 +36,7 @@
 #include "RoundedRect.h"
 #include "StyleImage.h"
 #include "WritingMode.h"
-#include <wtf/PassOwnPtr.h>
+#include <memory>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -67,9 +67,9 @@ public:
         Path marginShape;
     };
 
-    static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, Length margin);
-    static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& imageRect, const LayoutRect& marginRect, WritingMode, Length margin);
-    static PassOwnPtr<Shape> createBoxShape(const RoundedRect&, WritingMode, Length margin);
+    static std::unique_ptr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, Length margin);
+    static std::unique_ptr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& imageRect, const LayoutRect& marginRect, WritingMode, Length margin);
+    static std::unique_ptr<Shape> createBoxShape(const RoundedRect&, WritingMode, Length margin);
 
     virtual ~Shape() { }
 
index 78c3ba4..cc3e343 100644 (file)
@@ -37,7 +37,7 @@
 #include "RenderStyle.h"
 #include "Shape.h"
 #include "ShapeValue.h"
-#include <wtf/OwnPtr.h>
+#include <memory>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -90,8 +90,8 @@ public:
 
     virtual bool lineOverlapsShapeBounds() const = 0;
 
-    void markShapeAsDirty() { m_shape.clear(); }
-    bool isShapeDirty() { return !m_shape.get(); }
+    void markShapeAsDirty() { m_shape = nullptr; }
+    bool isShapeDirty() { return !m_shape; }
     const RenderType& owner() const { return m_renderer; }
     LayoutSize referenceBoxLogicalSize() const { return m_referenceBoxLogicalSize; }
 
@@ -148,7 +148,7 @@ protected:
     const RenderType& m_renderer;
 
 private:
-    mutable OwnPtr<Shape> m_shape;
+    mutable std::unique_ptr<Shape> m_shape;
     LayoutSize m_referenceBoxLogicalSize;
 };
 
index 05d00dc..bf369b6 100644 (file)
@@ -28,7 +28,6 @@
 #include "CounterContent.h"
 #include "StyleImage.h"
 #include "RenderPtr.h"
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
index 06d44dd..757b79d 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "config.h"
 #include "CounterDirectives.h"
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
@@ -33,11 +32,11 @@ bool operator==(const CounterDirectives& a, const CounterDirectives& b)
       && a.resetValue() == b.resetValue();
 }
 
-PassOwnPtr<CounterDirectiveMap> clone(const CounterDirectiveMap& counterDirectives)
+std::unique_ptr<CounterDirectiveMap> clone(const CounterDirectiveMap& counterDirectives)
 {
-    OwnPtr<CounterDirectiveMap> result = adoptPtr(new CounterDirectiveMap);
+    auto result = std::make_unique<CounterDirectiveMap>();
     *result = counterDirectives;
-    return result.release();
+    return std::move(result);
 }
 
 } // namespace WebCore
index cf793bb..d5de076 100644 (file)
@@ -25,6 +25,7 @@
 #ifndef CounterDirectives_h
 #define CounterDirectives_h
 
+#include <memory>
 #include <wtf/HashMap.h>
 #include <wtf/MathExtras.h>
 #include <wtf/RefPtr.h>
@@ -104,7 +105,7 @@ inline bool operator!=(const CounterDirectives& a, const CounterDirectives& b) {
 
 typedef HashMap<AtomicString, CounterDirectives> CounterDirectiveMap;
 
-PassOwnPtr<CounterDirectiveMap> clone(const CounterDirectiveMap&);
+std::unique_ptr<CounterDirectiveMap> clone(const CounterDirectiveMap&);
 
 } // namespace WebCore
 
index 6b8f15f..44d200b 100644 (file)
@@ -35,7 +35,6 @@
 #if ENABLE(CSS_GRID_LAYOUT)
 
 #include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -45,11 +44,6 @@ namespace WebCore {
 // span should include both |initialPositionIndex| and |finalPositionIndex| to be correct.
 class GridSpan {
 public:
-    static PassOwnPtr<GridSpan> create(size_t initialPosition, size_t finalPosition)
-    {
-        return adoptPtr(new GridSpan(initialPosition, finalPosition));
-    }
-
     GridSpan(size_t initialPosition, size_t finalPosition)
         : initialPositionIndex(initialPosition)
         , finalPositionIndex(finalPosition)
index ab2074b..8e13c65 100644 (file)
@@ -260,7 +260,7 @@ RenderStyle* RenderStyle::addCachedPseudoStyle(PassRefPtr<RenderStyle> pseudo)
     RenderStyle* result = pseudo.get();
 
     if (!m_cachedPseudoStyles)
-        m_cachedPseudoStyles = adoptPtr(new PseudoStyleCache);
+        m_cachedPseudoStyles = std::make_unique<PseudoStyleCache>();
 
     m_cachedPseudoStyles->append(pseudo);
 
@@ -1113,9 +1113,9 @@ const CounterDirectiveMap* RenderStyle::counterDirectives() const
 
 CounterDirectiveMap& RenderStyle::accessCounterDirectives()
 {
-    OwnPtr<CounterDirectiveMap>& map = rareNonInheritedData.access()->m_counterDirectives;
+    auto& map = rareNonInheritedData.access()->m_counterDirectives;
     if (!map)
-        map = adoptPtr(new CounterDirectiveMap);
+        map = std::make_unique<CounterDirectiveMap>();
     return *map;
 }
 
@@ -1269,14 +1269,14 @@ void RenderStyle::adjustTransitions()
 AnimationList* RenderStyle::accessAnimations()
 {
     if (!rareNonInheritedData.access()->m_animations)
-        rareNonInheritedData.access()->m_animations = adoptPtr(new AnimationList());
+        rareNonInheritedData.access()->m_animations = std::make_unique<AnimationList>();
     return rareNonInheritedData->m_animations.get();
 }
 
 AnimationList* RenderStyle::accessTransitions()
 {
     if (!rareNonInheritedData.access()->m_transitions)
-        rareNonInheritedData.access()->m_transitions = adoptPtr(new AnimationList());
+        rareNonInheritedData.access()->m_transitions = std::make_unique<AnimationList>();
     return rareNonInheritedData->m_transitions.get();
 }
 
index e19e339..26a1125 100644 (file)
@@ -68,8 +68,8 @@
 #include "ThemeTypes.h"
 #include "TransformOperations.h"
 #include "UnicodeBidi.h"
+#include <memory>
 #include <wtf/Forward.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/Vector.h>
@@ -402,7 +402,7 @@ protected:
     DataRef<StyleInheritedData> inherited;
 
     // list of associated pseudo styles
-    OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;
+    std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles;
 
     DataRef<SVGRenderStyle> m_svgStyle;
 
@@ -1553,16 +1553,16 @@ public:
 
     void clearAnimations()
     {
-        rareNonInheritedData.access()->m_animations.clear();
+        rareNonInheritedData.access()->m_animations = nullptr;
     }
 
     void clearTransitions()
     {
-        rareNonInheritedData.access()->m_transitions.clear();
+        rareNonInheritedData.access()->m_transitions = nullptr;
     }
 
-    void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? adoptPtr(new AnimationList(*parent)) : nullptr; }
-    void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? adoptPtr(new AnimationList(*parent)) : nullptr; }
+    void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? std::make_unique<AnimationList>(*parent) : nullptr; }
+    void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? std::make_unique<AnimationList>(*parent) : nullptr; }
     void adjustAnimations();
     void adjustTransitions();
 
index d3018dc..80a7cae 100644 (file)
@@ -122,8 +122,8 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn
     , m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
     , m_boxShadow(o.m_boxShadow ? std::make_unique<ShadowData>(*o.m_boxShadow) : nullptr)
     , m_boxReflect(o.m_boxReflect)
-    , m_animations(o.m_animations ? adoptPtr(new AnimationList(*o.m_animations)) : nullptr)
-    , m_transitions(o.m_transitions ? adoptPtr(new AnimationList(*o.m_transitions)) : nullptr)
+    , m_animations(o.m_animations ? std::make_unique<AnimationList>(*o.m_animations) : nullptr)
+    , m_transitions(o.m_transitions ? std::make_unique<AnimationList>(*o.m_transitions) : nullptr)
     , m_mask(o.m_mask)
     , m_maskBoxImage(o.m_maskBoxImage)
     , m_pageSize(o.m_pageSize)
index 8f7ca1e..134b705 100644 (file)
@@ -34,7 +34,7 @@
 #include "LineClampValue.h"
 #include "NinePieceImage.h"
 #include "ShapeValue.h"
-#include <wtf/OwnPtr.h>
+#include <memory>
 #include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
 
@@ -125,15 +125,15 @@ public:
 #endif
 
     std::unique_ptr<ContentData> m_content;
-    OwnPtr<CounterDirectiveMap> m_counterDirectives;
+    std::unique_ptr<CounterDirectiveMap> m_counterDirectives;
     String m_altText;
 
     std::unique_ptr<ShadowData> m_boxShadow; // For box-shadow decorations.
     
     RefPtr<StyleReflection> m_boxReflect;
 
-    OwnPtr<AnimationList> m_animations;
-    OwnPtr<AnimationList> m_transitions;
+    std::unique_ptr<AnimationList> m_animations;
+    std::unique_ptr<AnimationList> m_transitions;
 
     FillLayer m_mask;
     NinePieceImage m_maskBoxImage;
index 820d459..fe190d3 100644 (file)
@@ -120,9 +120,9 @@ bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, const Ren
     if (gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX && objectBoundingBox.isEmpty())
         return false;
 
-    OwnPtr<GradientData>& gradientData = m_gradientMap.add(&renderer, nullptr).iterator->value;
+    auto& gradientData = m_gradientMap.add(&renderer, nullptr).iterator->value;
     if (!gradientData)
-        gradientData = adoptPtr(new GradientData);
+        gradientData = std::make_unique<GradientData>();
 
     bool isPaintingText = resourceMode & ApplyToTextMode;
 
index e4057c8..e379152 100644 (file)
@@ -26,7 +26,7 @@
 #include "ImageBuffer.h"
 #include "RenderSVGResourceContainer.h"
 #include "SVGGradientElement.h"
-
+#include <memory>
 #include <wtf/HashMap.h>
 
 namespace WebCore {
@@ -67,7 +67,7 @@ protected:
 
 private:
     bool m_shouldCollectGradientAttributes : 1;
-    HashMap<RenderObject*, OwnPtr<GradientData>> m_gradientMap;
+    HashMap<RenderObject*, std::unique_ptr<GradientData>> m_gradientMap;
 
 #if USE(CG)
     GraphicsContext* m_savedContext;
index 7dbe204..ef0e491 100644 (file)
@@ -106,7 +106,7 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderObject* object, unsign
         return 0;
 
     // Build pattern.
-    OwnPtr<PatternData> patternData = adoptPtr(new PatternData);
+    auto patternData = std::make_unique<PatternData>();
     patternData->pattern = Pattern::create(copiedImage, true, true);
 
     // Compute pattern space transformation.
@@ -129,7 +129,7 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderObject* object, unsign
     // Various calls above may trigger invalidations in some fringe cases (ImageBuffer allocation
     // failures in the SVG image cache for example). To avoid having our PatternData deleted by
     // removeAllClientsFromCache(), we only make it visible in the cache at the very end.
-    return m_patternMap.set(object, patternData.release()).iterator->value.get();
+    return m_patternMap.set(object, std::move(patternData)).iterator->value.get();
 }
 
 bool RenderSVGResourcePattern::applyResource(RenderElement& renderer, const RenderStyle& style, GraphicsContext*& context, unsigned short resourceMode)
index 73c4be5..fc338fd 100644 (file)
@@ -27,7 +27,7 @@
 #include "RenderSVGResourceContainer.h"
 #include "SVGPatternElement.h"
 #include "SVGUnitTypes.h"
-
+#include <memory>
 #include <wtf/HashMap.h>
 
 namespace WebCore {
@@ -66,7 +66,7 @@ private:
 
     bool m_shouldCollectPatternAttributes : 1;
     PatternAttributes m_attributes;
-    HashMap<RenderObject*, OwnPtr<PatternData>> m_patternMap;
+    HashMap<RenderObject*, std::unique_ptr<PatternData>> m_patternMap;
 };
 
 }
index 6945d0f..875a707 100644 (file)
@@ -77,8 +77,7 @@ RenderSVGShape::~RenderSVGShape()
 
 void RenderSVGShape::updateShapeFromElement()
 {
-    m_path.clear();
-    m_path = adoptPtr(new Path);
+    m_path = std::make_unique<Path>();
     ASSERT(RenderSVGShape::isEmpty());
 
     updatePathFromGraphicsElement(&graphicsElement(), path());
index 511576d..8814034 100644 (file)
@@ -31,7 +31,7 @@
 #include "RenderSVGModelObject.h"
 #include "SVGGraphicsElement.h"
 #include "SVGMarkerData.h"
-#include <wtf/OwnPtr.h>
+#include <memory>
 #include <wtf/Vector.h>
 
 namespace WebCore {
@@ -124,7 +124,7 @@ private:
     FloatRect m_repaintBoundingBox;
     FloatRect m_repaintBoundingBoxExcludingShadow;
     AffineTransform m_localTransform;
-    OwnPtr<Path> m_path;
+    std::unique_ptr<Path> m_path;
     Vector<MarkerPosition> m_markerPositions;
 
     bool m_needsBoundariesUpdate : 1;
index 00050da..33d371d 100644 (file)
@@ -446,7 +446,7 @@ bool SVGResources::setClipper(RenderSVGResourceClipper* clipper)
     ASSERT(clipper->resourceType() == ClipperResourceType);
 
     if (!m_clipperFilterMaskerData)
-        m_clipperFilterMaskerData = ClipperFilterMaskerData::create();
+        m_clipperFilterMaskerData = std::make_unique<ClipperFilterMaskerData>();
 
     m_clipperFilterMaskerData->clipper = clipper;
     return true;
@@ -468,7 +468,7 @@ bool SVGResources::setFilter(RenderSVGResourceFilter* filter)
     ASSERT(filter->resourceType() == FilterResourceType);
 
     if (!m_clipperFilterMaskerData)
-        m_clipperFilterMaskerData = ClipperFilterMaskerData::create();
+        m_clipperFilterMaskerData = std::make_unique<ClipperFilterMaskerData>();
 
     m_clipperFilterMaskerData->filter = filter;
     return true;
@@ -490,7 +490,7 @@ bool SVGResources::setMarkerStart(RenderSVGResourceMarker* markerStart)
     ASSERT(markerStart->resourceType() == MarkerResourceType);
 
     if (!m_markerData)
-        m_markerData = MarkerData::create();
+        m_markerData = std::make_unique<MarkerData>();
 
     m_markerData->markerStart = markerStart;
     return true;
@@ -511,7 +511,7 @@ bool SVGResources::setMarkerMid(RenderSVGResourceMarker* markerMid)
     ASSERT(markerMid->resourceType() == MarkerResourceType);
 
     if (!m_markerData)
-        m_markerData = MarkerData::create();
+        m_markerData = std::make_unique<MarkerData>();
 
     m_markerData->markerMid = markerMid;
     return true;
@@ -532,7 +532,7 @@ bool SVGResources::setMarkerEnd(RenderSVGResourceMarker* markerEnd)
     ASSERT(markerEnd->resourceType() == MarkerResourceType);
 
     if (!m_markerData)
-        m_markerData = MarkerData::create();
+        m_markerData = std::make_unique<MarkerData>();
 
     m_markerData->markerEnd = markerEnd;
     return true;
@@ -553,7 +553,7 @@ bool SVGResources::setMasker(RenderSVGResourceMasker* masker)
     ASSERT(masker->resourceType() == MaskerResourceType);
 
     if (!m_clipperFilterMaskerData)
-        m_clipperFilterMaskerData = ClipperFilterMaskerData::create();
+        m_clipperFilterMaskerData = std::make_unique<ClipperFilterMaskerData>();
 
     m_clipperFilterMaskerData->masker = masker;
     return true;
@@ -576,7 +576,7 @@ bool SVGResources::setFill(RenderSVGResourceContainer* fill)
            || fill->resourceType() == RadialGradientResourceType);
 
     if (!m_fillStrokeData)
-        m_fillStrokeData = FillStrokeData::create();
+        m_fillStrokeData = std::make_unique<FillStrokeData>();
 
     m_fillStrokeData->fill = fill;
     return true;
@@ -599,7 +599,7 @@ bool SVGResources::setStroke(RenderSVGResourceContainer* stroke)
            || stroke->resourceType() == RadialGradientResourceType);
 
     if (!m_fillStrokeData)
-        m_fillStrokeData = FillStrokeData::create();
+        m_fillStrokeData = std::make_unique<FillStrokeData>();
 
     m_fillStrokeData->stroke = stroke;
     return true;
index f31b163..c9af5b7 100644 (file)
 #ifndef SVGResources_h
 #define SVGResources_h
 
+#include <memory>
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
@@ -124,11 +123,6 @@ private:
         {
         }
 
-        static PassOwnPtr<ClipperFilterMaskerData> create()
-        {
-            return adoptPtr(new ClipperFilterMaskerData);
-        }
-
         RenderSVGResourceClipper* clipper;
 #if ENABLE(FILTERS)
         RenderSVGResourceFilter* filter;
@@ -148,11 +142,6 @@ private:
         {
         }
 
-        static PassOwnPtr<MarkerData> create()
-        {
-            return adoptPtr(new MarkerData);
-        }
-
         RenderSVGResourceMarker* markerStart;
         RenderSVGResourceMarker* markerMid;
         RenderSVGResourceMarker* markerEnd;
@@ -171,18 +160,13 @@ private:
         {
         }
 
-        static PassOwnPtr<FillStrokeData> create()
-        {
-            return adoptPtr(new FillStrokeData);
-        }
-
         RenderSVGResourceContainer* fill;
         RenderSVGResourceContainer* stroke;
     };
 
-    OwnPtr<ClipperFilterMaskerData> m_clipperFilterMaskerData;
-    OwnPtr<MarkerData> m_markerData;
-    OwnPtr<FillStrokeData> m_fillStrokeData;
+    std::unique_ptr<ClipperFilterMaskerData> m_clipperFilterMaskerData;
+    std::unique_ptr<MarkerData> m_markerData;
+    std::unique_ptr<FillStrokeData> m_fillStrokeData;
     RenderSVGResourceContainer* m_linkedResource;
 };
 
index 4a89803..bb3372b 100644 (file)
@@ -42,12 +42,12 @@ void SVGResourcesCache::addResourcesFromRenderer(RenderElement& renderer, const
     const SVGRenderStyle& svgStyle = style.svgStyle();
 
     // Build a list of all resources associated with the passed RenderObject
-    OwnPtr<SVGResources> newResources = adoptPtr(new SVGResources);
+    auto newResources = std::make_unique<SVGResources>();
     if (!newResources->buildCachedResources(renderer, svgStyle))
         return;
 
     // Put object in cache.
-    SVGResources& resources = *m_cache.add(&renderer, newResources.release()).iterator->value;
+    SVGResources& resources = *m_cache.add(&renderer, std::move(newResources)).iterator->value;
 
     // Run cycle-detection _afterwards_, so self-references can be caught as well.
     SVGResourcesCycleSolver solver(renderer, resources);
@@ -63,7 +63,7 @@ void SVGResourcesCache::addResourcesFromRenderer(RenderElement& renderer, const
 
 void SVGResourcesCache::removeResourcesFromRenderer(RenderElement& renderer)
 {
-    OwnPtr<SVGResources> resources = m_cache.take(&renderer);
+    std::unique_ptr<SVGResources> resources = m_cache.take(&renderer);
     if (!resources)
         return;
 
index 1ff4af1..77d61dd 100644 (file)
@@ -21,8 +21,9 @@
 #define SVGResourcesCache_h
 
 #include "RenderStyleConstants.h"
+#include <memory>
 #include <wtf/HashMap.h>
-#include <wtf/OwnPtr.h>
+#include <wtf/Noncopyable.h>
 
 namespace WebCore {
 
@@ -62,7 +63,7 @@ private:
     void addResourcesFromRenderer(RenderElement&, const RenderStyle&);
     void removeResourcesFromRenderer(RenderElement&);
 
-    typedef HashMap<const RenderObject*, OwnPtr<SVGResources>> CacheMap;
+    typedef HashMap<const RenderObject*, std::unique_ptr<SVGResources>> CacheMap;
     CacheMap m_cache;
 };
 
index dd7469f..e60102d 100644 (file)
@@ -104,9 +104,9 @@ void SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer(RenderSVGInlin
     m_isComplexText = scaledFont.codePath(m_run) == Font::Complex;
 
     if (m_isComplexText)
-        m_simpleWidthIterator.clear();
+        m_simpleWidthIterator = nullptr;
     else
-        m_simpleWidthIterator = adoptPtr(new WidthIterator(&scaledFont, m_run));
+        m_simpleWidthIterator = std::make_unique<WidthIterator>(&scaledFont, m_run);
 }
 
 struct MeasureTextData {
index 9c2e200..e9c2e44 100644 (file)
@@ -56,7 +56,7 @@ private:
     float m_totalWidth;
 
     // Simple text only.
-    OwnPtr<WidthIterator> m_simpleWidthIterator;
+    std::unique_ptr<WidthIterator> m_simpleWidthIterator;
 
     // Complex text only.
     SVGTextMetrics m_complexStartToCurrentMetrics;