Changeset 44096 in webkit


Ignore:
Timestamp:
May 23, 2009 9:39:34 AM (15 years ago)
Author:
ddkilzer@apple.com
Message:

Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr

<https://bugs.webkit.org/show_bug.cgi?id=25495>

Reviewed by Oliver Hunt.

WebCore:

No test cases added since there is no change in behavior.

  • WebCore.base.exp: Updated export for HistoryItem::setRedirectURLs() which now takes a PassOwnPtr.
  • dom/Node.cpp: (WebCore::Node::childNodes): Use NodeListsNodeData::create() instead of new NodeListsNodeData. (WebCore::Node::registerDynamicNodeList): Ditto. (WebCore::Node::getElementsByTagNameNS): Ditto. (WebCore::Node::getElementsByName): Ditto. (WebCore::Node::getElementsByClassName): Ditto.
  • dom/NodeRareData.h: (WebCore::NodeListsNodeData::create): Added. Implements create() pattern popularized by RefCounted classes. (WebCore::NodeListsNodeData::NodeListsNodeData): Declared private constructor. (WebCore::NodeRareData::setNodeLists): Now takes a PassOwnPtr<> instead of an auto_ptr<>.
  • history/HistoryItem.cpp: (WebCore::HistoryItem::setRedirectURLs): Ditto.
  • history/HistoryItem.h: (WebCore::HistoryItem::setRedirectURLs): Ditto.
  • html/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawTextInternal): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer): Updated to use assignment operator now that ImageBuffer::create() returns a PassOwnPtr<>.
  • loader/EmptyClients.h: (WebCore::EmptyChromeClient::createHTMLParserQuirks): Return a PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.
  • page/ChromeClient.h: (WebCore::ChromeClient::createHTMLParserQuirks): Ditto.
  • platform/graphics/GeneratedImage.cpp: (WebCore::GeneratedImage::drawPattern): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::create): Return PassOwnPtr<> instead of auto_ptr<>. Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::paint): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • platform/text/TextCodec.h: (WebCore::NewTextCodecFunction): Return PassOwnPtr<> instead of auto_ptr<>.
  • platform/text/TextCodecICU.cpp: (WebCore::newTextCodecICU): Ditto.
  • platform/text/TextCodecLatin1.cpp: (WebCore::newStreamingTextDecoderWindowsLatin1): Ditto.
  • platform/text/TextCodecUTF16.cpp: (WebCore::newStreamingTextDecoderUTF16LE): Ditto. (WebCore::newStreamingTextDecoderUTF16BE): Ditto.
  • platform/text/TextCodecUserDefined.cpp: (WebCore::newStreamingTextDecoderUserDefined): Ditto.
  • platform/text/TextEncodingRegistry.cpp: (WebCore::newTextCodec): Ditto.
  • platform/text/TextEncodingRegistry.h: (WebCore::newTextCodec): Ditto.
  • platform/text/mac/TextCodecMac.cpp: (WebCore::newTextCodecMac): Ditto.
  • rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::drawMaskerContent): Ditto. Return OwnPtr<> instead of auto_ptr<>.
  • svg/SVGMaskElement.h: (WebCore::SVGMaskElement::drawMaskerContent): Return OwnPtr<> instead of auto_ptr<>.
  • svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::buildPattern): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImageForCurrentFrame): Updated to use assignment operator now that ImageBuffer::create() returns a PassOwnPtr<>.
  • svg/graphics/SVGPaintServerGradient.cpp: (WebCore::createMaskAndSwapContextForTextGradient): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • svg/graphics/SVGPaintServerPattern.cpp: (WebCore::SVGPaintServerPattern::setTile): Updated to take a PassOwnPtr<> instead of an auto_ptr<>. (WebCore::SVGPaintServerPattern::setup): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • svg/graphics/SVGPaintServerPattern.h: (WebCore::SVGPaintServerPattern::setTile): Updated to take a PassOwnPtr<> instead of an auto_ptr<>.
  • svg/graphics/SVGResourceMasker.cpp: (WebCore::SVGResourceMasker::applyMask): Updated to use assignment operator now that SVGMaskElement::drawMaskerContent() returns a PassOwnPtr<>. Use OwnPtr<> instead of auto_ptr<> for stack variable.

WebKit/gtk:

  • WebCoreSupport/ChromeClientGtk.h: (WebKit::ChromeClient::createHTMLParserQuirks): Return a PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.

WebKit/mac:

  • History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): Return 0 instead of an empty auto_ptr<>.
  • History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): Use OwnPtr<> instead of auto_ptr<> for stack variable.
  • WebCoreSupport/WebChromeClient.h: (WebChromeClient::createHTMLParserQuirks): Return a PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.

WebKit/qt:

  • WebCoreSupport/ChromeClientQt.h: (WebCore::ChromeClientQt::createHTMLParserQuirks): Return a PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.

WebKit/win:

  • WebCoreSupport/WebChromeClient.h: (WebChromeClient::createHTMLParserQuirks): Return a PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.

WebKit/wx:

  • WebKitSupport/ChromeClientWx.h: (WebCore::ChromeClientWx::createHTMLParserQuirks): Return a PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.
Location:
trunk
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44095 r44096  
     12009-05-23  David Kilzer  <ddkilzer@apple.com>
     2
     3        Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=25495>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        No test cases added since there is no change in behavior.
     10
     11        * WebCore.base.exp: Updated export for
     12        HistoryItem::setRedirectURLs() which now takes a PassOwnPtr.
     13        * dom/Node.cpp:
     14        (WebCore::Node::childNodes): Use NodeListsNodeData::create()
     15        instead of new NodeListsNodeData.
     16        (WebCore::Node::registerDynamicNodeList): Ditto.
     17        (WebCore::Node::getElementsByTagNameNS): Ditto.
     18        (WebCore::Node::getElementsByName): Ditto.
     19        (WebCore::Node::getElementsByClassName): Ditto.
     20        * dom/NodeRareData.h:
     21        (WebCore::NodeListsNodeData::create): Added.  Implements
     22        create() pattern popularized by RefCounted classes.
     23        (WebCore::NodeListsNodeData::NodeListsNodeData): Declared
     24        private constructor.
     25        (WebCore::NodeRareData::setNodeLists): Now takes a PassOwnPtr<>
     26        instead of an auto_ptr<>.
     27        * history/HistoryItem.cpp:
     28        (WebCore::HistoryItem::setRedirectURLs): Ditto.
     29        * history/HistoryItem.h:
     30        (WebCore::HistoryItem::setRedirectURLs): Ditto.
     31        * html/CanvasRenderingContext2D.cpp:
     32        (WebCore::CanvasRenderingContext2D::drawTextInternal): Use
     33        OwnPtr<> instead of auto_ptr<> for stack variable.
     34        * html/HTMLCanvasElement.cpp:
     35        (WebCore::HTMLCanvasElement::createImageBuffer): Updated to use
     36        assignment operator now that ImageBuffer::create() returns a
     37        PassOwnPtr<>.
     38        * loader/EmptyClients.h:
     39        (WebCore::EmptyChromeClient::createHTMLParserQuirks): Return a
     40        PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.
     41        * page/ChromeClient.h:
     42        (WebCore::ChromeClient::createHTMLParserQuirks): Ditto.
     43        * platform/graphics/GeneratedImage.cpp:
     44        (WebCore::GeneratedImage::drawPattern): Use OwnPtr<> instead of
     45        auto_ptr<> for stack variable.
     46        * platform/graphics/ImageBuffer.h:
     47        (WebCore::ImageBuffer::create): Return PassOwnPtr<> instead of
     48        auto_ptr<>.  Use OwnPtr<> instead of auto_ptr<> for stack
     49        variable.
     50        * platform/mac/ScrollbarThemeMac.mm:
     51        (WebCore::ScrollbarThemeMac::paint): Use OwnPtr<> instead of
     52        auto_ptr<> for stack variable.
     53        * platform/text/TextCodec.h:
     54        (WebCore::NewTextCodecFunction): Return PassOwnPtr<> instead of
     55        auto_ptr<>.
     56        * platform/text/TextCodecICU.cpp:
     57        (WebCore::newTextCodecICU): Ditto.
     58        * platform/text/TextCodecLatin1.cpp:
     59        (WebCore::newStreamingTextDecoderWindowsLatin1): Ditto.
     60        * platform/text/TextCodecUTF16.cpp:
     61        (WebCore::newStreamingTextDecoderUTF16LE): Ditto.
     62        (WebCore::newStreamingTextDecoderUTF16BE): Ditto.
     63        * platform/text/TextCodecUserDefined.cpp:
     64        (WebCore::newStreamingTextDecoderUserDefined): Ditto.
     65        * platform/text/TextEncodingRegistry.cpp:
     66        (WebCore::newTextCodec): Ditto.
     67        * platform/text/TextEncodingRegistry.h:
     68        (WebCore::newTextCodec): Ditto.
     69        * platform/text/mac/TextCodecMac.cpp:
     70        (WebCore::newTextCodecMac): Ditto.
     71        * rendering/RenderBoxModelObject.cpp:
     72        (WebCore::RenderBoxModelObject::paintFillLayerExtended): Use
     73        OwnPtr<> instead of auto_ptr<> for stack variable.
     74        * svg/SVGMaskElement.cpp:
     75        (WebCore::SVGMaskElement::drawMaskerContent): Ditto.  Return
     76        OwnPtr<> instead of auto_ptr<>.
     77        * svg/SVGMaskElement.h:
     78        (WebCore::SVGMaskElement::drawMaskerContent): Return OwnPtr<>
     79        instead of auto_ptr<>.
     80        * svg/SVGPatternElement.cpp:
     81        (WebCore::SVGPatternElement::buildPattern): Use OwnPtr<> instead
     82        of auto_ptr<> for stack variable.
     83        * svg/graphics/SVGImage.cpp:
     84        (WebCore::SVGImage::nativeImageForCurrentFrame): Updated to use
     85        assignment operator now that ImageBuffer::create() returns a
     86        PassOwnPtr<>.
     87        * svg/graphics/SVGPaintServerGradient.cpp:
     88        (WebCore::createMaskAndSwapContextForTextGradient): Use OwnPtr<>
     89        instead of auto_ptr<> for stack variable.
     90        * svg/graphics/SVGPaintServerPattern.cpp:
     91        (WebCore::SVGPaintServerPattern::setTile): Updated to take a
     92        PassOwnPtr<> instead of an auto_ptr<>.
     93        (WebCore::SVGPaintServerPattern::setup): Use OwnPtr<> instead of
     94        auto_ptr<> for stack variable.
     95        * svg/graphics/SVGPaintServerPattern.h:
     96        (WebCore::SVGPaintServerPattern::setTile): Updated to take a
     97        PassOwnPtr<> instead of an auto_ptr<>.
     98        * svg/graphics/SVGResourceMasker.cpp:
     99        (WebCore::SVGResourceMasker::applyMask): Updated to use
     100        assignment operator now that SVGMaskElement::drawMaskerContent()
     101        returns a PassOwnPtr<>.  Use OwnPtr<> instead of auto_ptr<> for
     102        stack variable.
     103
    11042009-05-23  David Kilzer  <ddkilzer@apple.com>
    2105
  • trunk/WebCore/WebCore.base.exp

    r44048 r44096  
    198198__ZN7WebCore11HistoryItem14setScrollPointERKNS_8IntPointE
    199199__ZN7WebCore11HistoryItem15setIsTargetItemEb
    200 __ZN7WebCore11HistoryItem15setRedirectURLsESt8auto_ptrIN3WTF6VectorINS_6StringELm0EEEE
     200__ZN7WebCore11HistoryItem15setRedirectURLsEN3WTF10PassOwnPtrINS1_6VectorINS_6StringELm0EEEEE
    201201__ZN7WebCore11HistoryItem16adoptVisitCountsERN3WTF6VectorIiLm0EEES4_
    202202__ZN7WebCore11HistoryItem17setAlternateTitleERKNS_6StringE
  • trunk/WebCore/dom/Node.cpp

    r43913 r44096  
    7979#include "htmlediting.h"
    8080#include <wtf/HashSet.h>
     81#include <wtf/PassOwnPtr.h>
    8182#include <wtf/RefCountedLeakCounter.h>
    8283#include <wtf/UnusedParam.h>
     
    507508    NodeRareData* data = ensureRareData();
    508509    if (!data->nodeLists()) {
    509         data->setNodeLists(auto_ptr<NodeListsNodeData>(new NodeListsNodeData));
     510        data->setNodeLists(NodeListsNodeData::create());
    510511        document()->addNodeListCache();
    511512    }
     
    780781    NodeRareData* data = ensureRareData();
    781782    if (!data->nodeLists()) {
    782         data->setNodeLists(auto_ptr<NodeListsNodeData>(new NodeListsNodeData));
     783        data->setNodeLists(NodeListsNodeData::create());
    783784        document()->addNodeListCache();
    784785    } else if (!m_document->hasNodeListCaches()) {
     
    14741475    NodeRareData* data = ensureRareData();
    14751476    if (!data->nodeLists()) {
    1476         data->setNodeLists(auto_ptr<NodeListsNodeData>(new NodeListsNodeData));
     1477        data->setNodeLists(NodeListsNodeData::create());
    14771478        document()->addNodeListCache();
    14781479    }
     
    14951496    NodeRareData* data = ensureRareData();
    14961497    if (!data->nodeLists()) {
    1497         data->setNodeLists(auto_ptr<NodeListsNodeData>(new NodeListsNodeData));
     1498        data->setNodeLists(NodeListsNodeData::create());
    14981499        document()->addNodeListCache();
    14991500    }
     
    15101511    NodeRareData* data = ensureRareData();
    15111512    if (!data->nodeLists()) {
    1512         data->setNodeLists(auto_ptr<NodeListsNodeData>(new NodeListsNodeData));
     1513        data->setNodeLists(NodeListsNodeData::create());
    15131514        document()->addNodeListCache();
    15141515    }
  • trunk/WebCore/dom/NodeRareData.h

    r39563 r44096  
    2929#include "QualifiedName.h"
    3030#include <wtf/HashSet.h>
     31#include <wtf/PassOwnPtr.h>
    3132#include <wtf/OwnPtr.h>
    3233
     
    4546    typedef HashMap<QualifiedName, DynamicNodeList::Caches*> TagCacheMap;
    4647    TagCacheMap m_tagNodeListCaches;
    47    
     48
     49    static PassOwnPtr<NodeListsNodeData> create() {
     50        return new NodeListsNodeData;
     51    }
     52
    4853    ~NodeListsNodeData()
    4954    {
     
    5661    void invalidateCachesThatDependOnAttributes();
    5762    bool isEmpty() const;
     63
     64private:
     65    NodeListsNodeData() { }
    5866};
    5967   
     
    8290   
    8391    void clearNodeLists() { m_nodeLists.clear(); }
    84     void setNodeLists(std::auto_ptr<NodeListsNodeData> lists) { m_nodeLists.set(lists.release()); }
     92    void setNodeLists(PassOwnPtr<NodeListsNodeData> lists) { m_nodeLists = lists; }
    8593    NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
    8694   
  • trunk/WebCore/history/HistoryItem.cpp

    r42158 r44096  
    493493}
    494494
    495 void HistoryItem::setRedirectURLs(std::auto_ptr<Vector<String> > redirectURLs)
    496 {
    497     m_redirectURLs.adopt(redirectURLs);
     495void HistoryItem::setRedirectURLs(PassOwnPtr<Vector<String> > redirectURLs)
     496{
     497    m_redirectURLs = redirectURLs;
    498498}
    499499
  • trunk/WebCore/history/HistoryItem.h

    r42158 r44096  
    3030#include "PlatformString.h"
    3131#include <wtf/OwnPtr.h>
     32#include <wtf/PassOwnPtr.h>
    3233
    3334#if PLATFORM(MAC)
     
    143144    void addRedirectURL(const String&);
    144145    Vector<String>* redirectURLs() const;
    145     void setRedirectURLs(std::auto_ptr<Vector<String> >);
     146    void setRedirectURLs(PassOwnPtr<Vector<String> >);
    146147
    147148    bool isCurrentDocument(Document*) const;
  • trunk/WebCore/html/CanvasRenderingContext2D.cpp

    r43187 r44096  
    6161#include <wtf/ByteArray.h>
    6262#include <wtf/MathExtras.h>
     63#include <wtf/OwnPtr.h>
    6364
    6465using namespace std;
     
    14371438        IntRect maskRect = enclosingIntRect(textRect);
    14381439
    1439         auto_ptr<ImageBuffer> maskImage = ImageBuffer::create(maskRect.size(), false);
    1440        
     1440        OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(maskRect.size(), false);
     1441
    14411442        GraphicsContext* maskImageContext = maskImage->context();
    14421443
  • trunk/WebCore/html/HTMLCanvasElement.cpp

    r43678 r44096  
    260260        return;
    261261
    262     m_imageBuffer.set(ImageBuffer::create(size, false).release());
     262    m_imageBuffer = ImageBuffer::create(size, false);
    263263    // The convertLogicalToDevice MaxCanvasArea check should prevent common cases
    264264    // where ImageBuffer::create() returns NULL, however we could still be low on memory.
  • trunk/WebCore/loader/EmptyClients.h

    r43980 r44096  
    138138    virtual void formStateDidChange(const Node*) { }
    139139
    140     virtual HTMLParserQuirks* createHTMLParserQuirks() { return 0; }
     140    virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    141141
    142142    virtual bool setCursor(PlatformCursorHandle) { return false; }
  • trunk/WebCore/page/ChromeClient.h

    r43918 r44096  
    2525#include "FocusDirection.h"
    2626#include "GraphicsContext.h"
     27#include "HTMLParserQuirks.h"
    2728#include "HostWindow.h"
    2829#include "ScrollTypes.h"
    2930#include <wtf/Forward.h>
     31#include <wtf/PassOwnPtr.h>
    3032#include <wtf/Vector.h>
    3133
     
    168170        virtual void formStateDidChange(const Node*) = 0;
    169171
    170         virtual HTMLParserQuirks* createHTMLParserQuirks() = 0;
     172        virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() = 0;
    171173
    172174#if USE(ACCELERATED_COMPOSITING)
  • trunk/WebCore/platform/graphics/GeneratedImage.cpp

    r39635 r44096  
    5252{
    5353    // Create a BitmapImage and call drawPattern on it.
    54     auto_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(m_size, false);
     54    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(m_size, false);
    5555    ASSERT(imageBuffer.get());
    5656   
  • trunk/WebCore/platform/graphics/ImageBuffer.h

    r39635 r44096  
    11/*
    22 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
    3  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
     3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    3333#include "ImageBufferData.h"
    3434#include <wtf/OwnPtr.h>
     35#include <wtf/PassOwnPtr.h>
    3536#include <wtf/PassRefPtr.h>
    36 #include <memory>
    3737
    3838namespace WebCore {
     
    4747    public:
    4848        // Will return a null pointer on allocation failure.
    49         static std::auto_ptr<ImageBuffer> create(const IntSize& size, bool grayScale)
     49        static PassOwnPtr<ImageBuffer> create(const IntSize& size, bool grayScale)
    5050        {
    5151            bool success = false;
    52             std::auto_ptr<ImageBuffer> buf(new ImageBuffer(size, grayScale, success));
     52            OwnPtr<ImageBuffer> buf(new ImageBuffer(size, grayScale, success));
    5353            if (success)
    54                 return buf;
    55             return std::auto_ptr<ImageBuffer>();
     54                return buf.release();
     55            return 0;
    5656        }
    5757
     
    8181        mutable RefPtr<Image> m_image;
    8282
    83         // This constructor will place its succes into the given out-variable
     83        // This constructor will place its success into the given out-variable
    8484        // so that create() knows when it should return failure.
    8585        ImageBuffer(const IntSize&, bool grayScale, bool& success);
  • trunk/WebCore/platform/mac/ScrollbarThemeMac.mm

    r39806 r44096  
    394394        bufferRect.move(-scrollbar->frameRect().x(), -scrollbar->frameRect().y());
    395395       
    396         auto_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(bufferRect.size(), false);
    397         if (!imageBuffer.get())
     396        OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(bufferRect.size(), false);
     397        if (!imageBuffer)
    398398            return true;
    399399       
  • trunk/WebCore/platform/text/TextCodec.h

    r33380 r44096  
    3030#include <memory>
    3131#include <wtf/Noncopyable.h>
     32#include <wtf/PassOwnPtr.h>
    3233#include <wtf/Vector.h>
    3334#include <wtf/unicode/Unicode.h>
     
    7778    typedef void (*EncodingNameRegistrar)(const char* alias, const char* name);
    7879
    79     typedef std::auto_ptr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData);
     80    typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData);
    8081    typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData);
    8182
  • trunk/WebCore/platform/text/TextCodecICU.cpp

    r41807 r44096  
    3535#include <unicode/ucnv_cb.h>
    3636#include <wtf/Assertions.h>
     37#include <wtf/PassOwnPtr.h>
    3738#include <wtf/StringExtras.h>
    3839#include <wtf/Threading.h>
    3940
    40 using std::auto_ptr;
    4141using std::min;
    4242
     
    5656}
    5757
    58 static auto_ptr<TextCodec> newTextCodecICU(const TextEncoding& encoding, const void*)
    59 {
    60     return auto_ptr<TextCodec>(new TextCodecICU(encoding));
     58static PassOwnPtr<TextCodec> newTextCodecICU(const TextEncoding& encoding, const void*)
     59{
     60    return new TextCodecICU(encoding);
    6161}
    6262
  • trunk/WebCore/platform/text/TextCodecLatin1.cpp

    r31316 r44096  
    3131#include "StringBuffer.h"
    3232#include <stdio.h>
    33 
    34 using std::auto_ptr;
     33#include <wtf/PassOwnPtr.h>
    3534
    3635namespace WebCore {
     
    105104}
    106105
    107 static auto_ptr<TextCodec> newStreamingTextDecoderWindowsLatin1(const TextEncoding&, const void*)
     106static PassOwnPtr<TextCodec> newStreamingTextDecoderWindowsLatin1(const TextEncoding&, const void*)
    108107{
    109     return auto_ptr<TextCodec>(new TextCodecLatin1);
     108    return new TextCodecLatin1;
    110109}
    111110
  • trunk/WebCore/platform/text/TextCodecUTF16.cpp

    r39601 r44096  
    3030#include "PlatformString.h"
    3131#include "StringBuffer.h"
    32 
    33 using std::auto_ptr;
     32#include <wtf/PassOwnPtr.h>
    3433
    3534namespace WebCore {
     
    5049}
    5150
    52 static auto_ptr<TextCodec> newStreamingTextDecoderUTF16LE(const TextEncoding&, const void*)
     51static PassOwnPtr<TextCodec> newStreamingTextDecoderUTF16LE(const TextEncoding&, const void*)
    5352{
    54     return auto_ptr<TextCodec>(new TextCodecUTF16(true));
     53    return new TextCodecUTF16(true);
    5554}
    5655
    57 static auto_ptr<TextCodec> newStreamingTextDecoderUTF16BE(const TextEncoding&, const void*)
     56static PassOwnPtr<TextCodec> newStreamingTextDecoderUTF16BE(const TextEncoding&, const void*)
    5857{
    59     return auto_ptr<TextCodec>(new TextCodecUTF16(false));
     58    return new TextCodecUTF16(false);
    6059}
    6160
  • trunk/WebCore/platform/text/TextCodecUserDefined.cpp

    r31316 r44096  
    3131#include "StringBuffer.h"
    3232#include <stdio.h>
    33 
    34 using std::auto_ptr;
     33#include <wtf/PassOwnPtr.h>
    3534
    3635namespace WebCore {
     
    4140}
    4241
    43 static auto_ptr<TextCodec> newStreamingTextDecoderUserDefined(const TextEncoding&, const void*)
     42static PassOwnPtr<TextCodec> newStreamingTextDecoderUserDefined(const TextEncoding&, const void*)
    4443{
    45     return auto_ptr<TextCodec>(new TextCodecUserDefined);
     44    return new TextCodecUserDefined;
    4645}
    4746
  • trunk/WebCore/platform/text/TextEncodingRegistry.cpp

    r44050 r44096  
    210210}
    211211
    212 std::auto_ptr<TextCodec> newTextCodec(const TextEncoding& encoding)
     212PassOwnPtr<TextCodec> newTextCodec(const TextEncoding& encoding)
    213213{
    214214    MutexLocker lock(encodingRegistryMutex());
  • trunk/WebCore/platform/text/TextEncodingRegistry.h

    r41551 r44096  
    2828
    2929#include <memory>
     30#include <wtf/PassOwnPtr.h>
    3031#include <wtf/unicode/Unicode.h>
    3132
     
    3738    // Use TextResourceDecoder::decode to decode resources, since it handles BOMs.
    3839    // Use TextEncoding::encode to encode, since it takes care of normalization.
    39     std::auto_ptr<TextCodec> newTextCodec(const TextEncoding&);
     40    PassOwnPtr<TextCodec> newTextCodec(const TextEncoding&);
    4041
    4142    // Only TextEncoding should use this function directly.
  • trunk/WebCore/platform/text/mac/TextCodecMac.cpp

    r39465 r44096  
    3434#include "ThreadGlobalData.h"
    3535#include <wtf/Assertions.h>
     36#include <wtf/PassOwnPtr.h>
    3637#include <wtf/Threading.h>
    3738
    38 using std::auto_ptr;
    3939using std::min;
    4040
     
    6565}
    6666
    67 static auto_ptr<TextCodec> newTextCodecMac(const TextEncoding&, const void* additionalData)
    68 {
    69     return auto_ptr<TextCodec>(new TextCodecMac(*static_cast<const TECTextEncodingID*>(additionalData)));
     67static PassOwnPtr<TextCodec> newTextCodecMac(const TextEncoding&, const void* additionalData)
     68{
     69    return new TextCodecMac(*static_cast<const TECTextEncodingID*>(additionalData));
    7070}
    7171
  • trunk/WebCore/rendering/RenderBoxModelObject.cpp

    r43813 r44096  
    337337       
    338338        // Now create the mask.
    339         auto_ptr<ImageBuffer> maskImage = ImageBuffer::create(maskRect.size(), false);
    340         if (!maskImage.get())
     339        OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(maskRect.size(), false);
     340        if (!maskImage)
    341341            return;
    342342       
  • trunk/WebCore/svg/SVGMaskElement.cpp

    r43209 r44096  
    126126}
    127127
    128 auto_ptr<ImageBuffer> SVGMaskElement::drawMaskerContent(const FloatRect& targetRect, FloatRect& maskDestRect) const
     128PassOwnPtr<ImageBuffer> SVGMaskElement::drawMaskerContent(const FloatRect& targetRect, FloatRect& maskDestRect) const
    129129{   
    130130    // Determine specified mask size
     
    155155        heightValue = imageSize.height();
    156156
    157     auto_ptr<ImageBuffer> maskImage = ImageBuffer::create(imageSize, false);
    158     if (!maskImage.get())
    159         return maskImage;
     157    OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(imageSize, false);
     158    if (!maskImage)
     159        return 0;
    160160
    161161    maskDestRect = FloatRect(xValue, yValue, widthValue, heightValue);
     
    194194
    195195    maskImageContext->restore();
    196     return maskImage;
     196    return maskImage.release();
    197197}
    198198 
  • trunk/WebCore/svg/SVGMaskElement.h

    r35248 r44096  
    3030#include "SVGTests.h"
    3131#include "SVGURIReference.h"
     32#include <wtf/PassOwnPtr.h>
    3233
    3334namespace WebCore {
     
    5253        virtual SVGResource* canvasResource();
    5354
    54         std::auto_ptr<ImageBuffer> drawMaskerContent(const FloatRect& targetRect, FloatRect& maskRect) const;
     55        PassOwnPtr<ImageBuffer> drawMaskerContent(const FloatRect& targetRect, FloatRect& maskRect) const;
    5556
    5657    protected:
  • trunk/WebCore/svg/SVGPatternElement.cpp

    r43209 r44096  
    215215    clampImageBufferSizeToViewport(document()->view(), imageSize);
    216216
    217     auto_ptr<ImageBuffer> patternImage = ImageBuffer::create(imageSize, false);
    218 
    219     if (!patternImage.get())
     217    OwnPtr<ImageBuffer> patternImage = ImageBuffer::create(imageSize, false);
     218
     219    if (!patternImage)
    220220        return;
    221221
     
    252252    m_resource->setPatternTransform(attributes.patternTransform());
    253253    m_resource->setPatternBoundaries(patternBoundaries);
    254     m_resource->setTile(patternImage);
     254    m_resource->setTile(patternImage.release());
    255255}
    256256
  • trunk/WebCore/svg/graphics/SVGImage.cpp

    r42590 r44096  
    206206    // having a tiled drawing callback (hopefully non-virtual).
    207207    if (!m_frameCache) {
    208         m_frameCache.set(ImageBuffer::create(size(), false).release());
     208        m_frameCache = ImageBuffer::create(size(), false);
    209209        if (!m_frameCache) // failed to allocate image
    210210            return 0;
  • trunk/WebCore/svg/graphics/SVGPaintServerGradient.cpp

    r43209 r44096  
    138138    clampImageBufferSizeToViewport(object->view()->frameView(), maskSize);
    139139
    140     auto_ptr<ImageBuffer> maskImage = ImageBuffer::create(maskSize, false);
    141 
    142     if (!maskImage.get())
     140    OwnPtr<ImageBuffer> maskImage = ImageBuffer::create(maskSize, false);
     141
     142    if (!maskImage)
    143143        return false;
    144144
  • trunk/WebCore/svg/graphics/SVGPaintServerPattern.cpp

    r43269 r44096  
    6969}
    7070
    71 void SVGPaintServerPattern::setTile(auto_ptr<ImageBuffer> tile)
     71void SVGPaintServerPattern::setTile(PassOwnPtr<ImageBuffer> tile)
    7272{
    73     m_tile.set(tile.release());
     73    m_tile = tile;
    7474}
    7575
     
    119119        int tileWidth = static_cast<int>(patternBoundaries().width() + 0.5f);
    120120        int tileHeight = static_cast<int>(patternBoundaries().height() + 0.5f);
    121         std::auto_ptr<ImageBuffer> tileImage = ImageBuffer::create(IntSize(tileWidth, tileHeight), false);
     121        OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(IntSize(tileWidth, tileHeight), false);
    122122 
    123123        GraphicsContext* tileImageContext = tileImage->context();
  • trunk/WebCore/svg/graphics/SVGPaintServerPattern.h

    r40088 r44096  
    3737
    3838#include <wtf/OwnPtr.h>
     39#include <wtf/PassOwnPtr.h>
    3940
    4041namespace WebCore {
     
    5758
    5859        ImageBuffer* tile() const;
    59         void setTile(std::auto_ptr<ImageBuffer>);
     60        void setTile(PassOwnPtr<ImageBuffer>);
    6061
    6162        TransformationMatrix patternTransform() const;
  • trunk/WebCore/svg/graphics/SVGResourceMasker.cpp

    r41266 r44096  
    6464{
    6565    if (!m_mask)
    66         m_mask.set(m_ownerElement->drawMaskerContent(boundingBox, m_maskRect).release());
     66        m_mask = m_ownerElement->drawMaskerContent(boundingBox, m_maskRect);
    6767
    6868    if (!m_mask)
     
    7373
    7474    // Create new ImageBuffer to apply luminance
    75     auto_ptr<ImageBuffer> luminancedImage(ImageBuffer::create(imageSize, false));
    76     if (!luminancedImage.get())
     75    OwnPtr<ImageBuffer> luminancedImage = ImageBuffer::create(imageSize, false);
     76    if (!luminancedImage)
    7777        return;
    7878
  • trunk/WebKit/gtk/ChangeLog

    r44077 r44096  
     12009-05-23  David Kilzer  <ddkilzer@apple.com>
     2
     3        Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=25495>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        * WebCoreSupport/ChromeClientGtk.h:
     10        (WebKit::ChromeClient::createHTMLParserQuirks): Return a
     11        PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.
     12
    1132009-05-22  Gustavo Noronha Silva  <gns@gnome.org>
    214
  • trunk/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h

    r43918 r44096  
    105105        virtual void formStateDidChange(const WebCore::Node*) { }
    106106
    107         virtual WebCore::HTMLParserQuirks* createHTMLParserQuirks() { return 0; }
     107        virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    108108
    109109        virtual bool setCursor(WebCore::PlatformCursorHandle);
  • trunk/WebKit/mac/ChangeLog

    r44095 r44096  
     12009-05-23  David Kilzer  <ddkilzer@apple.com>
     2
     3        Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=25495>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        * History/WebHistory.mm:
     10        (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): Return
     11        0 instead of an empty auto_ptr<>.
     12        * History/WebHistoryItem.mm:
     13        (-[WebHistoryItem initFromDictionaryRepresentation:]): Use
     14        OwnPtr<> instead of auto_ptr<> for stack variable.
     15        * WebCoreSupport/WebChromeClient.h:
     16        (WebChromeClient::createHTMLParserQuirks): Return a PassOwnPtr<>
     17        instead of a raw HTMLParserQuirks pointer.
     18
    1192009-05-23  David Kilzer  <ddkilzer@apple.com>
    220
  • trunk/WebKit/mac/History/WebHistory.mm

    r43937 r44096  
    801801        item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"]));
    802802
    803     item->setRedirectURLs(auto_ptr<Vector<String> >());
     803    item->setRedirectURLs(0);
    804804
    805805    NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil];
  • trunk/WebKit/mac/History/WebHistoryItem.mm

    r42824 r44096  
    383383    if (NSArray *redirectURLs = [dict _webkit_arrayForKey:redirectURLsKey]) {
    384384        NSUInteger size = [redirectURLs count];
    385         std::auto_ptr<Vector<String> > redirectURLsVector(new Vector<String>(size));
     385        OwnPtr<Vector<String> > redirectURLsVector(new Vector<String>(size));
    386386        for (NSUInteger i = 0; i < size; ++i)
    387387            (*redirectURLsVector)[i] = String([redirectURLs _webkit_stringAtIndex:i]);
    388         core(_private)->setRedirectURLs(redirectURLsVector);
     388        core(_private)->setRedirectURLs(redirectURLsVector.release());
    389389    }
    390390
  • trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h

    r43921 r44096  
    136136    virtual void formStateDidChange(const WebCore::Node*) { }
    137137
    138     virtual WebCore::HTMLParserQuirks* createHTMLParserQuirks() { return 0; }
     138    virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    139139
    140140#if USE(ACCELERATED_COMPOSITING)
  • trunk/WebKit/qt/ChangeLog

    r44090 r44096  
     12009-05-23  David Kilzer  <ddkilzer@apple.com>
     2
     3        Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=25495>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        * WebCoreSupport/ChromeClientQt.h:
     10        (WebCore::ChromeClientQt::createHTMLParserQuirks): Return a
     11        PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.
     12
    1132009-05-23  Jakob Truelsen  <antialize@gmail.com>
    214
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r43918 r44096  
    121121        virtual void formStateDidChange(const Node*) { }
    122122
    123         virtual HTMLParserQuirks* createHTMLParserQuirks() { return 0; }
     123        virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    124124
    125125        virtual bool setCursor(PlatformCursorHandle);
  • trunk/WebKit/win/ChangeLog

    r44073 r44096  
     12009-05-23  David Kilzer  <ddkilzer@apple.com>
     2
     3        Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=25495>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        * WebCoreSupport/WebChromeClient.h:
     10        (WebChromeClient::createHTMLParserQuirks): Return a PassOwnPtr<>
     11        instead of a raw HTMLParserQuirks pointer.
     12
    1132009-05-22  Brent Fulgham  <bfulgham@webkit.org>
    214
  • trunk/WebKit/win/WebCoreSupport/WebChromeClient.h

    r43918 r44096  
    125125    virtual void formStateDidChange(const WebCore::Node*) { }
    126126
    127     virtual WebCore::HTMLParserQuirks* createHTMLParserQuirks() { return 0; }
     127    virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    128128
    129129    virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
  • trunk/WebKit/wx/ChangeLog

    r44060 r44096  
     12009-05-23  David Kilzer  <ddkilzer@apple.com>
     2
     3        Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=25495>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        * WebKitSupport/ChromeClientWx.h:
     10        (WebCore::ChromeClientWx::createHTMLParserQuirks): Return a
     11        PassOwnPtr<> instead of a raw HTMLParserQuirks pointer.
     12
    1132009-05-22  Kevin Watters  <kevinwatters@gmail.com>
    214
  • trunk/WebKit/wx/WebKitSupport/ChromeClientWx.h

    r43918 r44096  
    120120    virtual void formStateDidChange(const Node*) { }
    121121
    122     virtual HTMLParserQuirks* createHTMLParserQuirks() { return 0; }
     122    virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    123123
    124124    virtual bool setCursor(PlatformCursorHandle);
Note: See TracChangeset for help on using the changeset viewer.