Changeset 166489 in webkit
- Timestamp:
- Mar 31, 2014 3:12:49 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 67 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166488 r166489 1 2014-03-23 Zan Dobersek <zdobersek@igalia.com> 2 3 Move Source/WebCore/rendering/ code to std::unique_ptr 4 https://bugs.webkit.org/show_bug.cgi?id=129664 5 6 Reviewed by Anders Carlsson. 7 8 Replace uses of OwnPtr and PassOwnPtr in code under Source/WebCore/rendering/ with std::unique_ptr. 9 10 * platform/graphics/FloatPolygon.cpp: 11 (WebCore::FloatPolygon::FloatPolygon): 12 * platform/graphics/FloatPolygon.h: 13 * rendering/ClipPathOperation.h: 14 * rendering/FlowThreadController.cpp: 15 (WebCore::FlowThreadController::ensureRenderFlowThreadWithName): 16 * rendering/FlowThreadController.h: 17 * rendering/HitTestLocation.h: 18 * rendering/HitTestResult.cpp: 19 (WebCore::HitTestResult::HitTestResult): 20 (WebCore::HitTestResult::operator=): 21 (WebCore::HitTestResult::rectBasedTestResult): 22 (WebCore::HitTestResult::mutableRectBasedTestResult): 23 * rendering/HitTestResult.h: 24 * rendering/HitTestingTransformState.cpp: 25 * rendering/ImageQualityController.h: 26 * rendering/RenderBlock.cpp: 27 (WebCore::removeBlockFromDescendantAndContainerMaps): 28 (WebCore::RenderBlock::finishDelayUpdateScrollInfo): 29 (WebCore::RenderBlock::addContinuationWithOutline): 30 (WebCore::RenderBlock::paintContinuationOutlines): 31 (WebCore::RenderBlock::insertIntoTrackedRendererMaps): 32 (WebCore::RenderBlock::removeFromTrackedRendererMaps): 33 (WebCore::RenderBlock::setComputedColumnCountAndWidth): 34 * rendering/RenderBlock.h: 35 * rendering/RenderBlockFlow.cpp: 36 (WebCore::RenderBlockFlow::createFloatingObjects): 37 * rendering/RenderBlockFlow.h: 38 * rendering/RenderBoxRegionInfo.h: 39 * rendering/RenderButton.cpp: 40 (WebCore::RenderButton::styleDidChange): 41 * rendering/RenderButton.h: 42 * rendering/RenderCounter.cpp: 43 (WebCore::makeCounterNode): 44 * rendering/RenderFlowThread.cpp: 45 (WebCore::RenderFlowThread::updateAllLayerToRegionMappings): 46 (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock): 47 * rendering/RenderFlowThread.h: 48 * rendering/RenderGeometryMap.cpp: 49 (WebCore::RenderGeometryMap::push): 50 (WebCore::RenderGeometryMap::pushView): 51 * rendering/RenderGeometryMap.h: 52 * rendering/RenderGrid.cpp: 53 (WebCore::RenderGrid::GridIterator::nextEmptyGridArea): 54 (WebCore::RenderGrid::placeItemsOnGrid): 55 (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): 56 (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): 57 (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): 58 (WebCore::RenderGrid::resolveGridPositionsFromStyle): 59 (WebCore::RenderGrid::resolveGridPositionAgainstOppositePosition): 60 (WebCore::RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition): 61 (WebCore::RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): 62 (WebCore::RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): 63 * rendering/RenderGrid.h: 64 * rendering/RenderImageResource.h: 65 * rendering/RenderLayer.cpp: 66 (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder): 67 (WebCore::RenderLayer::updateTransform): 68 (WebCore::RenderLayer::setupFilters): 69 (WebCore::RenderLayer::paintLayerContents): 70 (WebCore::RenderLayer::paintChildLayerIntoColumns): 71 (WebCore::RenderLayer::hitTestChildLayerColumns): 72 (WebCore::RenderLayer::updateClipRects): 73 (WebCore::RenderLayer::calculateClipRects): 74 * rendering/RenderLayer.h: 75 (WebCore::RenderLayer::clearZOrderLists): 76 * rendering/RenderLayerCompositor.cpp: 77 (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh): 78 (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): 79 * rendering/RenderLayerCompositor.h: 80 * rendering/RenderLayerFilterInfo.cpp: 81 (WebCore::RenderLayer::FilterInfo::map): 82 (WebCore::RenderLayer::FilterInfo::get): 83 * rendering/RenderLayerFilterInfo.h: 84 * rendering/RenderRegion.cpp: 85 (WebCore::RenderRegion::setRenderBoxRegionInfo): 86 (WebCore::RenderRegion::takeRenderBoxRegionInfo): 87 * rendering/RenderRegion.h: 88 * rendering/RenderTable.cpp: 89 (WebCore::RenderTable::styleDidChange): 90 * rendering/RenderTable.h: 91 * rendering/RenderView.cpp: 92 (WebCore::RenderView::selectionBounds): 93 (WebCore::RenderView::setSelection): 94 (WebCore::RenderView::compositor): 95 (WebCore::RenderView::flowThreadController): 96 (WebCore::RenderView::imageQualityController): 97 * rendering/RenderView.h: 98 * rendering/RootInlineBox.h: 99 (WebCore::RootInlineBox::appendFloat): 100 * rendering/TextAutosizer.h: 101 * rendering/shapes/PolygonShape.cpp: 102 (WebCore::computeShapePaddingBounds): 103 (WebCore::computeShapeMarginBounds): 104 * rendering/shapes/PolygonShape.h: 105 (WebCore::PolygonShape::PolygonShape): 106 * rendering/shapes/RasterShape.cpp: 107 (WebCore::RasterShapeIntervals::computeShapeMarginIntervals): 108 * rendering/shapes/RasterShape.h: 109 (WebCore::RasterShape::RasterShape): 110 * rendering/shapes/Shape.cpp: 111 (WebCore::createInsetShape): 112 (WebCore::createRectangleShape): 113 (WebCore::createCircleShape): 114 (WebCore::createEllipseShape): 115 (WebCore::createPolygonShape): 116 (WebCore::Shape::createShape): 117 (WebCore::Shape::createRasterShape): 118 (WebCore::Shape::createLayoutBoxShape): 119 * rendering/shapes/Shape.h: 120 * rendering/shapes/ShapeInfo.h: 121 (WebCore::ShapeInfo::markShapeAsDirty): 122 (WebCore::ShapeInfo::isShapeDirty): 123 * rendering/shapes/ShapeInsideInfo.h: 124 * rendering/style/ContentData.h: 125 * rendering/style/CounterDirectives.cpp: 126 (WebCore::clone): 127 * rendering/style/CounterDirectives.h: 128 * rendering/style/GridCoordinate.h: 129 * rendering/style/RenderStyle.cpp: 130 (WebCore::RenderStyle::addCachedPseudoStyle): 131 (WebCore::RenderStyle::accessCounterDirectives): 132 (WebCore::RenderStyle::accessAnimations): 133 (WebCore::RenderStyle::accessTransitions): 134 * rendering/style/RenderStyle.h: 135 * rendering/style/StyleRareNonInheritedData.cpp: 136 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 137 * rendering/style/StyleRareNonInheritedData.h: 138 * rendering/svg/RenderSVGResourceGradient.cpp: 139 (WebCore::RenderSVGResourceGradient::applyResource): 140 * rendering/svg/RenderSVGResourceGradient.h: 141 * rendering/svg/RenderSVGResourcePattern.cpp: 142 (WebCore::RenderSVGResourcePattern::buildPattern): 143 * rendering/svg/RenderSVGResourcePattern.h: 144 * rendering/svg/RenderSVGShape.cpp: 145 (WebCore::RenderSVGShape::updateShapeFromElement): 146 * rendering/svg/RenderSVGShape.h: 147 * rendering/svg/SVGResources.cpp: 148 (WebCore::SVGResources::setClipper): 149 (WebCore::SVGResources::setFilter): 150 (WebCore::SVGResources::setMarkerStart): 151 (WebCore::SVGResources::setMarkerMid): 152 (WebCore::SVGResources::setMarkerEnd): 153 (WebCore::SVGResources::setMasker): 154 (WebCore::SVGResources::setFill): 155 (WebCore::SVGResources::setStroke): 156 * rendering/svg/SVGResources.h: 157 * rendering/svg/SVGResourcesCache.cpp: 158 (WebCore::SVGResourcesCache::addResourcesFromRenderer): 159 (WebCore::SVGResourcesCache::removeResourcesFromRenderer): 160 * rendering/svg/SVGResourcesCache.h: 161 * rendering/svg/SVGTextMetricsBuilder.cpp: 162 (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer): 163 * rendering/svg/SVGTextMetricsBuilder.h: 164 1 165 2014-03-28 Sergio Villar Senin <svillar@igalia.com> 2 166 -
trunk/Source/WebCore/platform/graphics/FloatPolygon.cpp
r157653 r166489 80 80 } 81 81 82 FloatPolygon::FloatPolygon( PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule)83 : m_vertices( vertices)82 FloatPolygon::FloatPolygon(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule) 83 : m_vertices(std::move(vertices)) 84 84 , m_fillRule(fillRule) 85 85 { -
trunk/Source/WebCore/platform/graphics/FloatPolygon.h
r162139 r166489 36 36 #include "ValueToString.h" 37 37 #include "WindRule.h" 38 #include <wtf/OwnPtr.h> 39 #include <wtf/PassOwnPtr.h> 38 #include <memory> 40 39 #include <wtf/Vector.h> 41 40 … … 46 45 class FloatPolygon { 47 46 public: 48 FloatPolygon( PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule);47 FloatPolygon(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule); 49 48 50 49 const FloatPoint& vertexAt(unsigned index) const { return (*m_vertices)[index]; } … … 68 67 bool containsEvenOdd(const FloatPoint&) const; 69 68 70 OwnPtr<Vector<FloatPoint>> m_vertices;69 std::unique_ptr<Vector<FloatPoint>> m_vertices; 71 70 WindRule m_fillRule; 72 71 FloatRect m_boundingBox; -
trunk/Source/WebCore/rendering/ClipPathOperation.h
r165843 r166489 34 34 #include "Path.h" 35 35 #include "RenderStyleConstants.h" 36 #include <wtf/OwnPtr.h>37 #include <wtf/PassOwnPtr.h>38 36 #include <wtf/RefCounted.h> 39 37 #include <wtf/text/WTFString.h> -
trunk/Source/WebCore/rendering/FlowThreadController.cpp
r166353 r166489 41 41 namespace WebCore { 42 42 43 PassOwnPtr<FlowThreadController> FlowThreadController::create(RenderView* view)44 {45 return adoptPtr(new FlowThreadController(view));46 }47 48 43 FlowThreadController::FlowThreadController(RenderView* view) 49 44 : m_view(view) … … 61 56 { 62 57 if (!m_renderNamedFlowThreadList) 63 m_renderNamedFlowThreadList = adoptPtr(new RenderNamedFlowThreadList());58 m_renderNamedFlowThreadList = std::make_unique<RenderNamedFlowThreadList>(); 64 59 else { 65 60 for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) { -
trunk/Source/WebCore/rendering/FlowThreadController.h
r166353 r166489 32 32 33 33 #include "RenderView.h" 34 #include <memory> 34 35 #include <wtf/ListHashSet.h> 35 #include <wtf/OwnPtr.h>36 36 37 37 namespace WebCore { … … 46 46 WTF_MAKE_FAST_ALLOCATED; 47 47 public: 48 static PassOwnPtr<FlowThreadController> create(RenderView*);48 explicit FlowThreadController(RenderView*); 49 49 ~FlowThreadController(); 50 50 … … 92 92 93 93 protected: 94 explicit FlowThreadController(RenderView*);95 94 void updateFlowThreadsChainIfNecessary(); 96 95 void resetFlowThreadsWithAutoHeightRegions(); … … 101 100 bool m_isRenderNamedFlowThreadOrderDirty; 102 101 unsigned m_flowThreadsWithAutoLogicalHeightRegions; 103 OwnPtr<RenderNamedFlowThreadList> m_renderNamedFlowThreadList;102 std::unique_ptr<RenderNamedFlowThreadList> m_renderNamedFlowThreadList; 104 103 HashMap<const Element*, RenderNamedFlowThread*> m_mapNamedFlowContentElement; 105 104 }; -
trunk/Source/WebCore/rendering/HitTestLocation.h
r165676 r166489 31 31 #include <wtf/Forward.h> 32 32 #include <wtf/ListHashSet.h> 33 #include <wtf/OwnPtr.h>34 33 #include <wtf/RefPtr.h> 35 34 -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r163440 r166489 93 93 { 94 94 // Only copy the NodeSet in case of rect hit test. 95 m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*other.m_rectBasedTestResult) : 0);95 m_rectBasedTestResult = other.m_rectBasedTestResult ? std::make_unique<NodeSet>(*other.m_rectBasedTestResult) : nullptr; 96 96 } 97 97 … … 112 112 113 113 // Only copy the NodeSet in case of rect hit test. 114 m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*other.m_rectBasedTestResult) : 0);114 m_rectBasedTestResult = other.m_rectBasedTestResult ? std::make_unique<NodeSet>(*other.m_rectBasedTestResult) : nullptr; 115 115 116 116 return *this; … … 638 638 { 639 639 if (!m_rectBasedTestResult) 640 m_rectBasedTestResult = adoptPtr(new NodeSet);640 m_rectBasedTestResult = std::make_unique<NodeSet>(); 641 641 return *m_rectBasedTestResult; 642 642 } … … 645 645 { 646 646 if (!m_rectBasedTestResult) 647 m_rectBasedTestResult = adoptPtr(new NodeSet);647 m_rectBasedTestResult = std::make_unique<NodeSet>(); 648 648 return *m_rectBasedTestResult; 649 649 } -
trunk/Source/WebCore/rendering/HitTestResult.h
r165676 r166489 29 29 #include "LayoutRect.h" 30 30 #include "TextDirection.h" 31 #include <memory> 31 32 #include <wtf/Forward.h> 32 33 #include <wtf/ListHashSet.h> 33 #include <wtf/OwnPtr.h>34 34 #include <wtf/RefPtr.h> 35 35 … … 159 159 bool m_isOverWidget; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example). 160 160 161 mutable OwnPtr<NodeSet> m_rectBasedTestResult;161 mutable std::unique_ptr<NodeSet> m_rectBasedTestResult; 162 162 }; 163 163 -
trunk/Source/WebCore/rendering/HitTestingTransformState.cpp
r165676 r166489 28 28 29 29 #include "LayoutRect.h" 30 #include <wtf/PassOwnPtr.h>31 30 32 31 namespace WebCore { -
trunk/Source/WebCore/rendering/ImageQualityController.h
r161768 r166489 29 29 #include "Timer.h" 30 30 #include <wtf/HashMap.h> 31 #include <wtf/PassOwnPtr.h>32 31 33 32 namespace WebCore { … … 43 42 WTF_MAKE_NONCOPYABLE(ImageQualityController) 44 43 public: 45 static PassOwnPtr<ImageQualityController> create(const RenderView& renderView) { return adoptPtr(new ImageQualityController(renderView)); }44 explicit ImageQualityController(const RenderView&); 46 45 47 46 bool shouldPaintAtLowQuality(GraphicsContext*, RenderBoxModelObject*, Image*, const void* layer, const LayoutSize&); … … 51 50 typedef HashMap<const void*, LayoutSize> LayerSizeMap; 52 51 typedef HashMap<RenderBoxModelObject*, LayerSizeMap> ObjectLayerSizeMap; 53 54 explicit ImageQualityController(const RenderView&);55 52 56 53 void removeLayer(RenderBoxModelObject*, LayerSizeMap* innerMap, const void* layer); -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r166301 r166489 87 87 COMPILE_ASSERT(sizeof(RenderBlock) == sizeof(SameSizeAsRenderBlock), RenderBlock_should_stay_small); 88 88 89 typedef WTF::HashMap<const RenderBox*, OwnPtr<ColumnInfo>> ColumnInfoMap;89 typedef WTF::HashMap<const RenderBox*, std::unique_ptr<ColumnInfo>> ColumnInfoMap; 90 90 static ColumnInfoMap* gColumnInfoMap = 0; 91 91 … … 96 96 static TrackedContainerMap* gPercentHeightContainerMap = 0; 97 97 98 typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*>>> ContinuationOutlineTableMap;98 typedef WTF::HashMap<RenderBlock*, std::unique_ptr<ListHashSet<RenderInline*>>> ContinuationOutlineTableMap; 99 99 100 100 typedef WTF::HashSet<RenderBlock*> DelayedUpdateScrollInfoSet; … … 190 190 static void removeBlockFromDescendantAndContainerMaps(RenderBlock* block, TrackedDescendantsMap*& descendantMap, TrackedContainerMap*& containerMap) 191 191 { 192 if ( OwnPtr<TrackedRendererListHashSet> descendantSet = descendantMap->take(block)) {192 if (std::unique_ptr<TrackedRendererListHashSet> descendantSet = descendantMap->take(block)) { 193 193 TrackedRendererListHashSet::iterator end = descendantSet->end(); 194 194 for (TrackedRendererListHashSet::iterator descendant = descendantSet->begin(); descendant != end; ++descendant) { … … 1225 1225 ASSERT(gDelayedUpdateScrollInfoSet); 1226 1226 1227 OwnPtr<DelayedUpdateScrollInfoSet> infoSet(adoptPtr(gDelayedUpdateScrollInfoSet));1227 std::unique_ptr<DelayedUpdateScrollInfoSet> infoSet(gDelayedUpdateScrollInfoSet); 1228 1228 gDelayedUpdateScrollInfoSet = 0; 1229 1229 … … 2227 2227 if (!continuations) { 2228 2228 continuations = new ListHashSet<RenderInline*>; 2229 table->set(this, adoptPtr(continuations));2229 table->set(this, std::unique_ptr<ListHashSet<RenderInline*>>(continuations)); 2230 2230 } 2231 2231 … … 2252 2252 return; 2253 2253 2254 OwnPtr<ListHashSet<RenderInline*>> continuations = table->take(this);2254 std::unique_ptr<ListHashSet<RenderInline*>> continuations = table->take(this); 2255 2255 if (!continuations) 2256 2256 return; … … 2657 2657 if (!descendantSet) { 2658 2658 descendantSet = new TrackedRendererListHashSet; 2659 descendantsMap->set(this, adoptPtr(descendantSet));2659 descendantsMap->set(this, std::unique_ptr<TrackedRendererListHashSet>(descendantSet)); 2660 2660 } 2661 2661 bool added = descendantSet->add(&descendant).isNewEntry; … … 2669 2669 if (!containerSet) { 2670 2670 containerSet = new HashSet<RenderBlock*>; 2671 containerMap->set(&descendant, adoptPtr(containerSet));2671 containerMap->set(&descendant, std::unique_ptr<HashSet<RenderBlock*>>(containerSet)); 2672 2672 } 2673 2673 ASSERT(!containerSet->contains(this)); … … 2680 2680 return; 2681 2681 2682 OwnPtr<HashSet<RenderBlock*>> containerSet = containerMap->take(&descendant);2682 std::unique_ptr<HashSet<RenderBlock*>> containerSet = containerMap->take(&descendant); 2683 2683 if (!containerSet) 2684 2684 return; … … 3330 3330 gColumnInfoMap = new ColumnInfoMap; 3331 3331 info = new ColumnInfo; 3332 gColumnInfoMap->add(this, adoptPtr(info));3332 gColumnInfoMap->add(this, std::unique_ptr<ColumnInfo>(info)); 3333 3333 setHasColumns(true); 3334 3334 } -
trunk/Source/WebCore/rendering/RenderBlock.h
r166301 r166489 28 28 #include "RenderBox.h" 29 29 #include "TextRun.h" 30 #include < wtf/OwnPtr.h>30 #include <memory> 31 31 #include <wtf/ListHashSet.h> 32 32 … … 43 43 44 44 typedef WTF::ListHashSet<RenderBox*, 16> TrackedRendererListHashSet; 45 typedef WTF::HashMap<const RenderBlock*, OwnPtr<TrackedRendererListHashSet>> TrackedDescendantsMap;46 typedef WTF::HashMap<const RenderBox*, OwnPtr<HashSet<RenderBlock*>>> TrackedContainerMap;45 typedef WTF::HashMap<const RenderBlock*, std::unique_ptr<TrackedRendererListHashSet>> TrackedDescendantsMap; 46 typedef WTF::HashMap<const RenderBox*, std::unique_ptr<HashSet<RenderBlock*>>> TrackedContainerMap; 47 47 48 48 enum CaretType { CursorCaret, DragCaret }; -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r166301 r166489 2025 2025 void RenderBlockFlow::createFloatingObjects() 2026 2026 { 2027 m_floatingObjects = adoptPtr(new FloatingObjects(*this));2027 m_floatingObjects = std::make_unique<FloatingObjects>(*this); 2028 2028 } 2029 2029 -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r166301 r166489 29 29 #include "SimpleLineLayout.h" 30 30 #include "TrailingObjects.h" 31 #include <memory> 31 32 32 33 namespace WebCore { … … 593 594 594 595 protected: 595 OwnPtr<FloatingObjects> m_floatingObjects;596 std::unique_ptr<FloatingObjects> m_floatingObjects; 596 597 std::unique_ptr<RenderBlockFlowRareData> m_rareBlockFlowData; 597 598 RenderLineBoxList m_lineBoxes; -
trunk/Source/WebCore/rendering/RenderBoxRegionInfo.h
r165676 r166489 29 29 30 30 #include "RenderOverflow.h" 31 #include <wtf/OwnPtr.h>32 31 33 32 namespace WebCore { -
trunk/Source/WebCore/rendering/RenderButton.cpp
r165676 r166489 115 115 if (!m_default && theme().isDefault(this)) { 116 116 if (!m_timer) 117 m_timer = adoptPtr(new Timer<RenderButton>(this, &RenderButton::timerFired));117 m_timer = std::make_unique<Timer<RenderButton>>(this, &RenderButton::timerFired); 118 118 m_timer->startRepeating(0.03); 119 119 m_default = true; 120 120 } else if (m_default && !theme().isDefault(this)) { 121 121 m_default = false; 122 m_timer .clear();122 m_timer = nullptr; 123 123 } 124 124 } -
trunk/Source/WebCore/rendering/RenderButton.h
r165676 r166489 24 24 #include "RenderFlexibleBox.h" 25 25 #include "Timer.h" 26 #include < wtf/OwnPtr.h>26 #include <memory> 27 27 28 28 namespace WebCore { … … 80 80 RenderBlock* m_inner; 81 81 82 OwnPtr<Timer<RenderButton>> m_timer;82 std::unique_ptr<Timer<RenderButton>> m_timer; 83 83 bool m_default; 84 84 }; -
trunk/Source/WebCore/rendering/RenderCounter.cpp
r165607 r166489 45 45 46 46 typedef HashMap<AtomicString, RefPtr<CounterNode>> CounterMap; 47 typedef HashMap<const RenderObject*, OwnPtr<CounterMap>> CounterMaps;47 typedef HashMap<const RenderObject*, std::unique_ptr<CounterMap>> CounterMaps; 48 48 49 49 static CounterNode* makeCounterNode(RenderObject*, const AtomicString& identifier, bool alwaysCreateCounter); … … 325 325 else { 326 326 nodeMap = new CounterMap; 327 counterMaps().set(element, adoptPtr(nodeMap));327 counterMaps().set(element, std::unique_ptr<CounterMap>(nodeMap)); 328 328 element->setHasCounterNodeMap(true); 329 329 } -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r165964 r166489 324 324 if (needsLayerUpdate) { 325 325 if (!m_layerToRegionMap) 326 m_layerToRegionMap = adoptPtr(new LayerToRegionMap());326 m_layerToRegionMap = std::make_unique<LayerToRegionMap>(); 327 327 m_layerToRegionMap->swap(layerToRegionMap); 328 328 329 329 if (!m_regionToLayerListMap) 330 m_regionToLayerListMap = adoptPtr(new RegionToLayerListMap());330 m_regionToLayerListMap = std::make_unique<RegionToLayerListMap>(); 331 331 m_regionToLayerListMap->swap(regionToLayerListMap); 332 332 } … … 646 646 647 647 // We have no information computed for this region so we need to do it. 648 OwnPtr<RenderBoxRegionInfo> oldInfo = region->takeRenderBoxRegionInfo(block);648 std::unique_ptr<RenderBoxRegionInfo> oldInfo = region->takeRenderBoxRegionInfo(block); 649 649 if (!oldInfo) { 650 650 relayoutChildren = rangeInvalidated; -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r165991 r166489 304 304 305 305 // Map a layer to the region in which the layer is painted. 306 OwnPtr<LayerToRegionMap> m_layerToRegionMap;306 std::unique_ptr<LayerToRegionMap> m_layerToRegionMap; 307 307 308 308 // Map a region to the list of layers that paint in that region. 309 OwnPtr<RegionToLayerListMap> m_regionToLayerListMap;309 std::unique_ptr<RegionToLayerListMap> m_regionToLayerListMap; 310 310 311 311 // Map a box to the list of regions in which the box is rendered. -
trunk/Source/WebCore/rendering/RenderGeometryMap.cpp
r165676 r166489 230 230 RenderGeometryMapStep& step = m_mapping[m_insertionPosition]; 231 231 if (!t.isIntegerTranslation()) 232 step.m_transform = adoptPtr(new TransformationMatrix(t));232 step.m_transform = std::make_unique<TransformationMatrix>(t); 233 233 else 234 234 step.m_offset = LayoutSize(t.e(), t.f()); … … 247 247 step.m_offset = scrollOffset; 248 248 if (t) 249 step.m_transform = adoptPtr(new TransformationMatrix(*t));249 step.m_transform = std::make_unique<TransformationMatrix>(*t); 250 250 251 251 stepInserted(step); -
trunk/Source/WebCore/rendering/RenderGeometryMap.h
r165676 r166489 33 33 #include "RenderObject.h" 34 34 #include "TransformationMatrix.h" 35 #include < wtf/OwnPtr.h>35 #include <memory> 36 36 37 37 namespace WebCore { … … 65 65 const RenderObject* m_renderer; 66 66 LayoutSize m_offset; 67 OwnPtr<TransformationMatrix> m_transform; // Includes offset if non-null.67 std::unique_ptr<TransformationMatrix> m_transform; // Includes offset if non-null. 68 68 bool m_accumulatingTransform; 69 69 bool m_isNonUniform; // Mapping depends on the input point, e.g. because of CSS columns. … … 138 138 139 139 namespace WTF { 140 // This is required for a struct with OwnPtr. We know RenderGeometryMapStep is simple enough that140 // This is required for a struct with std::unique_ptr<>. We know RenderGeometryMapStep is simple enough that 141 141 // initializing to 0 and moving with memcpy (and then not destructing the original) will work. 142 142 template<> struct VectorTraits<WebCore::RenderGeometryMapStep> : SimpleClassVectorTraits { }; -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r166450 r166489 118 118 } 119 119 120 PassOwnPtr<GridCoordinate> nextEmptyGridArea()120 std::unique_ptr<GridCoordinate> nextEmptyGridArea() 121 121 { 122 122 if (m_grid.isEmpty()) … … 128 128 const Vector<RenderBox*>& children = m_grid[m_rowIndex][m_columnIndex]; 129 129 if (children.isEmpty()) { 130 OwnPtr<GridCoordinate> result = adoptPtr(new GridCoordinate(GridSpan(m_rowIndex, m_rowIndex), GridSpan(m_columnIndex, m_columnIndex)));130 std::unique_ptr<GridCoordinate> result = std::make_unique<GridCoordinate>(GridSpan(m_rowIndex, m_rowIndex), GridSpan(m_columnIndex, m_columnIndex)); 131 131 // Advance the iterator to avoid an infinite loop where we would return the same grid area over and over. 132 132 ++varyingTrackIndex; 133 return result.release();133 return std::move(result); 134 134 } 135 135 } … … 671 671 // FIXME: We never re-resolve positions if the grid is grown during auto-placement which may lead auto / <integer> 672 672 // positions to not match the author's intent. The specification is unclear on what should be done in this case. 673 OwnPtr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows);674 OwnPtr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns);673 std::unique_ptr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows); 674 std::unique_ptr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns); 675 675 if (!rowPositions || !columnPositions) { 676 676 GridSpan* majorAxisPositions = (autoPlacementMajorAxisDirection() == ForColumns) ? columnPositions.get() : rowPositions.get(); … … 713 713 714 714 // This function bypasses the cache (cachedGridCoordinate()) as it is used to build it. 715 OwnPtr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows);716 OwnPtr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns);715 std::unique_ptr<GridSpan> rowPositions = resolveGridPositionsFromStyle(child, ForRows); 716 std::unique_ptr<GridSpan> columnPositions = resolveGridPositionsFromStyle(child, ForColumns); 717 717 718 718 // |positions| is 0 if we need to run the auto-placement algorithm. Our estimation ignores … … 734 734 { 735 735 for (size_t i = 0; i < autoGridItems.size(); ++i) { 736 OwnPtr<GridSpan> majorAxisPositions = resolveGridPositionsFromStyle(autoGridItems[i], autoPlacementMajorAxisDirection());736 std::unique_ptr<GridSpan> majorAxisPositions = resolveGridPositionsFromStyle(autoGridItems[i], autoPlacementMajorAxisDirection()); 737 737 GridIterator iterator(m_grid, autoPlacementMajorAxisDirection(), majorAxisPositions->initialPositionIndex); 738 if ( OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {738 if (std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) { 739 739 insertItemIntoGrid(autoGridItems[i], emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex); 740 740 continue; … … 742 742 743 743 growGrid(autoPlacementMinorAxisDirection()); 744 OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea();744 std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea(); 745 745 ASSERT(emptyGridArea); 746 746 insertItemIntoGrid(autoGridItems[i], emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex); … … 756 756 void RenderGrid::placeAutoMajorAxisItemOnGrid(RenderBox* gridItem) 757 757 { 758 OwnPtr<GridSpan> minorAxisPositions = resolveGridPositionsFromStyle(gridItem, autoPlacementMinorAxisDirection());758 std::unique_ptr<GridSpan> minorAxisPositions = resolveGridPositionsFromStyle(gridItem, autoPlacementMinorAxisDirection()); 759 759 ASSERT(!resolveGridPositionsFromStyle(gridItem, autoPlacementMajorAxisDirection())); 760 760 size_t minorAxisIndex = 0; … … 762 762 minorAxisIndex = minorAxisPositions->initialPositionIndex; 763 763 GridIterator iterator(m_grid, autoPlacementMinorAxisDirection(), minorAxisIndex); 764 if ( OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {764 if (std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) { 765 765 insertItemIntoGrid(gridItem, emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex); 766 766 return; … … 770 770 for (size_t majorAxisIndex = 0; majorAxisIndex < endOfMajorAxis; ++majorAxisIndex) { 771 771 GridIterator iterator(m_grid, autoPlacementMajorAxisDirection(), majorAxisIndex); 772 if ( OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {772 if (std::unique_ptr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) { 773 773 insertItemIntoGrid(gridItem, emptyGridArea->rows.initialPositionIndex, emptyGridArea->columns.initialPositionIndex); 774 774 return; … … 949 949 } 950 950 951 PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, GridTrackSizingDirection direction) const951 std::unique_ptr<GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, GridTrackSizingDirection direction) const 952 952 { 953 953 GridPosition initialPosition = (direction == ForColumns) ? gridItem->style().gridItemColumnStart() : gridItem->style().gridItemRowStart(); … … 960 960 if (initialPosition.shouldBeResolvedAgainstOppositePosition() && finalPosition.shouldBeResolvedAgainstOppositePosition()) { 961 961 if (style().gridAutoFlow() == AutoFlowNone) 962 return adoptPtr(new GridSpan(0, 0));962 return std::make_unique<GridSpan>(0, 0); 963 963 964 964 // We can't get our grid positions without running the auto placement algorithm. … … 985 985 resolvedFinalPosition = resolvedInitialPosition; 986 986 987 return adoptPtr(new GridSpan(resolvedInitialPosition, resolvedFinalPosition));987 return std::make_unique<GridSpan>(resolvedInitialPosition, resolvedFinalPosition); 988 988 } 989 989 … … 1060 1060 } 1061 1061 1062 PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const1062 std::unique_ptr<GridSpan> RenderGrid::resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const 1063 1063 { 1064 1064 if (position.isAuto()) 1065 return GridSpan::create(resolvedOppositePosition, resolvedOppositePosition);1065 return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedOppositePosition); 1066 1066 1067 1067 ASSERT(position.isSpan()); … … 1078 1078 if (side == ColumnStartSide || side == RowStartSide) { 1079 1079 size_t initialResolvedPosition = std::max<int>(0, resolvedOppositePosition - positionOffset); 1080 return GridSpan::create(initialResolvedPosition, resolvedOppositePosition);1081 } 1082 1083 return GridSpan::create(resolvedOppositePosition, resolvedOppositePosition + positionOffset);1084 } 1085 1086 PassOwnPtr<GridSpan> RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const1080 return std::make_unique<GridSpan>(initialResolvedPosition, resolvedOppositePosition); 1081 } 1082 1083 return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedOppositePosition + positionOffset); 1084 } 1085 1086 std::unique_ptr<GridSpan> RenderGrid::resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, GridPositionSide side) const 1087 1087 { 1088 1088 ASSERT(position.isSpan()); … … 1097 1097 // See http://lists.w3.org/Archives/Public/www-style/2013Jun/0394.html. 1098 1098 if (it == gridLinesNames.end()) 1099 return GridSpan::create(resolvedOppositePosition, resolvedOppositePosition);1099 return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedOppositePosition); 1100 1100 1101 1101 if (side == RowStartSide || side == ColumnStartSide) … … 1121 1121 } 1122 1122 1123 PassOwnPtr<GridSpan> RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const1123 std::unique_ptr<GridSpan> RenderGrid::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const 1124 1124 { 1125 1125 size_t gridLineIndex = std::max<int>(0, firstNamedGridLineBeforePosition(resolvedOppositePosition, gridLines) - position.spanPosition() + 1); … … 1127 1127 if (resolvedGridLinePosition > resolvedOppositePosition) 1128 1128 resolvedGridLinePosition = resolvedOppositePosition; 1129 return GridSpan::create(resolvedGridLinePosition, resolvedOppositePosition);1130 } 1131 1132 PassOwnPtr<GridSpan> RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const1129 return std::make_unique<GridSpan>(resolvedGridLinePosition, resolvedOppositePosition); 1130 } 1131 1132 std::unique_ptr<GridSpan> RenderGrid::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines) const 1133 1133 { 1134 1134 size_t firstLineAfterOppositePositionIndex = gridLines.size() - 1; … … 1141 1141 if (resolvedGridLinePosition < resolvedOppositePosition) 1142 1142 resolvedGridLinePosition = resolvedOppositePosition; 1143 return GridSpan::create(resolvedOppositePosition, resolvedGridLinePosition);1143 return std::make_unique<GridSpan>(resolvedOppositePosition, resolvedGridLinePosition); 1144 1144 } 1145 1145 -
trunk/Source/WebCore/rendering/RenderGrid.h
r166299 r166489 114 114 void adjustNamedGridItemPosition(GridPosition&, GridPositionSide) const; 115 115 void adjustGridPositionsFromStyle(GridPosition& initialPosition, GridPosition& finalPosition, GridPositionSide initialPositionSide, GridPositionSide finalPositionSide) const; 116 PassOwnPtr<GridSpan> resolveGridPositionsFromStyle(const RenderBox*, GridTrackSizingDirection) const;116 std::unique_ptr<GridSpan> resolveGridPositionsFromStyle(const RenderBox*, GridTrackSizingDirection) const; 117 117 size_t resolveNamedGridLinePositionFromStyle(const GridPosition&, GridPositionSide) const; 118 118 size_t resolveGridPositionFromStyle(const GridPosition&, GridPositionSide) const; 119 PassOwnPtr<GridSpan> resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const;120 PassOwnPtr<GridSpan> resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const;121 PassOwnPtr<GridSpan> resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const;122 PassOwnPtr<GridSpan> resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const;119 std::unique_ptr<GridSpan> resolveGridPositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const; 120 std::unique_ptr<GridSpan> resolveNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, GridPositionSide) const; 121 std::unique_ptr<GridSpan> resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const; 122 std::unique_ptr<GridSpan> resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition(size_t resolvedOppositePosition, const GridPosition&, const Vector<size_t>&) const; 123 123 124 124 LayoutUnit gridAreaBreadthForChild(const RenderBox* child, GridTrackSizingDirection, const Vector<GridTrack>&) const; -
trunk/Source/WebCore/rendering/RenderImageResource.h
r163415 r166489 30 30 #include "CachedResourceHandle.h" 31 31 #include "StyleImage.h" 32 #include <wtf/PassOwnPtr.h>33 32 34 33 namespace WebCore { -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r166383 r166489 618 618 ASSERT(!m_zOrderListsDirty); 619 619 620 OwnPtr<Vector<RenderLayer*>> posZOrderList;621 OwnPtr<Vector<RenderLayer*>> negZOrderList;620 std::unique_ptr<Vector<RenderLayer*>> posZOrderList; 621 std::unique_ptr<Vector<RenderLayer*>> negZOrderList; 622 622 rebuildZOrderLists(StopAtStackingContexts, posZOrderList, negZOrderList); 623 623 … … 865 865 bool had3DTransform = has3DTransform(); 866 866 867 bool hadTransform = m_transform;867 bool hadTransform = !!m_transform; 868 868 if (hasTransform != hadTransform) { 869 869 if (hasTransform) 870 m_transform = adoptPtr(new TransformationMatrix);870 m_transform = std::make_unique<TransformationMatrix>(); 871 871 else 872 m_transform .clear();872 m_transform = nullptr; 873 873 874 874 // Layers with transforms act as clip rects roots, so clear the cached clip rects here. … … 3928 3928 #if ENABLE(CSS_FILTERS) 3929 3929 3930 PassOwnPtr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext* context, LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed)3930 std::unique_ptr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext* context, LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed) 3931 3931 { 3932 3932 if (context->paintingDisabled()) … … 3941 3941 return nullptr; 3942 3942 3943 OwnPtr<FilterEffectRendererHelper> filterPainter = adoptPtr(new FilterEffectRendererHelper(hasPaintedFilter));3943 auto filterPainter = std::make_unique<FilterEffectRendererHelper>(hasPaintedFilter); 3944 3944 if (!filterPainter->haveFilterEffect()) 3945 3945 return nullptr; … … 3968 3968 // Note that we will still apply the clipping on the final rendering of the filter. 3969 3969 paintingInfo.clipToDirtyRect = !filterInfo->renderer()->hasFilterThatMovesPixels(); 3970 return filterPainter.release();3970 return std::move(filterPainter); 3971 3971 } 3972 3972 return nullptr; … … 4073 4073 GraphicsContext* transparencyLayerContext = context; 4074 4074 #if ENABLE(CSS_FILTERS) 4075 OwnPtr<FilterEffectRendererHelper> filterPainter = setupFilters(context, localPaintingInfo, paintFlags, offsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);4075 std::unique_ptr<FilterEffectRendererHelper> filterPainter = setupFilters(context, localPaintingInfo, paintFlags, offsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed); 4076 4076 if (filterPainter) { 4077 4077 context = filterPainter->filterContext(); … … 4161 4161 if (filterPainter) { 4162 4162 context = applyFilters(filterPainter.get(), transparencyLayerContext, localPaintingInfo, layerFragments); 4163 filterPainter .clear();4163 filterPainter = nullptr; 4164 4164 } 4165 4165 #endif … … 4578 4578 newTransform.translateRight(roundToInt(offset.width()), roundToInt(offset.height())); 4579 4579 4580 childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));4580 childLayer->m_transform = std::make_unique<TransformationMatrix>(newTransform); 4581 4581 4582 4582 LayerPaintingInfo localPaintingInfo(paintingInfo); … … 4585 4585 4586 4586 if (oldHasTransform) 4587 childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));4587 childLayer->m_transform = std::make_unique<TransformationMatrix>(oldTransform); 4588 4588 else 4589 childLayer->m_transform .clear();4589 childLayer->m_transform = nullptr; 4590 4590 } else { 4591 4591 // Adjust the transform such that the renderer's upper left corner will paint at (0,0) in user space. … … 5232 5232 newTransform.translateRight(offset.width(), offset.height()); 5233 5233 5234 childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));5234 childLayer->m_transform = std::make_unique<TransformationMatrix>(newTransform); 5235 5235 hitLayer = childLayer->hitTestLayer(rootLayer, columnLayers[0], request, result, localClipRect, hitTestLocation, false, transformState, zOffset); 5236 5236 if (oldHasTransform) 5237 childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));5237 childLayer->m_transform = std::make_unique<TransformationMatrix>(oldTransform); 5238 5238 else 5239 childLayer->m_transform .clear();5239 childLayer->m_transform = nullptr; 5240 5240 } else { 5241 5241 // Adjust the transform such that the renderer's upper left corner will be at (0,0) in user space. … … 5295 5295 5296 5296 if (!m_clipRectsCache) 5297 m_clipRectsCache = adoptPtr(new ClipRectsCache);5297 m_clipRectsCache = std::make_unique<ClipRectsCache>(); 5298 5298 5299 5299 if (parentLayer && parentLayer->clipRects(clipRectsContext) && clipRects == *parentLayer->clipRects(clipRectsContext)) … … 5925 5925 { 5926 5926 if (!m_backing) { 5927 m_backing = adoptPtr(new RenderLayerBacking(*this));5927 m_backing = std::make_unique<RenderLayerBacking>(*this); 5928 5928 compositor().layerBecameComposited(*this); 5929 5929 … … 5942 5942 if (m_backing && !renderer().documentBeingDestroyed()) 5943 5943 compositor().layerBecameNonComposited(*this); 5944 m_backing .clear();5944 m_backing = nullptr; 5945 5945 5946 5946 #if ENABLE(CSS_FILTERS) … … 6116 6116 } 6117 6117 6118 void RenderLayer::rebuildZOrderLists(CollectLayersBehavior behavior, OwnPtr<Vector<RenderLayer*>>& posZOrderList, OwnPtr<Vector<RenderLayer*>>& negZOrderList)6118 void RenderLayer::rebuildZOrderLists(CollectLayersBehavior behavior, std::unique_ptr<Vector<RenderLayer*>>& posZOrderList, std::unique_ptr<Vector<RenderLayer*>>& negZOrderList) 6119 6119 { 6120 6120 bool includeHiddenLayers = compositor().inCompositingMode(); … … 6142 6142 if (child->isNormalFlowOnly() && (!m_reflection || reflectionLayer() != child)) { 6143 6143 if (!m_normalFlowList) 6144 m_normalFlowList = adoptPtr(new Vector<RenderLayer*>);6144 m_normalFlowList = std::make_unique<Vector<RenderLayer*>>(); 6145 6145 m_normalFlowList->append(child); 6146 6146 } … … 6150 6150 } 6151 6151 6152 void RenderLayer::collectLayers(bool includeHiddenLayers, CollectLayersBehavior behavior, OwnPtr<Vector<RenderLayer*>>& posBuffer, OwnPtr<Vector<RenderLayer*>>& negBuffer)6152 void RenderLayer::collectLayers(bool includeHiddenLayers, CollectLayersBehavior behavior, std::unique_ptr<Vector<RenderLayer*>>& posBuffer, std::unique_ptr<Vector<RenderLayer*>>& negBuffer) 6153 6153 { 6154 6154 updateDescendantDependentFlags(); … … 6159 6159 if (includeHiddenLayer && !isNormalFlowOnly()) { 6160 6160 // Determine which buffer the child should be in. 6161 OwnPtr<Vector<RenderLayer*>>& buffer = (zIndex() >= 0) ? posBuffer : negBuffer;6161 std::unique_ptr<Vector<RenderLayer*>>& buffer = (zIndex() >= 0) ? posBuffer : negBuffer; 6162 6162 6163 6163 // Create the buffer if it doesn't exist yet. 6164 6164 if (!buffer) 6165 buffer = adoptPtr(new Vector<RenderLayer*>);6165 buffer = std::make_unique<Vector<RenderLayer*>>(); 6166 6166 6167 6167 // Append ourselves at the end of the appropriate buffer. … … 6552 6552 if (renderer().style().overflowX() == OMARQUEE && renderer().style().marqueeBehavior() != MNONE && renderer().isBox()) { 6553 6553 if (!m_marquee) 6554 m_marquee = adoptPtr(new RenderMarquee(this));6554 m_marquee = std::make_unique<RenderMarquee>(this); 6555 6555 m_marquee->updateMarqueeStyle(); 6556 6556 } 6557 6557 else if (m_marquee) { 6558 m_marquee .clear();6558 m_marquee = nullptr; 6559 6559 } 6560 6560 -
trunk/Source/WebCore/rendering/RenderLayer.h
r165970 r166489 50 50 #include "RenderPtr.h" 51 51 #include "ScrollableArea.h" 52 #include < wtf/OwnPtr.h>52 #include <memory> 53 53 54 54 namespace WebCore { … … 903 903 void updateZOrderLists(); 904 904 void rebuildZOrderLists(); 905 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*>>&, OwnPtr<Vector<RenderLayer*>>&);905 void rebuildZOrderLists(CollectLayersBehavior, std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&); 906 906 void clearZOrderLists(); 907 907 … … 971 971 LayoutPoint renderBoxLocation() const { return renderer().isBox() ? toRenderBox(renderer()).location() : LayoutPoint(); } 972 972 973 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<Vector<RenderLayer*>>&, OwnPtr<Vector<RenderLayer*>>&);973 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&); 974 974 975 975 void updateCompositingAndLayerListsIfNeeded(); … … 999 999 bool setupClipPath(GraphicsContext*, const LayerPaintingInfo&, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed); 1000 1000 #if ENABLE(CSS_FILTERS) 1001 PassOwnPtr<FilterEffectRendererHelper> setupFilters(GraphicsContext*, LayerPaintingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed);1001 std::unique_ptr<FilterEffectRendererHelper> setupFilters(GraphicsContext*, LayerPaintingInfo&, PaintLayerFlags, const LayoutPoint& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed); 1002 1002 GraphicsContext* applyFilters(FilterEffectRendererHelper*, GraphicsContext* originalContext, LayerPaintingInfo&, LayerFragments&); 1003 1003 #endif … … 1326 1326 // (auto will count as 0). m_negZOrderList holds descendants within our stacking context with negative 1327 1327 // z-indices. 1328 OwnPtr<Vector<RenderLayer*>> m_posZOrderList;1329 OwnPtr<Vector<RenderLayer*>> m_negZOrderList;1328 std::unique_ptr<Vector<RenderLayer*>> m_posZOrderList; 1329 std::unique_ptr<Vector<RenderLayer*>> m_negZOrderList; 1330 1330 1331 1331 // This list contains child layers that cannot create stacking contexts. For now it is just 1332 1332 // overflow layers, but that may change in the future. 1333 OwnPtr<Vector<RenderLayer*>> m_normalFlowList;1334 1335 OwnPtr<ClipRectsCache> m_clipRectsCache;1333 std::unique_ptr<Vector<RenderLayer*>> m_normalFlowList; 1334 1335 std::unique_ptr<ClipRectsCache> m_clipRectsCache; 1336 1336 1337 1337 IntPoint m_cachedOverlayScrollbarOffset; 1338 1338 1339 OwnPtr<RenderMarquee> m_marquee; // Used by layers with overflow:marquee1339 std::unique_ptr<RenderMarquee> m_marquee; // Used by layers with overflow:marquee 1340 1340 1341 1341 // Cached normal flow values for absolute positioned elements with static left/top values. … … 1343 1343 LayoutUnit m_staticBlockPosition; 1344 1344 1345 OwnPtr<TransformationMatrix> m_transform;1345 std::unique_ptr<TransformationMatrix> m_transform; 1346 1346 1347 1347 // May ultimately be extended to many replicas (with their own paint order). … … 1357 1357 IntRect m_blockSelectionGapsBounds; 1358 1358 1359 OwnPtr<RenderLayerBacking> m_backing;1359 std::unique_ptr<RenderLayerBacking> m_backing; 1360 1360 1361 1361 class FilterInfo; … … 1366 1366 ASSERT(!isStackingContainer()); 1367 1367 1368 m_posZOrderList .clear();1369 m_negZOrderList .clear();1368 m_posZOrderList = nullptr; 1369 m_negZOrderList = nullptr; 1370 1370 } 1371 1371 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r166348 r166489 537 537 displayID = page->chrome().displayID(); 538 538 539 m_layerUpdater = adoptPtr(new GraphicsLayerUpdater(this, displayID));539 m_layerUpdater = std::make_unique<GraphicsLayerUpdater>(this, displayID); 540 540 } 541 541 … … 3543 3543 3544 3544 #if PLATFORM(IOS) 3545 typedef HashMap<PlatformLayer*, OwnPtr<ViewportConstraints>> LayerMap;3545 typedef HashMap<PlatformLayer*, std::unique_ptr<ViewportConstraints>> LayerMap; 3546 3546 typedef HashMap<PlatformLayer*, PlatformLayer*> StickyContainerMap; 3547 3547 … … 3575 3575 continue; 3576 3576 3577 layerMap.add(layer.backing()->graphicsLayer()->platformLayer(), adoptPtr(constraints.release()));3577 layerMap.add(layer.backing()->graphicsLayer()->platformLayer(), std::move(constraints)); 3578 3578 } 3579 3579 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r165676 r166489 502 502 #endif 503 503 504 OwnPtr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.504 std::unique_ptr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running. 505 505 506 506 Timer<RenderLayerCompositor> m_layerFlushTimer; -
trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp
r165206 r166489 44 44 namespace WebCore { 45 45 46 HashMap<const RenderLayer*, OwnPtr<RenderLayer::FilterInfo>>& RenderLayer::FilterInfo::map()46 HashMap<const RenderLayer*, std::unique_ptr<RenderLayer::FilterInfo>>& RenderLayer::FilterInfo::map() 47 47 { 48 static NeverDestroyed<HashMap<const RenderLayer*, OwnPtr<FilterInfo>>> map;48 static NeverDestroyed<HashMap<const RenderLayer*, std::unique_ptr<FilterInfo>>> map; 49 49 return map; 50 50 } … … 61 61 ASSERT(layer.m_hasFilterInfo == map().contains(&layer)); 62 62 63 OwnPtr<FilterInfo>& info = map().add(&layer, nullptr).iterator->value;63 auto& info = map().add(&layer, nullptr).iterator->value; 64 64 if (!info) { 65 info = adoptPtr(new FilterInfo(layer));65 info = std::make_unique<FilterInfo>(layer); 66 66 layer.m_hasFilterInfo = true; 67 67 } -
trunk/Source/WebCore/rendering/RenderLayerFilterInfo.h
r165206 r166489 37 37 #include "CachedSVGDocumentClient.h" 38 38 #include "RenderLayer.h" 39 #include <memory> 39 40 40 41 namespace WebCore { … … 49 50 static void remove(RenderLayer&); 50 51 52 explicit FilterInfo(RenderLayer&); 53 ~FilterInfo(); 54 51 55 const LayoutRect& dirtySourceRect() const { return m_dirtySourceRect; } 52 56 void expandDirtySourceRect(const LayoutRect& rect) { m_dirtySourceRect.unite(rect); } … … 60 64 61 65 private: 62 explicit FilterInfo(RenderLayer&);63 ~FilterInfo();64 65 66 Element* layerElement() const; 66 67 … … 69 70 virtual void notifyFinished(CachedResource*) override; 70 71 71 static HashMap<const RenderLayer*, OwnPtr<FilterInfo>>& map();72 static HashMap<const RenderLayer*, std::unique_ptr<FilterInfo>>& map(); 72 73 73 74 #if PLATFORM(IOS) -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r165964 r166489 335 335 ASSERT(isValid()); 336 336 337 OwnPtr<RenderBoxRegionInfo>& boxInfo = m_renderBoxRegionInfo.add(box, adoptPtr(new RenderBoxRegionInfo(logicalLeftInset, logicalRightInset, containingBlockChainIsInset))).iterator->value;337 std::unique_ptr<RenderBoxRegionInfo>& boxInfo = m_renderBoxRegionInfo.add(box, std::make_unique<RenderBoxRegionInfo>(logicalLeftInset, logicalRightInset, containingBlockChainIsInset)).iterator->value; 338 338 return boxInfo.get(); 339 339 } 340 340 341 OwnPtr<RenderBoxRegionInfo> RenderRegion::takeRenderBoxRegionInfo(const RenderBox* box)341 std::unique_ptr<RenderBoxRegionInfo> RenderRegion::takeRenderBoxRegionInfo(const RenderBox* box) 342 342 { 343 343 return m_renderBoxRegionInfo.take(box); -
trunk/Source/WebCore/rendering/RenderRegion.h
r165130 r166489 34 34 #include "StyleInheritedData.h" 35 35 #include "VisiblePosition.h" 36 #include <memory> 36 37 37 38 namespace WebCore { … … 71 72 RenderBoxRegionInfo* setRenderBoxRegionInfo(const RenderBox*, LayoutUnit logicalLeftInset, LayoutUnit logicalRightInset, 72 73 bool containingBlockChainIsInset); 73 OwnPtr<RenderBoxRegionInfo> takeRenderBoxRegionInfo(const RenderBox*);74 std::unique_ptr<RenderBoxRegionInfo> takeRenderBoxRegionInfo(const RenderBox*); 74 75 void removeRenderBoxRegionInfo(const RenderBox*); 75 76 … … 173 174 // is unique to the region. For now it just holds logical width information for RenderBlocks, but eventually 174 175 // it will also hold a custom style for any box (for region styling). 175 typedef HashMap<const RenderBox*, OwnPtr<RenderBoxRegionInfo>> RenderBoxRegionInfoMap;176 typedef HashMap<const RenderBox*, std::unique_ptr<RenderBoxRegionInfo>> RenderBoxRegionInfoMap; 176 177 RenderBoxRegionInfoMap m_renderBoxRegionInfo; 177 178 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r166016 r166489 114 114 // explicit width is specified on the table. Auto width implies auto table layout. 115 115 if (style().tableLayout() == TFIXED && !style().logicalWidth().isAuto()) 116 m_tableLayout = adoptPtr(new FixedTableLayout(this));116 m_tableLayout = std::make_unique<FixedTableLayout>(this); 117 117 else 118 m_tableLayout = adoptPtr(new AutoTableLayout(this));118 m_tableLayout = std::make_unique<AutoTableLayout>(this); 119 119 } 120 120 -
trunk/Source/WebCore/rendering/RenderTable.h
r166016 r166489 29 29 #include "CollapsedBorderValue.h" 30 30 #include "RenderBlock.h" 31 #include <memory> 31 32 #include <wtf/HashMap.h> 32 33 #include <wtf/Vector.h> … … 341 342 mutable RenderTableSection* m_firstBody; 342 343 343 OwnPtr<TableLayout> m_tableLayout;344 std::unique_ptr<TableLayout> m_tableLayout; 344 345 345 346 CollapsedBorderValues m_collapsedBorders; -
trunk/Source/WebCore/rendering/RenderView.cpp
r166079 r166489 660 660 IntRect RenderView::selectionBounds(bool clipToVisibleContent) const 661 661 { 662 typedef HashMap<RenderObject*, OwnPtr<RenderSelectionInfo>> SelectionMap;662 typedef HashMap<RenderObject*, std::unique_ptr<RenderSelectionInfo>> SelectionMap; 663 663 SelectionMap selectedObjects; 664 664 … … 668 668 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) { 669 669 // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well. 670 selectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, clipToVisibleContent)));670 selectedObjects.set(os, std::make_unique<RenderSelectionInfo>(os, clipToVisibleContent)); 671 671 RenderBlock* cb = os->containingBlock(); 672 672 while (cb && !cb->isRenderView()) { 673 OwnPtr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).iterator->value;673 std::unique_ptr<RenderSelectionInfo>& blockInfo = selectedObjects.add(cb, nullptr).iterator->value; 674 674 if (blockInfo) 675 675 break; 676 blockInfo = adoptPtr(new RenderSelectionInfo(cb, clipToVisibleContent));676 blockInfo = std::make_unique<RenderSelectionInfo>(cb, clipToVisibleContent); 677 677 cb = cb->containingBlock(); 678 678 } … … 774 774 775 775 // Objects each have a single selection rect to examine. 776 typedef HashMap<RenderObject*, OwnPtr<RenderSelectionInfo>> SelectedObjectMap;776 typedef HashMap<RenderObject*, std::unique_ptr<RenderSelectionInfo>> SelectedObjectMap; 777 777 SelectedObjectMap oldSelectedObjects; 778 778 SelectedObjectMap newSelectedObjects; … … 781 781 // In order to get the repaint rect right, we have to examine left, middle, and right rects individually, since otherwise 782 782 // the union of those rects might remain the same even when changes have occurred. 783 typedef HashMap<RenderBlock*, OwnPtr<RenderBlockSelectionInfo>> SelectedBlockMap;783 typedef HashMap<RenderBlock*, std::unique_ptr<RenderBlockSelectionInfo>> SelectedBlockMap; 784 784 SelectedBlockMap oldSelectedBlocks; 785 785 SelectedBlockMap newSelectedBlocks; … … 792 792 if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) { 793 793 // Blocks are responsible for painting line gaps and margin gaps. They must be examined as well. 794 oldSelectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, true)));794 oldSelectedObjects.set(os, std::make_unique<RenderSelectionInfo>(os, true)); 795 795 if (blockRepaintMode == RepaintNewXOROld) { 796 796 RenderBlock* cb = os->containingBlock(); 797 797 while (cb && !cb->isRenderView()) { 798 OwnPtr<RenderBlockSelectionInfo>& blockInfo = oldSelectedBlocks.add(cb, nullptr).iterator->value;798 std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = oldSelectedBlocks.add(cb, nullptr).iterator->value; 799 799 if (blockInfo) 800 800 break; 801 blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb));801 blockInfo = std::make_unique<RenderBlockSelectionInfo>(cb); 802 802 cb = cb->containingBlock(); 803 803 } … … 848 848 while (continueExploring) { 849 849 if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionState() != SelectionNone) { 850 newSelectedObjects.set(o, adoptPtr(new RenderSelectionInfo(o, true)));850 newSelectedObjects.set(o, std::make_unique<RenderSelectionInfo>(o, true)); 851 851 RenderBlock* cb = o->containingBlock(); 852 852 while (cb && !cb->isRenderView()) { 853 OwnPtr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks.add(cb, nullptr).iterator->value;853 std::unique_ptr<RenderBlockSelectionInfo>& blockInfo = newSelectedBlocks.add(cb, nullptr).iterator->value; 854 854 if (blockInfo) 855 855 break; 856 blockInfo = adoptPtr(new RenderBlockSelectionInfo(cb));856 blockInfo = std::make_unique<RenderBlockSelectionInfo>(cb); 857 857 cb = cb->containingBlock(); 858 858 } … … 1093 1093 { 1094 1094 if (!m_compositor) 1095 m_compositor = adoptPtr(new RenderLayerCompositor(*this));1095 m_compositor = std::make_unique<RenderLayerCompositor>(*this); 1096 1096 1097 1097 return *m_compositor; … … 1124 1124 { 1125 1125 if (!m_flowThreadController) 1126 m_flowThreadController = FlowThreadController::create(this);1126 m_flowThreadController = std::make_unique<FlowThreadController>(this); 1127 1127 1128 1128 return *m_flowThreadController; … … 1163 1163 { 1164 1164 if (!m_imageQualityController) 1165 m_imageQualityController = ImageQualityController::create(*this);1165 m_imageQualityController = std::make_unique<ImageQualityController>(*this); 1166 1166 return *m_imageQualityController; 1167 1167 } -
trunk/Source/WebCore/rendering/RenderView.h
r166301 r166489 28 28 #include "Region.h" 29 29 #include "RenderBlockFlow.h" 30 #include <memory> 30 31 #include <wtf/HashSet.h> 31 #include <wtf/OwnPtr.h>32 32 33 33 namespace WebCore { … … 322 322 bool shouldUsePrintingLayout() const; 323 323 324 OwnPtr<ImageQualityController> m_imageQualityController;324 std::unique_ptr<ImageQualityController> m_imageQualityController; 325 325 LayoutUnit m_pageLogicalHeight; 326 326 bool m_pageLogicalHeightChanged; 327 327 std::unique_ptr<LayoutState> m_layoutState; 328 328 unsigned m_layoutStateDisableCount; 329 OwnPtr<RenderLayerCompositor> m_compositor;330 OwnPtr<FlowThreadController> m_flowThreadController;329 std::unique_ptr<RenderLayerCompositor> m_compositor; 330 std::unique_ptr<FlowThreadController> m_flowThreadController; 331 331 RefPtr<IntervalArena> m_intervalArena; 332 332 -
trunk/Source/WebCore/rendering/RootInlineBox.h
r163717 r166489 143 143 m_floats->append(&floatingBox); 144 144 else 145 m_floats = adoptPtr(new Vector<RenderBox*>(1, &floatingBox));145 m_floats = std::make_unique<Vector<RenderBox*>>(1, &floatingBox); 146 146 } 147 147 … … 220 220 // Floats hanging off the line are pushed into this vector during layout. It is only 221 221 // good for as long as the line has not been marked dirty. 222 OwnPtr<Vector<RenderBox*>> m_floats;222 std::unique_ptr<Vector<RenderBox*>> m_floats; 223 223 }; 224 224 -
trunk/Source/WebCore/rendering/TextAutosizer.h
r164420 r166489 32 32 #include "WritingMode.h" 33 33 #include <wtf/Noncopyable.h> 34 #include <wtf/PassOwnPtr.h>35 34 36 35 namespace WebCore { -
trunk/Source/WebCore/rendering/shapes/PolygonShape.cpp
r166316 r166489 127 127 } 128 128 129 static inline PassOwnPtr<FloatPolygon> computeShapeMarginBounds(const FloatPolygon& polygon, float margin, WindRule fillRule)130 { 131 OwnPtr<Vector<FloatPoint>> marginVertices = adoptPtr(new Vector<FloatPoint>());129 static inline std::unique_ptr<FloatPolygon> computeShapeMarginBounds(const FloatPolygon& polygon, float margin, WindRule fillRule) 130 { 131 auto marginVertices = std::make_unique<Vector<FloatPoint>>(); 132 132 FloatPoint intersection; 133 133 … … 145 145 146 146 snapVerticesToLayoutUnitGrid(*marginVertices); 147 return adoptPtr(new FloatPolygon(marginVertices.release(), fillRule));147 return std::make_unique<FloatPolygon>(std::move(marginVertices), fillRule); 148 148 } 149 149 -
trunk/Source/WebCore/rendering/shapes/PolygonShape.h
r166316 r166489 83 83 WTF_MAKE_NONCOPYABLE(PolygonShape); 84 84 public: 85 PolygonShape( PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule)86 : m_polygon( vertices, fillRule)85 PolygonShape(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule) 86 : m_polygon(std::move(vertices), fillRule) 87 87 , m_marginBounds(nullptr) 88 88 { … … 99 99 100 100 FloatPolygon m_polygon; 101 mutable OwnPtr<FloatPolygon> m_marginBounds;101 mutable std::unique_ptr<FloatPolygon> m_marginBounds; 102 102 }; 103 103 -
trunk/Source/WebCore/rendering/shapes/RasterShape.cpp
r166316 r166489 164 164 } 165 165 166 PassOwnPtr<RasterShapeIntervals> RasterShapeIntervals::computeShapeMarginIntervals(int shapeMargin) const166 std::unique_ptr<RasterShapeIntervals> RasterShapeIntervals::computeShapeMarginIntervals(int shapeMargin) const 167 167 { 168 168 int marginIntervalsSize = (offset() > shapeMargin) ? size() : size() - offset() * 2 + shapeMargin * 2; 169 OwnPtr<RasterShapeIntervals> result = adoptPtr(new RasterShapeIntervals(marginIntervalsSize, std::max(shapeMargin, offset())));169 auto result = std::make_unique<RasterShapeIntervals>(marginIntervalsSize, std::max(shapeMargin, offset())); 170 170 MarginIntervalGenerator marginIntervalGenerator(shapeMargin); 171 171 … … 194 194 } 195 195 196 return result .release();196 return result; 197 197 } 198 198 -
trunk/Source/WebCore/rendering/shapes/RasterShape.h
r166316 r166489 53 53 void getExcludedIntervals(int y1, int y2, IntShapeIntervals& result) const; 54 54 55 PassOwnPtr<RasterShapeIntervals> computeShapeMarginIntervals(int shapeMargin) const;55 std::unique_ptr<RasterShapeIntervals> computeShapeMarginIntervals(int shapeMargin) const; 56 56 57 57 void buildBoundsPath(Path&) const; … … 92 92 WTF_MAKE_NONCOPYABLE(RasterShape); 93 93 public: 94 RasterShape( PassOwnPtr<RasterShapeIntervals> intervals, const IntSize& marginRectSize)95 : m_intervals( intervals)94 RasterShape(std::unique_ptr<RasterShapeIntervals> intervals, const IntSize& marginRectSize) 95 : m_intervals(std::move(intervals)) 96 96 , m_marginRectSize(marginRectSize) 97 97 { … … 112 112 const RasterShapeIntervals& marginIntervals() const; 113 113 114 OwnPtr<RasterShapeIntervals> m_intervals;115 mutable OwnPtr<RasterShapeIntervals> m_marginIntervals;114 std::unique_ptr<RasterShapeIntervals> m_intervals; 115 mutable std::unique_ptr<RasterShapeIntervals> m_marginIntervals; 116 116 IntSize m_marginRectSize; 117 117 }; -
trunk/Source/WebCore/rendering/shapes/Shape.cpp
r166316 r166489 42 42 #include "WindRule.h" 43 43 #include <wtf/MathExtras.h> 44 #include <wtf/OwnPtr.h>45 #include <wtf/PassOwnPtr.h>46 44 47 45 namespace WebCore { 48 46 49 static PassOwnPtr<Shape> createInsetShape(const FloatRoundedRect& bounds)47 static std::unique_ptr<Shape> createInsetShape(const FloatRoundedRect& bounds) 50 48 { 51 49 ASSERT(bounds.rect().width() >= 0 && bounds.rect().height() >= 0); 52 return adoptPtr(new BoxShape(bounds));53 } 54 55 static PassOwnPtr<Shape> createCircleShape(const FloatPoint& center, float radius)50 return std::make_unique<BoxShape>(bounds); 51 } 52 53 static std::unique_ptr<Shape> createCircleShape(const FloatPoint& center, float radius) 56 54 { 57 55 ASSERT(radius >= 0); 58 return adoptPtr(new RectangleShape(FloatRect(center.x() - radius, center.y() - radius, radius*2, radius*2), FloatSize(radius, radius)));59 } 60 61 static PassOwnPtr<Shape> createEllipseShape(const FloatPoint& center, const FloatSize& radii)56 return std::make_unique<RectangleShape>(FloatRect(center.x() - radius, center.y() - radius, radius*2, radius*2), FloatSize(radius, radius)); 57 } 58 59 static std::unique_ptr<Shape> createEllipseShape(const FloatPoint& center, const FloatSize& radii) 62 60 { 63 61 ASSERT(radii.width() >= 0 && radii.height() >= 0); 64 return adoptPtr(new RectangleShape(FloatRect(center.x() - radii.width(), center.y() - radii.height(), radii.width()*2, radii.height()*2), radii));65 } 66 67 static PassOwnPtr<Shape> createPolygonShape(PassOwnPtr<Vector<FloatPoint>> vertices, WindRule fillRule)68 { 69 return adoptPtr(new PolygonShape(vertices, fillRule));62 return std::make_unique<RectangleShape>(FloatRect(center.x() - radii.width(), center.y() - radii.height(), radii.width()*2, radii.height()*2), radii); 63 } 64 65 static std::unique_ptr<Shape> createPolygonShape(std::unique_ptr<Vector<FloatPoint>> vertices, WindRule fillRule) 66 { 67 return std::make_unique<PolygonShape>(std::move(vertices), fillRule); 70 68 } 71 69 … … 95 93 } 96 94 97 PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, Length margin)95 std::unique_ptr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, Length margin) 98 96 { 99 97 ASSERT(basicShape); … … 102 100 float boxWidth = horizontalWritingMode ? logicalBoxSize.width() : logicalBoxSize.height(); 103 101 float boxHeight = horizontalWritingMode ? logicalBoxSize.height() : logicalBoxSize.width(); 104 OwnPtr<Shape> shape;102 std::unique_ptr<Shape> shape; 105 103 106 104 switch (basicShape->type()) { … … 134 132 size_t valuesSize = values.size(); 135 133 ASSERT(!(valuesSize % 2)); 136 OwnPtr<Vector<FloatPoint>> vertices = adoptPtr(new Vector<FloatPoint>(valuesSize / 2));134 std::unique_ptr<Vector<FloatPoint>> vertices = std::make_unique<Vector<FloatPoint>>(valuesSize / 2); 137 135 for (unsigned i = 0; i < valuesSize; i += 2) { 138 136 FloatPoint vertex( … … 142 140 } 143 141 144 shape = createPolygonShape( vertices.release(), polygon.windRule());142 shape = createPolygonShape(std::move(vertices), polygon.windRule()); 145 143 break; 146 144 } … … 176 174 shape->m_margin = floatValueForLength(margin, 0); 177 175 178 return shape .release();179 } 180 181 PassOwnPtr<Shape> Shape::createRasterShape(Image* image, float threshold, const LayoutRect& imageR, const LayoutRect& marginR, WritingMode writingMode, Length margin)176 return shape; 177 } 178 179 std::unique_ptr<Shape> Shape::createRasterShape(Image* image, float threshold, const LayoutRect& imageR, const LayoutRect& marginR, WritingMode writingMode, Length margin) 182 180 { 183 181 IntRect imageRect = pixelSnappedIntRect(imageR); 184 182 IntRect marginRect = pixelSnappedIntRect(marginR); 185 OwnPtr<RasterShapeIntervals> intervals = adoptPtr(new RasterShapeIntervals(marginRect.height(), -marginRect.y()));183 auto intervals = std::make_unique<RasterShapeIntervals>(marginRect.height(), -marginRect.y()); 186 184 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.size()); 187 185 … … 215 213 } 216 214 217 OwnPtr<RasterShape> rasterShape = adoptPtr(new RasterShape(intervals.release(), marginRect.size()));215 auto rasterShape = std::make_unique<RasterShape>(std::move(intervals), marginRect.size()); 218 216 rasterShape->m_writingMode = writingMode; 219 217 rasterShape->m_margin = floatValueForLength(margin, 0); 220 return rasterShape.release();221 } 222 223 PassOwnPtr<Shape> Shape::createBoxShape(const RoundedRect& roundedRect, WritingMode writingMode, Length margin)218 return std::move(rasterShape); 219 } 220 221 std::unique_ptr<Shape> Shape::createBoxShape(const RoundedRect& roundedRect, WritingMode writingMode, Length margin) 224 222 { 225 223 ASSERT(roundedRect.rect().width() >= 0 && roundedRect.rect().height() >= 0); … … 227 225 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height()); 228 226 FloatRoundedRect bounds(rect, roundedRect.radii()); 229 OwnPtr<Shape> shape = adoptPtr(new BoxShape(bounds));227 auto shape = std::make_unique<BoxShape>(bounds); 230 228 shape->m_writingMode = writingMode; 231 229 shape->m_margin = floatValueForLength(margin, 0); 232 230 233 return s hape.release();231 return std::move(shape); 234 232 } 235 233 -
trunk/Source/WebCore/rendering/shapes/Shape.h
r166316 r166489 37 37 #include "StyleImage.h" 38 38 #include "WritingMode.h" 39 #include < wtf/PassOwnPtr.h>39 #include <memory> 40 40 #include <wtf/Vector.h> 41 41 … … 68 68 }; 69 69 70 static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, Length margin);71 static PassOwnPtr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& imageRect, const LayoutRect& marginRect, WritingMode, Length margin);72 static PassOwnPtr<Shape> createBoxShape(const RoundedRect&, WritingMode, Length margin);70 static std::unique_ptr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, Length margin); 71 static std::unique_ptr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& imageRect, const LayoutRect& marginRect, WritingMode, Length margin); 72 static std::unique_ptr<Shape> createBoxShape(const RoundedRect&, WritingMode, Length margin); 73 73 74 74 virtual ~Shape() { } -
trunk/Source/WebCore/rendering/shapes/ShapeInfo.h
r165843 r166489 38 38 #include "Shape.h" 39 39 #include "ShapeValue.h" 40 #include < wtf/OwnPtr.h>40 #include <memory> 41 41 #include <wtf/Vector.h> 42 42 … … 91 91 virtual bool lineOverlapsShapeBounds() const = 0; 92 92 93 void markShapeAsDirty() { m_shape .clear(); }94 bool isShapeDirty() { return !m_shape .get(); }93 void markShapeAsDirty() { m_shape = nullptr; } 94 bool isShapeDirty() { return !m_shape; } 95 95 const RenderType& owner() const { return m_renderer; } 96 96 LayoutSize referenceBoxLogicalSize() const { return m_referenceBoxLogicalSize; } … … 149 149 150 150 private: 151 mutable OwnPtr<Shape> m_shape;151 mutable std::unique_ptr<Shape> m_shape; 152 152 LayoutSize m_referenceBoxLogicalSize; 153 153 }; -
trunk/Source/WebCore/rendering/style/ContentData.h
r164224 r166489 29 29 #include "StyleImage.h" 30 30 #include "RenderPtr.h" 31 #include <wtf/OwnPtr.h>32 31 33 32 namespace WebCore { -
trunk/Source/WebCore/rendering/style/CounterDirectives.cpp
r127826 r166489 22 22 #include "config.h" 23 23 #include "CounterDirectives.h" 24 #include <wtf/PassOwnPtr.h>25 24 26 25 namespace WebCore { … … 34 33 } 35 34 36 PassOwnPtr<CounterDirectiveMap> clone(const CounterDirectiveMap& counterDirectives)35 std::unique_ptr<CounterDirectiveMap> clone(const CounterDirectiveMap& counterDirectives) 37 36 { 38 OwnPtr<CounterDirectiveMap> result = adoptPtr(new CounterDirectiveMap);37 auto result = std::make_unique<CounterDirectiveMap>(); 39 38 *result = counterDirectives; 40 return result.release();39 return std::move(result); 41 40 } 42 41 -
trunk/Source/WebCore/rendering/style/CounterDirectives.h
r127826 r166489 26 26 #define CounterDirectives_h 27 27 28 #include <memory> 28 29 #include <wtf/HashMap.h> 29 30 #include <wtf/MathExtras.h> … … 105 106 typedef HashMap<AtomicString, CounterDirectives> CounterDirectiveMap; 106 107 107 PassOwnPtr<CounterDirectiveMap> clone(const CounterDirectiveMap&);108 std::unique_ptr<CounterDirectiveMap> clone(const CounterDirectiveMap&); 108 109 109 110 } // namespace WebCore -
trunk/Source/WebCore/rendering/style/GridCoordinate.h
r164659 r166489 36 36 37 37 #include <wtf/HashMap.h> 38 #include <wtf/PassOwnPtr.h>39 38 #include <wtf/text/WTFString.h> 40 39 … … 46 45 class GridSpan { 47 46 public: 48 static PassOwnPtr<GridSpan> create(size_t initialPosition, size_t finalPosition)49 {50 return adoptPtr(new GridSpan(initialPosition, finalPosition));51 }52 53 47 GridSpan(size_t initialPosition, size_t finalPosition) 54 48 : initialPositionIndex(initialPosition) -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r166465 r166489 261 261 262 262 if (!m_cachedPseudoStyles) 263 m_cachedPseudoStyles = adoptPtr(new PseudoStyleCache);263 m_cachedPseudoStyles = std::make_unique<PseudoStyleCache>(); 264 264 265 265 m_cachedPseudoStyles->append(pseudo); … … 1114 1114 CounterDirectiveMap& RenderStyle::accessCounterDirectives() 1115 1115 { 1116 OwnPtr<CounterDirectiveMap>& map = rareNonInheritedData.access()->m_counterDirectives;1116 auto& map = rareNonInheritedData.access()->m_counterDirectives; 1117 1117 if (!map) 1118 map = adoptPtr(new CounterDirectiveMap);1118 map = std::make_unique<CounterDirectiveMap>(); 1119 1119 return *map; 1120 1120 } … … 1270 1270 { 1271 1271 if (!rareNonInheritedData.access()->m_animations) 1272 rareNonInheritedData.access()->m_animations = adoptPtr(new AnimationList());1272 rareNonInheritedData.access()->m_animations = std::make_unique<AnimationList>(); 1273 1273 return rareNonInheritedData->m_animations.get(); 1274 1274 } … … 1277 1277 { 1278 1278 if (!rareNonInheritedData.access()->m_transitions) 1279 rareNonInheritedData.access()->m_transitions = adoptPtr(new AnimationList());1279 rareNonInheritedData.access()->m_transitions = std::make_unique<AnimationList>(); 1280 1280 return rareNonInheritedData->m_transitions.get(); 1281 1281 } -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r166469 r166489 69 69 #include "TransformOperations.h" 70 70 #include "UnicodeBidi.h" 71 #include <memory> 71 72 #include <wtf/Forward.h> 72 #include <wtf/OwnPtr.h>73 73 #include <wtf/RefCounted.h> 74 74 #include <wtf/StdLibExtras.h> … … 403 403 404 404 // list of associated pseudo styles 405 OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;405 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; 406 406 407 407 DataRef<SVGRenderStyle> m_svgStyle; … … 1554 1554 void clearAnimations() 1555 1555 { 1556 rareNonInheritedData.access()->m_animations .clear();1556 rareNonInheritedData.access()->m_animations = nullptr; 1557 1557 } 1558 1558 1559 1559 void clearTransitions() 1560 1560 { 1561 rareNonInheritedData.access()->m_transitions .clear();1562 } 1563 1564 void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? adoptPtr(new AnimationList(*parent)) : nullptr; }1565 void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? adoptPtr(new AnimationList(*parent)) : nullptr; }1561 rareNonInheritedData.access()->m_transitions = nullptr; 1562 } 1563 1564 void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? std::make_unique<AnimationList>(*parent) : nullptr; } 1565 void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? std::make_unique<AnimationList>(*parent) : nullptr; } 1566 1566 void adjustAnimations(); 1567 1567 void adjustTransitions(); -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r166465 r166489 123 123 , m_boxShadow(o.m_boxShadow ? std::make_unique<ShadowData>(*o.m_boxShadow) : nullptr) 124 124 , m_boxReflect(o.m_boxReflect) 125 , m_animations(o.m_animations ? adoptPtr(new AnimationList(*o.m_animations)) : nullptr)126 , m_transitions(o.m_transitions ? adoptPtr(new AnimationList(*o.m_transitions)) : nullptr)125 , m_animations(o.m_animations ? std::make_unique<AnimationList>(*o.m_animations) : nullptr) 126 , m_transitions(o.m_transitions ? std::make_unique<AnimationList>(*o.m_transitions) : nullptr) 127 127 , m_mask(o.m_mask) 128 128 , m_maskBoxImage(o.m_maskBoxImage) -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r166316 r166489 35 35 #include "NinePieceImage.h" 36 36 #include "ShapeValue.h" 37 #include < wtf/OwnPtr.h>37 #include <memory> 38 38 #include <wtf/PassRefPtr.h> 39 39 #include <wtf/Vector.h> … … 126 126 127 127 std::unique_ptr<ContentData> m_content; 128 OwnPtr<CounterDirectiveMap> m_counterDirectives;128 std::unique_ptr<CounterDirectiveMap> m_counterDirectives; 129 129 String m_altText; 130 130 … … 133 133 RefPtr<StyleReflection> m_boxReflect; 134 134 135 OwnPtr<AnimationList> m_animations;136 OwnPtr<AnimationList> m_transitions;135 std::unique_ptr<AnimationList> m_animations; 136 std::unique_ptr<AnimationList> m_transitions; 137 137 138 138 FillLayer m_mask; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
r163440 r166489 121 121 return false; 122 122 123 OwnPtr<GradientData>& gradientData = m_gradientMap.add(&renderer, nullptr).iterator->value;123 auto& gradientData = m_gradientMap.add(&renderer, nullptr).iterator->value; 124 124 if (!gradientData) 125 gradientData = adoptPtr(new GradientData);125 gradientData = std::make_unique<GradientData>(); 126 126 127 127 bool isPaintingText = resourceMode & ApplyToTextMode; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h
r163440 r166489 27 27 #include "RenderSVGResourceContainer.h" 28 28 #include "SVGGradientElement.h" 29 29 #include <memory> 30 30 #include <wtf/HashMap.h> 31 31 … … 68 68 private: 69 69 bool m_shouldCollectGradientAttributes : 1; 70 HashMap<RenderObject*, OwnPtr<GradientData>> m_gradientMap;70 HashMap<RenderObject*, std::unique_ptr<GradientData>> m_gradientMap; 71 71 72 72 #if USE(CG) -
trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
r163440 r166489 107 107 108 108 // Build pattern. 109 OwnPtr<PatternData> patternData = adoptPtr(new PatternData);109 auto patternData = std::make_unique<PatternData>(); 110 110 patternData->pattern = Pattern::create(copiedImage, true, true); 111 111 … … 130 130 // failures in the SVG image cache for example). To avoid having our PatternData deleted by 131 131 // removeAllClientsFromCache(), we only make it visible in the cache at the very end. 132 return m_patternMap.set(object, patternData.release()).iterator->value.get();132 return m_patternMap.set(object, std::move(patternData)).iterator->value.get(); 133 133 } 134 134 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.h
r163440 r166489 28 28 #include "SVGPatternElement.h" 29 29 #include "SVGUnitTypes.h" 30 30 #include <memory> 31 31 #include <wtf/HashMap.h> 32 32 … … 67 67 bool m_shouldCollectPatternAttributes : 1; 68 68 PatternAttributes m_attributes; 69 HashMap<RenderObject*, OwnPtr<PatternData>> m_patternMap;69 HashMap<RenderObject*, std::unique_ptr<PatternData>> m_patternMap; 70 70 }; 71 71 -
trunk/Source/WebCore/rendering/svg/RenderSVGShape.cpp
r165607 r166489 78 78 void RenderSVGShape::updateShapeFromElement() 79 79 { 80 m_path.clear(); 81 m_path = adoptPtr(new Path); 80 m_path = std::make_unique<Path>(); 82 81 ASSERT(RenderSVGShape::isEmpty()); 83 82 -
trunk/Source/WebCore/rendering/svg/RenderSVGShape.h
r165676 r166489 32 32 #include "SVGGraphicsElement.h" 33 33 #include "SVGMarkerData.h" 34 #include < wtf/OwnPtr.h>34 #include <memory> 35 35 #include <wtf/Vector.h> 36 36 … … 125 125 FloatRect m_repaintBoundingBoxExcludingShadow; 126 126 AffineTransform m_localTransform; 127 OwnPtr<Path> m_path;127 std::unique_ptr<Path> m_path; 128 128 Vector<MarkerPosition> m_markerPositions; 129 129 -
trunk/Source/WebCore/rendering/svg/SVGResources.cpp
r165607 r166489 447 447 448 448 if (!m_clipperFilterMaskerData) 449 m_clipperFilterMaskerData = ClipperFilterMaskerData::create();449 m_clipperFilterMaskerData = std::make_unique<ClipperFilterMaskerData>(); 450 450 451 451 m_clipperFilterMaskerData->clipper = clipper; … … 469 469 470 470 if (!m_clipperFilterMaskerData) 471 m_clipperFilterMaskerData = ClipperFilterMaskerData::create();471 m_clipperFilterMaskerData = std::make_unique<ClipperFilterMaskerData>(); 472 472 473 473 m_clipperFilterMaskerData->filter = filter; … … 491 491 492 492 if (!m_markerData) 493 m_markerData = MarkerData::create();493 m_markerData = std::make_unique<MarkerData>(); 494 494 495 495 m_markerData->markerStart = markerStart; … … 512 512 513 513 if (!m_markerData) 514 m_markerData = MarkerData::create();514 m_markerData = std::make_unique<MarkerData>(); 515 515 516 516 m_markerData->markerMid = markerMid; … … 533 533 534 534 if (!m_markerData) 535 m_markerData = MarkerData::create();535 m_markerData = std::make_unique<MarkerData>(); 536 536 537 537 m_markerData->markerEnd = markerEnd; … … 554 554 555 555 if (!m_clipperFilterMaskerData) 556 m_clipperFilterMaskerData = ClipperFilterMaskerData::create();556 m_clipperFilterMaskerData = std::make_unique<ClipperFilterMaskerData>(); 557 557 558 558 m_clipperFilterMaskerData->masker = masker; … … 577 577 578 578 if (!m_fillStrokeData) 579 m_fillStrokeData = FillStrokeData::create();579 m_fillStrokeData = std::make_unique<FillStrokeData>(); 580 580 581 581 m_fillStrokeData->fill = fill; … … 600 600 601 601 if (!m_fillStrokeData) 602 m_fillStrokeData = FillStrokeData::create();602 m_fillStrokeData = std::make_unique<FillStrokeData>(); 603 603 604 604 m_fillStrokeData->stroke = stroke; -
trunk/Source/WebCore/rendering/svg/SVGResources.h
r163440 r166489 21 21 #define SVGResources_h 22 22 23 #include <memory> 23 24 #include <wtf/HashSet.h> 24 25 #include <wtf/Noncopyable.h> 25 #include <wtf/OwnPtr.h>26 #include <wtf/PassOwnPtr.h>27 26 28 27 namespace WebCore { … … 125 124 } 126 125 127 static PassOwnPtr<ClipperFilterMaskerData> create()128 {129 return adoptPtr(new ClipperFilterMaskerData);130 }131 132 126 RenderSVGResourceClipper* clipper; 133 127 #if ENABLE(FILTERS) … … 147 141 , markerEnd(0) 148 142 { 149 }150 151 static PassOwnPtr<MarkerData> create()152 {153 return adoptPtr(new MarkerData);154 143 } 155 144 … … 172 161 } 173 162 174 static PassOwnPtr<FillStrokeData> create()175 {176 return adoptPtr(new FillStrokeData);177 }178 179 163 RenderSVGResourceContainer* fill; 180 164 RenderSVGResourceContainer* stroke; 181 165 }; 182 166 183 OwnPtr<ClipperFilterMaskerData> m_clipperFilterMaskerData;184 OwnPtr<MarkerData> m_markerData;185 OwnPtr<FillStrokeData> m_fillStrokeData;167 std::unique_ptr<ClipperFilterMaskerData> m_clipperFilterMaskerData; 168 std::unique_ptr<MarkerData> m_markerData; 169 std::unique_ptr<FillStrokeData> m_fillStrokeData; 186 170 RenderSVGResourceContainer* m_linkedResource; 187 171 }; -
trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp
r163440 r166489 43 43 44 44 // Build a list of all resources associated with the passed RenderObject 45 OwnPtr<SVGResources> newResources = adoptPtr(new SVGResources);45 auto newResources = std::make_unique<SVGResources>(); 46 46 if (!newResources->buildCachedResources(renderer, svgStyle)) 47 47 return; 48 48 49 49 // Put object in cache. 50 SVGResources& resources = *m_cache.add(&renderer, newResources.release()).iterator->value;50 SVGResources& resources = *m_cache.add(&renderer, std::move(newResources)).iterator->value; 51 51 52 52 // Run cycle-detection _afterwards_, so self-references can be caught as well. … … 64 64 void SVGResourcesCache::removeResourcesFromRenderer(RenderElement& renderer) 65 65 { 66 OwnPtr<SVGResources> resources = m_cache.take(&renderer);66 std::unique_ptr<SVGResources> resources = m_cache.take(&renderer); 67 67 if (!resources) 68 68 return; -
trunk/Source/WebCore/rendering/svg/SVGResourcesCache.h
r163440 r166489 22 22 23 23 #include "RenderStyleConstants.h" 24 #include <memory> 24 25 #include <wtf/HashMap.h> 25 #include <wtf/ OwnPtr.h>26 #include <wtf/Noncopyable.h> 26 27 27 28 namespace WebCore { … … 63 64 void removeResourcesFromRenderer(RenderElement&); 64 65 65 typedef HashMap<const RenderObject*, OwnPtr<SVGResources>> CacheMap;66 typedef HashMap<const RenderObject*, std::unique_ptr<SVGResources>> CacheMap; 66 67 CacheMap m_cache; 67 68 }; -
trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
r166120 r166489 105 105 106 106 if (m_isComplexText) 107 m_simpleWidthIterator .clear();107 m_simpleWidthIterator = nullptr; 108 108 else 109 m_simpleWidthIterator = adoptPtr(new WidthIterator(&scaledFont, m_run));109 m_simpleWidthIterator = std::make_unique<WidthIterator>(&scaledFont, m_run); 110 110 } 111 111 -
trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h
r163440 r166489 57 57 58 58 // Simple text only. 59 OwnPtr<WidthIterator> m_simpleWidthIterator;59 std::unique_ptr<WidthIterator> m_simpleWidthIterator; 60 60 61 61 // Complex text only.
Note: See TracChangeset
for help on using the changeset viewer.