Changeset 65919 in webkit


Ignore:
Timestamp:
Aug 24, 2010 11:37:32 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-08-24 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Deploy adoptPtr in WebCore/editing
https://bugs.webkit.org/show_bug.cgi?id=44501

  • editing/Editor.cpp: (WebCore::Editor::Editor):
  • editing/TextIterator.cpp: (WebCore::plainTextToMallocAllocatedBuffer):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65918 r65919  
     12010-08-24  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Deploy adoptPtr in WebCore/editing
     6        https://bugs.webkit.org/show_bug.cgi?id=44501
     7
     8        * editing/Editor.cpp:
     9        (WebCore::Editor::Editor):
     10        * editing/TextIterator.cpp:
     11        (WebCore::plainTextToMallocAllocatedBuffer):
     12
    1132010-08-24  Adam Barth  <abarth@webkit.org>
    214
  • trunk/WebCore/editing/Editor.cpp

    r65912 r65919  
    998998Editor::Editor(Frame* frame)
    999999    : m_frame(frame)
    1000     , m_deleteButtonController(new DeleteButtonController(frame))
     1000    , m_deleteButtonController(adoptPtr(new DeleteButtonController(frame)))
    10011001    , m_ignoreCompositionSelectionChange(false)
    10021002    , m_shouldStartNewKillRingSequence(false)
    10031003    // This is off by default, since most editors want this behavior (this matches IE but not FF).
    10041004    , m_shouldStyleWithCSS(false)
    1005     , m_killRing(new KillRing)
     1005    , m_killRing(adoptPtr(new KillRing))
    10061006{
    10071007}
  • trunk/WebCore/editing/TextIterator.cpp

    r65468 r65919  
    22242224    bufferLength = 0;
    22252225    typedef pair<UChar*, unsigned> TextSegment;
    2226     Vector<TextSegment>* textSegments = 0;
     2226    OwnPtr<Vector<TextSegment> > textSegments;
    22272227    Vector<UChar> textBuffer;
    22282228    textBuffer.reserveInitialCapacity(cMaxSegmentSize);
     
    22342234            memcpy(newSegmentBuffer, textBuffer.data(), textBuffer.size() * sizeof(UChar));
    22352235            if (!textSegments)
    2236                 textSegments = new Vector<TextSegment>;
     2236                textSegments = adoptPtr(new Vector<TextSegment>);
    22372237            textSegments->append(make_pair(newSegmentBuffer, (unsigned)textBuffer.size()));
    22382238            textBuffer.clear();
     
    22682268        for (unsigned i = 0; i < size; ++i)
    22692269            free(textSegments->at(i).first);
    2270         delete textSegments;
     2270        textSegments.clear();
    22712271    }
    22722272   
Note: See TracChangeset for help on using the changeset viewer.