Changeset 85515 in webkit


Ignore:
Timestamp:
May 2, 2011 1:37:15 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-05-02 Adam Barth <abarth@webkit.org>

Reviewed by David Levin.

PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=59924

  • css/CSSGrammar.y:
  • platform/graphics/mac/SimpleFontDataMac.mm:
    • Memory management for the font cache is somewhat... complext. This will require some careful thought to sort out.

2011-05-02 Adam Barth <abarth@webkit.org>

Reviewed by David Levin.

PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=59924

  • History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]):
  • Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
  • WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::savePlatformDataToCachedFrame):
  • WebView/WebView.mm: (-[WebView _injectMailQuirksScript]): (-[WebView _injectOutlookQuirksScript]): (toStringVector):

2011-05-02 Adam Barth <abarth@webkit.org>

Reviewed by David Levin.

PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=59924

  • Platform/CoreIPC/Connection.cpp: (CoreIPC::Connection::sendSyncMessage): (CoreIPC::Connection::waitForSyncReply): (CoreIPC::Connection::dispatchSyncMessage):
  • Platform/CoreIPC/Connection.h: (CoreIPC::Connection::Message::releaseArguments):
    • The memory management for this class is very strange. I wrote a large comment. Hopefully a kind soul will come by and fix it.
  • Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::unload):
  • UIProcess/API/mac/WKView.mm: (-[WKView _setFindIndicator:fadeOut:]):
  • WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer):
  • WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::toStringVector):
  • WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::stop):
  • WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp: (WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
  • WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::create):
Location:
trunk/Source
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85512 r85515  
     12011-05-02  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by David Levin.
     4
     5        PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
     6        https://bugs.webkit.org/show_bug.cgi?id=59924
     7
     8        * css/CSSGrammar.y:
     9        * platform/graphics/mac/SimpleFontDataMac.mm:
     10            - Memory management for the font cache is somewhat... complext.
     11              This will require some careful thought to sort out.
     12
    1132011-05-02  Levi Weintraub  <leviw@chromium.org>
    214
  • trunk/Source/WebCore/css/CSSGrammar.y

    r85077 r85515  
    14511451        CSSParserFunction* f = p->createFloatingFunction();
    14521452        f->name = $1;
    1453         f->args = p->sinkFloatingValueList($3);
     1453        f->args = adoptPtr(p->sinkFloatingValueList($3));
    14541454        $$.id = 0;
    14551455        $$.unit = CSSParserValue::Function;
     
    14601460        CSSParserFunction* f = p->createFloatingFunction();
    14611461        f->name = $1;
    1462         f->args = 0;
     1462        f->args = nullptr;
    14631463        $$.id = 0;
    14641464        $$.unit = CSSParserValue::Function;
     
    15691569        CSSParserFunction* f = p->createFloatingFunction();
    15701570        f->name = $1;
    1571         f->args = p->sinkFloatingValueList($3);
     1571        f->args = adoptPtr(p->sinkFloatingValueList($3));
    15721572        $$.id = 0;
    15731573        $$.unit = CSSParserValue::Function;
     
    15941594        CSSParserFunction* f = p->createFloatingFunction();
    15951595        f->name = $1;
    1596         f->args = p->sinkFloatingValueList($3);
     1596        f->args = adoptPtr(p->sinkFloatingValueList($3));
    15971597        $$.id = 0;
    15981598        $$.unit = CSSParserValue::Function;
  • trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm

    r85036 r85515  
    2929
    3030#import "config.h"
     31
     32// FIXME: Remove this define!
     33#define LOOSE_PASS_OWN_PTR
     34
    3135#import "SimpleFontData.h"
    3236
  • trunk/Source/WebKit/mac/ChangeLog

    r85484 r85515  
     12011-05-02  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by David Levin.
     4
     5        PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
     6        https://bugs.webkit.org/show_bug.cgi?id=59924
     7
     8        * History/WebHistory.mm:
     9        (-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]):
     10        * Plugins/WebBaseNetscapePluginView.mm:
     11        (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
     12        * WebCoreSupport/WebFrameLoaderClient.mm:
     13        (WebFrameLoaderClient::savePlatformDataToCachedFrame):
     14        * WebView/WebView.mm:
     15        (-[WebView _injectMailQuirksScript]):
     16        (-[WebView _injectOutlookQuirksScript]):
     17        (toStringVector):
     18
    1192011-05-02  Sam Weinig  <sam@webkit.org>
    220
  • trunk/Source/WebKit/mac/History/WebHistory.mm

    r85302 r85515  
    827827        item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"]));
    828828
    829     item->setRedirectURLs(0);
     829    item->setRedirectURLs(PassOwnPtr<Vector<String> >());
    830830
    831831    NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil];
  • trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm

    r85484 r85515  
    163163   
    164164    _loadManually = loadManually;
    165     _haltable = new WebHaltablePlugin(self);
     165    _haltable = adoptPtr(new WebHaltablePlugin(self));
    166166    return self;
    167167}
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r85036 r85515  
    12061206void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame)
    12071207{
    1208     WebCachedFramePlatformData* webPlatformData = new WebCachedFramePlatformData([m_webFrame->_private->webFrameView documentView]);
    1209     cachedFrame->setCachedFramePlatformData(webPlatformData);
     1208    OwnPtr<WebCachedFramePlatformData> webPlatformData = adoptPtr(new WebCachedFramePlatformData([m_webFrame->_private->webFrameView documentView]));
     1209    cachedFrame->setCachedFramePlatformData(webPlatformData.release());
    12101210}
    12111211
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r85036 r85515  
    643643    static NSString *mailQuirksScriptContents = leakMailQuirksUserScriptContents();
    644644    core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]),
    645         mailQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames);
     645        mailQuirksScriptContents, KURL(), PassOwnPtr<Vector<String> >(), PassOwnPtr<Vector<String> >(), InjectAtDocumentEnd, InjectInAllFrames);
    646646}
    647647
     
    664664    static NSString *outlookQuirksScriptContents = leakOutlookQuirksUserScriptContents();
    665665    core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]),
    666         outlookQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames);
     666        outlookQuirksScriptContents, KURL(), PassOwnPtr<Vector<String> >(), PassOwnPtr<Vector<String> >(), InjectAtDocumentEnd, InjectInAllFrames);
    667667}
    668668
     
    25642564    NSUInteger count = [patterns count];
    25652565    if (count == 0)
    2566         return 0;
    2567     Vector<String>* patternsVector = new Vector<String>;
     2566        return PassOwnPtr<Vector<String> >();
     2567    OwnPtr<Vector<String> > patternsVector = adoptPtr(new Vector<String>);
    25682568    for (NSUInteger i = 0; i < count; ++i) {
    25692569        id entry = [patterns objectAtIndex:i];
     
    25712571            patternsVector->append(String((NSString*)entry));
    25722572    }
    2573     return patternsVector;
     2573    return patternsVector.release();
    25742574}
    25752575
  • trunk/Source/WebKit2/ChangeLog

    r85508 r85515  
     12011-05-02  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by David Levin.
     4
     5        PLATFORM(MAC) should (almost!) build with strict PassOwnPtr
     6        https://bugs.webkit.org/show_bug.cgi?id=59924
     7
     8        * Platform/CoreIPC/Connection.cpp:
     9        (CoreIPC::Connection::sendSyncMessage):
     10        (CoreIPC::Connection::waitForSyncReply):
     11        (CoreIPC::Connection::dispatchSyncMessage):
     12        * Platform/CoreIPC/Connection.h:
     13        (CoreIPC::Connection::Message::releaseArguments):
     14            - The memory management for this class is very strange.  I wrote a
     15              large comment.  Hopefully a kind soul will come by and fix it.
     16        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
     17        (WebKit::NetscapePluginModule::unload):
     18        * UIProcess/API/mac/WKView.mm:
     19        (-[WKView _setFindIndicator:fadeOut:]):
     20        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
     21        (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer):
     22        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     23        (WebKit::toStringVector):
     24        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
     25        (WebKit::NetscapePluginStream::stop):
     26        * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
     27        (WebKit::WebInspectorFrontendClient::WebInspectorFrontendClient):
     28        * WebProcess/WebPage/DrawingArea.cpp:
     29        (WebKit::DrawingArea::create):
     30
    1312011-04-29  Chris Marrin  <cmarrin@apple.com>
    232
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp

    r85503 r85515  
    388388    if (!isValid()) {
    389389        didFailToSendSyncMessage();
    390         return 0;
     390        return PassOwnPtr<ArgumentDecoder>();
    391391    }
    392392
     
    396396        if (!m_shouldWaitForSyncReplies) {
    397397            didFailToSendSyncMessage();
    398             return 0;
     398            return PassOwnPtr<ArgumentDecoder>();
    399399        }
    400400
     
    458458        // any more incoming messages.
    459459        if (!isValid())
    460             return 0;
     460            return PassOwnPtr<ArgumentDecoder>();
    461461
    462462        // We didn't find a sync reply yet, keep waiting.
     
    472472        m_client->syncMessageSendTimedOut(this);
    473473
    474     return 0;
     474    return PassOwnPtr<ArgumentDecoder>();
    475475}
    476476
     
    627627
    628628    // Create our reply encoder.
    629     ArgumentEncoder* replyEncoder = ArgumentEncoder::create(syncRequestID).leakPtr();
    630    
    631     // Hand off both the decoder and encoder to the client..
    632     SyncReplyMode syncReplyMode = m_client->didReceiveSyncMessage(this, messageID, arguments, replyEncoder);
     629    OwnPtr<ArgumentEncoder> replyEncoder = ArgumentEncoder::create(syncRequestID);
     630   
     631    // Hand off both the decoder and encoder to the client.
     632    SyncReplyMode syncReplyMode = m_client->didReceiveSyncMessage(this, messageID, arguments, replyEncoder.get());
    633633
    634634    // FIXME: If the message was invalid, we should send back a SyncMessageError.
     
    642642
    643643    // Send the reply.
    644     sendSyncReply(replyEncoder);
     644    sendSyncReply(replyEncoder.release());
    645645}
    646646
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.h

    r85503 r85515  
    186186        PassOwnPtr<T> releaseArguments()
    187187        {
    188             T* arguments = m_arguments;
     188            OwnPtr<T> arguments = adoptPtr(m_arguments);
    189189            m_arguments = 0;
    190190
    191             return arguments;
     191            return arguments.release();
    192192        }
    193193       
    194194    private:
    195195        MessageID m_messageID;
     196        // The memory management of this class is very unusual. The class acts
     197        // as if it has an owning reference to m_arguments (e.g., accepting a
     198        // PassOwnPtr in its constructor) in all ways except that it does not
     199        // deallocate m_arguments on destruction.
     200        // FIXME: Does this leak m_arguments on destruction?
    196201        T* m_arguments;
    197202    };
  • trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp

    r83901 r85515  
    257257    ASSERT(!m_isInitialized);
    258258
    259     m_module = 0;
     259    m_module = nullptr;
    260260}
    261261
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r85376 r85515  
    22032203{
    22042204    if (!findIndicator) {
    2205         _data->_findIndicatorWindow = 0;
     2205        _data->_findIndicatorWindow = nullptr;
    22062206        return;
    22072207    }
  • trunk/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm

    r84997 r85515  
    141141        if (m_rootLayer) {
    142142            m_rootLayer->removeAllChildren();
    143             m_rootLayer = 0;
     143            m_rootLayer = nullptr;
    144144        }
    145145        return;
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r85019 r85515  
    213213{
    214214    if (!patterns)
    215         return 0;
     215        return PassOwnPtr<Vector<String> >();
    216216
    217217    size_t size =  patterns->size();
    218218    if (!size)
    219         return 0;
    220 
    221     Vector<String>* patternsVector = new Vector<String>;
     219        return PassOwnPtr<Vector<String> >();
     220
     221    OwnPtr<Vector<String> > patternsVector = adoptPtr(new Vector<String>);
    222222    patternsVector->reserveInitialCapacity(size);
    223223    for (size_t i = 0; i < size; ++i) {
     
    226226            patternsVector->uncheckedAppend(entry->string());
    227227    }
    228     return patternsVector;
     228    return patternsVector.release();
    229229}
    230230
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp

    r84886 r85515  
    294294    }
    295295
    296     m_deliveryData = 0;
     296    m_deliveryData = nullptr;
    297297    m_deliveryDataTimer.stop();
    298298
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp

    r84785 r85515  
    4141
    4242WebInspectorFrontendClient::WebInspectorFrontendClient(WebPage* page, WebPage* inspectorPage)
    43     : InspectorFrontendClientLocal(page->corePage()->inspectorController(), inspectorPage->corePage(), new Settings())
     43    : InspectorFrontendClientLocal(page->corePage()->inspectorController(), inspectorPage->corePage(), adoptPtr(new Settings()))
    4444    , m_page(page)
    4545{
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp

    r84613 r85515  
    4949        return DrawingAreaImpl::create(webPage, parameters);
    5050#else
    51         return 0;
     51        return PassOwnPtr<DrawingArea>();
    5252#endif
    5353    case DrawingAreaTypeChunkedUpdate:
     
    5959    }
    6060
    61     return 0;
     61    return PassOwnPtr<DrawingArea>();
    6262}
    6363
Note: See TracChangeset for help on using the changeset viewer.