Changeset 161493 in webkit


Ignore:
Timestamp:
Jan 8, 2014 3:20:11 AM (10 years ago)
Author:
akling@apple.com
Message:

RenderMathMLRow::createAnonymousWithParentRenderer() should return RenderPtr.
<https://webkit.org/b/126631>

Reviewed by Antti Koivisto.

  • rendering/mathml/RenderMathMLRow.h:
  • rendering/mathml/RenderMathMLRow.cpp:

(WebCore::RenderMathMLRow::createAnonymousWithParentRenderer):

Tweak to return RenderPtr<RenderMathMLRow> and removed comment(!)
about how this should return a smart pointer. Also take the
parent renderer as a RenderMathMLRoot& instead of a RenderObject*
since that's all we ever pass.

  • rendering/mathml/RenderMathMLRoot.cpp:

(WebCore::RenderMathMLRoot::addChild):

Updated for new createAnonymousWithParentRenderer() signature.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r161492 r161493  
     12014-01-08  Andreas Kling  <akling@apple.com>
     2
     3        RenderMathMLRow::createAnonymousWithParentRenderer() should return RenderPtr.
     4        <https://webkit.org/b/126631>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * rendering/mathml/RenderMathMLRow.h:
     9        * rendering/mathml/RenderMathMLRow.cpp:
     10        (WebCore::RenderMathMLRow::createAnonymousWithParentRenderer):
     11
     12            Tweak to return RenderPtr<RenderMathMLRow> and removed comment(!)
     13            about how this should return a smart pointer. Also take the
     14            parent renderer as a RenderMathMLRoot& instead of a RenderObject*
     15            since that's all we ever pass.
     16
     17        * rendering/mathml/RenderMathMLRoot.cpp:
     18        (WebCore::RenderMathMLRoot::addChild):
     19
     20            Updated for new createAnonymousWithParentRenderer() signature.
     21
    1222014-01-08  Mario Sanchez Prada  <mario.prada@samsung.com>
    223
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp

    r160598 r161493  
    164164    // to measure and store a glyph-based height for preferredLogicalHeightAfterSizing.
    165165    if (!firstChild())
    166         RenderMathMLBlock::addChild(RenderMathMLRow::createAnonymousWithParentRenderer(this));
     166        RenderMathMLBlock::addChild(RenderMathMLRow::createAnonymousWithParentRenderer(*this).leakPtr());
    167167   
    168168    // An <mroot>'s index has { position: absolute }.
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp

    r160598 r161493  
    3333#include "RenderIterator.h"
    3434#include "RenderMathMLOperator.h"
     35#include "RenderMathMLRoot.h"
    3536
    3637namespace WebCore {
     
    4849}
    4950
    50 // FIXME: Change all these createAnonymous... routines to return a PassOwnPtr<>.
    51 RenderMathMLRow* RenderMathMLRow::createAnonymousWithParentRenderer(const RenderObject* parent)
     51RenderPtr<RenderMathMLRow> RenderMathMLRow::createAnonymousWithParentRenderer(RenderMathMLRoot& parent)
    5252{
    53     RenderMathMLRow* newMRow = new RenderMathMLRow(parent->document(), RenderStyle::createAnonymousStyleWithDisplay(&parent->style(), FLEX));
     53    RenderPtr<RenderMathMLRow> newMRow = createRenderer<RenderMathMLRow>(parent.document(), RenderStyle::createAnonymousStyleWithDisplay(&parent.style(), FLEX));
    5454    newMRow->initializeStyle();
    5555    return newMRow;
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.h

    r159009 r161493  
    3232
    3333namespace WebCore {
    34    
     34
     35class RenderMathMLRoot;
     36
    3537class RenderMathMLRow : public RenderMathMLBlock {
    3638public:
     
    3840    RenderMathMLRow(Document&, PassRef<RenderStyle>);
    3941
    40     static RenderMathMLRow* createAnonymousWithParentRenderer(const RenderObject*);
     42    static RenderPtr<RenderMathMLRow> createAnonymousWithParentRenderer(RenderMathMLRoot&);
    4143
    4244protected:
Note: See TracChangeset for help on using the changeset viewer.