Changeset 216448 in webkit


Ignore:
Timestamp:
May 8, 2017 1:11:29 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Reduce PassRefPtr use
https://bugs.webkit.org/show_bug.cgi?id=171809

Reviewed by Chris Dumez.

Source/WebCore:

  • platform/graphics/ca/PlatformCALayer.cpp:

(WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):

  • platform/graphics/ca/PlatformCALayer.h:
  • platform/graphics/ca/TileCoverageMap.cpp:

(WebCore::TileCoverageMap::TileCoverageMap):

  • platform/graphics/ca/TileGrid.cpp:

(WebCore::TileGrid::TileGrid):

  • platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
  • platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:

(PlatformCALayerCocoa::create):
(PlatformCALayerCocoa::clone):
(PlatformCALayerCocoa::animationForKey):
(PlatformCALayerCocoa::createCompatibleLayer):

Source/WebKit2:

  • PluginProcess/PluginControllerProxy.cpp:

(WebKit::PluginControllerProxy::setInitializationReply):

  • PluginProcess/PluginControllerProxy.h:
  • PluginProcess/WebProcessConnection.cpp:

(WebKit::WebProcessConnection::destroyPlugin):
(WebKit::WebProcessConnection::createPlugin):

  • PluginProcess/WebProcessConnection.h:
  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::runOpenPanel):

  • WebProcess/WebCoreSupport/WebEditorClient.cpp:

(WebKit::WebEditorClient::registerUndoStep):

  • WebProcess/WebPage/VisitedLinkTableController.cpp:

(WebKit::VisitedLinkTableController::getOrCreate):

  • WebProcess/WebPage/VisitedLinkTableController.h:
  • WebProcess/WebPage/WebFrame.cpp:

(WebKit::WebFrame::hitTest):
(WebKit::WebFrame::createSelectionSnapshot):

  • WebProcess/WebPage/WebFrame.h:
  • WebProcess/WebPage/WebOpenPanelResultListener.cpp:

(WebKit::WebOpenPanelResultListener::create):
(WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):

  • WebProcess/WebPage/WebOpenPanelResultListener.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::unapplyEditCommand):
(WebKit::WebPage::reapplyEditCommand):

  • WebProcess/WebPage/WebPageGroupProxy.cpp:

(WebKit::WebPageGroupProxy::create):

  • WebProcess/WebPage/WebPageGroupProxy.h:
  • WebProcess/WebPage/WebUndoStep.cpp:

(WebKit::WebUndoStep::create):

  • WebProcess/WebPage/WebUndoStep.h:

(WebKit::WebUndoStep::step):
(WebKit::WebUndoStep::WebUndoStep):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::create):
(WebKit::PlatformCALayerRemote::clone):
(WebKit::PlatformCALayerRemote::animationForKey):
(WebKit::PlatformCALayerRemote::createCompatibleLayer):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.h:
  • WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
  • WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:

(WebKit::PlatformCALayerRemoteCustom::create):
(WebKit::PlatformCALayerRemoteCustom::clone):

Location:
trunk/Source
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r216446 r216448  
     12017-05-08  Alex Christensen  <achristensen@webkit.org>
     2
     3        Reduce PassRefPtr use
     4        https://bugs.webkit.org/show_bug.cgi?id=171809
     5
     6        Reviewed by Chris Dumez.
     7
     8        * platform/graphics/ca/PlatformCALayer.cpp:
     9        (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
     10        * platform/graphics/ca/PlatformCALayer.h:
     11        * platform/graphics/ca/TileCoverageMap.cpp:
     12        (WebCore::TileCoverageMap::TileCoverageMap):
     13        * platform/graphics/ca/TileGrid.cpp:
     14        (WebCore::TileGrid::TileGrid):
     15        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
     16        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
     17        (PlatformCALayerCocoa::create):
     18        (PlatformCALayerCocoa::clone):
     19        (PlatformCALayerCocoa::animationForKey):
     20        (PlatformCALayerCocoa::createCompatibleLayer):
     21
    1222017-05-08  Jer Noble  <jer.noble@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r215750 r216448  
    357357        result->setWantsDeepColorBackingStore(screenSupportsExtendedColor());
    358358   
    359     return result;
     359    return WTFMove(result);
    360360#elif PLATFORM(WIN)
    361361    return PlatformCALayerWin::create(layerType, owner);
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp

    r213940 r216448  
    168168}
    169169
    170 PassRefPtr<PlatformCALayer> PlatformCALayer::createCompatibleLayerOrTakeFromPool(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client, IntSize size)
    171 {
    172     RefPtr<PlatformCALayer> layer;
    173 
    174     if ((layer = layerPool().takeLayerWithSize(size))) {
    175         layer->setOwner(client);
    176         return WTFMove(layer);
    177     }
    178 
    179     layer = createCompatibleLayer(layerType, client);
     170Ref<PlatformCALayer> PlatformCALayer::createCompatibleLayerOrTakeFromPool(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client, IntSize size)
     171{
     172    if (auto layerFromPool = layerPool().takeLayerWithSize(size)) {
     173        layerFromPool->setOwner(client);
     174        return layerFromPool.releaseNonNull();
     175    }
     176
     177    auto layer = createCompatibleLayer(layerType, client);
    180178    layer->setBounds(FloatRect(FloatPoint(), size));
    181    
    182     return WTFMove(layer);
     179    return layer;
    183180}
    184181
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h

    r213940 r216448  
    3030#include <QuartzCore/CABase.h>
    3131#include <wtf/CurrentTime.h>
    32 #include <wtf/PassRefPtr.h>
    3332#include <wtf/RefCounted.h>
    3433#include <wtf/RetainPtr.h>
     
    8382    enum FilterType { Linear, Nearest, Trilinear };
    8483
    85     virtual PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient*) const = 0;
     84    virtual Ref<PlatformCALayer> clone(PlatformCALayerClient*) const = 0;
    8685
    8786    virtual ~PlatformCALayer();
     
    133132    virtual void addAnimationForKey(const String& key, PlatformCAAnimation&) = 0;
    134133    virtual void removeAnimationForKey(const String& key) = 0;
    135     virtual PassRefPtr<PlatformCAAnimation> animationForKey(const String& key) = 0;
     134    virtual RefPtr<PlatformCAAnimation> animationForKey(const String& key) = 0;
    136135
    137136    virtual void setMask(PlatformCALayer*) = 0;
     
    261260#endif
    262261
    263     virtual PassRefPtr<PlatformCALayer> createCompatibleLayer(LayerType, PlatformCALayerClient*) const = 0;
    264     PassRefPtr<PlatformCALayer> createCompatibleLayerOrTakeFromPool(LayerType layerType, PlatformCALayerClient* client, IntSize);
     262    virtual Ref<PlatformCALayer> createCompatibleLayer(LayerType, PlatformCALayerClient*) const = 0;
     263    Ref<PlatformCALayer> createCompatibleLayerOrTakeFromPool(LayerType, PlatformCALayerClient*, IntSize);
    265264
    266265#if PLATFORM(COCOA)
  • trunk/Source/WebCore/platform/graphics/ca/TileCoverageMap.cpp

    r215160 r216448  
    3636    : m_controller(controller)
    3737    , m_updateTimer(*this, &TileCoverageMap::updateTimerFired)
    38     , m_layer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeSimpleLayer, this))
    39     , m_visibleViewportIndicatorLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
    40     , m_layoutViewportIndicatorLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
    41     , m_coverageRectIndicatorLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
     38    , m_layer(controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeSimpleLayer, this))
     39    , m_visibleViewportIndicatorLayer(controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
     40    , m_layoutViewportIndicatorLayer(controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
     41    , m_coverageRectIndicatorLayer(controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
    4242    , m_position(FloatPoint(0, controller.topContentInset()))
    4343{
  • trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp

    r215167 r216448  
    6666TileGrid::TileGrid(TileController& controller)
    6767    : m_controller(controller)
    68     , m_containerLayer(*controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
     68    , m_containerLayer(controller.rootLayer().createCompatibleLayer(PlatformCALayer::LayerTypeLayer, nullptr))
    6969    , m_cohortRemovalTimer(*this, &TileGrid::cohortRemovalTimerFired)
    7070    , m_tileSize(kDefaultTileSize, kDefaultTileSize)
  • trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h

    r213767 r216448  
    3434class PlatformCALayerCocoa final : public PlatformCALayer {
    3535public:
    36     static PassRefPtr<PlatformCALayer> create(LayerType, PlatformCALayerClient*);
     36    static Ref<PlatformCALayer> create(LayerType, PlatformCALayerClient*);
    3737   
    3838    // This function passes the layer as a void* rather than a PlatformLayer because PlatformLayer
    3939    // is defined differently for Obj C and C++. This allows callers from both languages.
    40     static PassRefPtr<PlatformCALayer> create(void* platformLayer, PlatformCALayerClient*);
     40    static Ref<PlatformCALayer> create(void* platformLayer, PlatformCALayerClient*);
    4141
    4242    WEBCORE_EXPORT static LayerType layerTypeForPlatformLayer(PlatformLayer*);
     
    6363    void addAnimationForKey(const String& key, PlatformCAAnimation&) override;
    6464    void removeAnimationForKey(const String& key) override;
    65     PassRefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
     65    RefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
    6666    void animationStarted(const String& key, CFTimeInterval beginTime) override;
    6767    void animationEnded(const String& key) override;
     
    170170    TiledBacking* tiledBacking() override;
    171171
    172     PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
    173 
    174     PassRefPtr<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const override;
     172    Ref<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
     173
     174    Ref<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const override;
    175175
    176176    void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) override;
  • trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm

    r213940 r216448  
    7070using namespace WebCore;
    7171
    72 PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::create(LayerType layerType, PlatformCALayerClient* owner)
    73 {
    74     return adoptRef(new PlatformCALayerCocoa(layerType, owner));
    75 }
    76 
    77 PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::create(void* platformLayer, PlatformCALayerClient* owner)
    78 {
    79     return adoptRef(new PlatformCALayerCocoa(static_cast<PlatformLayer*>(platformLayer), owner));
     72Ref<PlatformCALayer> PlatformCALayerCocoa::create(LayerType layerType, PlatformCALayerClient* owner)
     73{
     74    return adoptRef(*new PlatformCALayerCocoa(layerType, owner));
     75}
     76
     77Ref<PlatformCALayer> PlatformCALayerCocoa::create(void* platformLayer, PlatformCALayerClient* owner)
     78{
     79    return adoptRef(*new PlatformCALayerCocoa(static_cast<PlatformLayer*>(platformLayer), owner));
    8080}
    8181
     
    312312}
    313313
    314 PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::clone(PlatformCALayerClient* owner) const
     314Ref<PlatformCALayer> PlatformCALayerCocoa::clone(PlatformCALayerClient* owner) const
    315315{
    316316    LayerType type;
     
    333333        break;
    334334    };
    335     RefPtr<PlatformCALayer> newLayer = PlatformCALayerCocoa::create(type, owner);
     335    auto newLayer = PlatformCALayerCocoa::create(type, owner);
    336336   
    337337    newLayer->setPosition(position());
     
    353353        ASSERT([newLayer->platformLayer() isKindOfClass:getAVPlayerLayerClass()]);
    354354
    355         AVPlayerLayer *destinationPlayerLayer = static_cast<PlatformCALayerCocoa *>(newLayer.get())->avPlayerLayer();
     355        AVPlayerLayer *destinationPlayerLayer = static_cast<PlatformCALayerCocoa&>(newLayer.get()).avPlayerLayer();
    356356        AVPlayerLayer *sourcePlayerLayer = avPlayerLayer();
    357357        ASSERT(sourcePlayerLayer);
     
    509509}
    510510
    511 PassRefPtr<PlatformCAAnimation> PlatformCALayerCocoa::animationForKey(const String& key)
     511RefPtr<PlatformCAAnimation> PlatformCALayerCocoa::animationForKey(const String& key)
    512512{
    513513    CAPropertyAnimation* propertyAnimation = static_cast<CAPropertyAnimation*>([m_layer animationForKey:key]);
    514514    if (!propertyAnimation)
    515         return 0;
     515        return nullptr;
    516516    return PlatformCAAnimationCocoa::create(propertyAnimation);
    517517}
     
    11911191}
    11921192
    1193 PassRefPtr<PlatformCALayer> PlatformCALayerCocoa::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
     1193Ref<PlatformCALayer> PlatformCALayerCocoa::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
    11941194{
    11951195    return PlatformCALayerCocoa::create(layerType, client);
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp

    r213963 r216448  
    4848using namespace WebCore;
    4949
    50 PassRefPtr<PlatformCALayer> PlatformCALayerWin::create(LayerType layerType, PlatformCALayerClient* owner)
    51 {
    52     return adoptRef(new PlatformCALayerWin(layerType, nullptr, owner));
    53 }
    54 
    55 PassRefPtr<PlatformCALayer> PlatformCALayerWin::create(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
    56 {
    57     return adoptRef(new PlatformCALayerWin(LayerTypeCustom, platformLayer, owner));
     50Ref<PlatformCALayer> PlatformCALayerWin::create(LayerType layerType, PlatformCALayerClient* owner)
     51{
     52    return adoptRef(*new PlatformCALayerWin(layerType, nullptr, owner));
     53}
     54
     55Ref<PlatformCALayer> PlatformCALayerWin::create(PlatformLayer* platformLayer, PlatformCALayerClient* owner)
     56{
     57    return adoptRef(*new PlatformCALayerWin(LayerTypeCustom, platformLayer, owner));
    5858}
    5959
     
    182182}
    183183
    184 PassRefPtr<PlatformCALayer> PlatformCALayerWin::clone(PlatformCALayerClient* owner) const
     184Ref<PlatformCALayer> PlatformCALayerWin::clone(PlatformCALayerClient* owner) const
    185185{
    186186    PlatformCALayer::LayerType type = (layerType() == PlatformCALayer::LayerTypeTransformLayer) ?
    187187        PlatformCALayer::LayerTypeTransformLayer : PlatformCALayer::LayerTypeLayer;
    188     RefPtr<PlatformCALayer> newLayer = PlatformCALayerWin::create(type, owner);
     188    auto newLayer = PlatformCALayerWin::create(type, owner);
    189189
    190190    newLayer->setPosition(position());
     
    354354}
    355355
    356 PassRefPtr<PlatformCAAnimation> PlatformCALayerWin::animationForKey(const String& key)
     356RefPtr<PlatformCAAnimation> PlatformCALayerWin::animationForKey(const String& key)
    357357{
    358358    HashMap<String, RefPtr<PlatformCAAnimation> >::iterator it = m_animations.find(key);
     
    940940}
    941941
    942 PassRefPtr<PlatformCALayer> PlatformCALayerWin::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
     942Ref<PlatformCALayer> PlatformCALayerWin::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
    943943{
    944944    return PlatformCALayerWin::create(layerType, client);
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h

    r213191 r216448  
    3333class PlatformCALayerWin final : public PlatformCALayer {
    3434public:
    35     static PassRefPtr<PlatformCALayer> create(LayerType, PlatformCALayerClient*);
    36     static PassRefPtr<PlatformCALayer> create(PlatformLayer*, PlatformCALayerClient*);
     35    static Ref<PlatformCALayer> create(LayerType, PlatformCALayerClient*);
     36    static Ref<PlatformCALayer> create(PlatformLayer*, PlatformCALayerClient*);
    3737   
    3838    ~PlatformCALayerWin();
     
    5555    void addAnimationForKey(const String& key, PlatformCAAnimation&) override;
    5656    void removeAnimationForKey(const String& key) override;
    57     PassRefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
     57    RefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
    5858    void animationStarted(const String& key, CFTimeInterval beginTime) override;
    5959    void animationEnded(const String& key) override;
     
    166166    String layerTreeAsString() const override;
    167167
    168     PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
     168    Ref<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
    169169
    170     PassRefPtr<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const override;
     170    Ref<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const override;
    171171
    172172private:
  • trunk/Source/WebKit2/ChangeLog

    r216446 r216448  
     12017-05-08  Alex Christensen  <achristensen@webkit.org>
     2
     3        Reduce PassRefPtr use
     4        https://bugs.webkit.org/show_bug.cgi?id=171809
     5
     6        Reviewed by Chris Dumez.
     7
     8        * PluginProcess/PluginControllerProxy.cpp:
     9        (WebKit::PluginControllerProxy::setInitializationReply):
     10        * PluginProcess/PluginControllerProxy.h:
     11        * PluginProcess/WebProcessConnection.cpp:
     12        (WebKit::WebProcessConnection::destroyPlugin):
     13        (WebKit::WebProcessConnection::createPlugin):
     14        * PluginProcess/WebProcessConnection.h:
     15        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     16        (WebKit::WebChromeClient::runOpenPanel):
     17        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
     18        (WebKit::WebEditorClient::registerUndoStep):
     19        * WebProcess/WebPage/VisitedLinkTableController.cpp:
     20        (WebKit::VisitedLinkTableController::getOrCreate):
     21        * WebProcess/WebPage/VisitedLinkTableController.h:
     22        * WebProcess/WebPage/WebFrame.cpp:
     23        (WebKit::WebFrame::hitTest):
     24        (WebKit::WebFrame::createSelectionSnapshot):
     25        * WebProcess/WebPage/WebFrame.h:
     26        * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
     27        (WebKit::WebOpenPanelResultListener::create):
     28        (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
     29        * WebProcess/WebPage/WebOpenPanelResultListener.h:
     30        * WebProcess/WebPage/WebPage.cpp:
     31        (WebKit::WebPage::unapplyEditCommand):
     32        (WebKit::WebPage::reapplyEditCommand):
     33        * WebProcess/WebPage/WebPageGroupProxy.cpp:
     34        (WebKit::WebPageGroupProxy::create):
     35        * WebProcess/WebPage/WebPageGroupProxy.h:
     36        * WebProcess/WebPage/WebUndoStep.cpp:
     37        (WebKit::WebUndoStep::create):
     38        * WebProcess/WebPage/WebUndoStep.h:
     39        (WebKit::WebUndoStep::step):
     40        (WebKit::WebUndoStep::WebUndoStep):
     41        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     42        (WebKit::PlatformCALayerRemote::create):
     43        (WebKit::PlatformCALayerRemote::clone):
     44        (WebKit::PlatformCALayerRemote::animationForKey):
     45        (WebKit::PlatformCALayerRemote::createCompatibleLayer):
     46        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
     47        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
     48        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
     49        (WebKit::PlatformCALayerRemoteCustom::create):
     50        (WebKit::PlatformCALayerRemoteCustom::clone):
     51
    1522017-05-08  Jer Noble  <jer.noble@apple.com>
    253
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r215160 r216448  
    9292}
    9393
    94 void PluginControllerProxy::setInitializationReply(PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> reply)
     94void PluginControllerProxy::setInitializationReply(Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&& reply)
    9595{
    9696    ASSERT(!m_initializationReply);
    97     m_initializationReply = reply;
     97    m_initializationReply = WTFMove(reply);
    9898}
    9999
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h

    r204668 r216448  
    7676    bool isInitializing() const { return m_isInitializing; }
    7777   
    78     void setInitializationReply(PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>);
     78    void setInitializationReply(Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&&);
    7979    RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> takeInitializationReply();
    8080
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.cpp

    r208841 r216448  
    177177}
    178178
    179 void WebProcessConnection::destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, PassRefPtr<Messages::WebProcessConnection::DestroyPlugin::DelayedReply> reply)
     179void WebProcessConnection::destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, Ref<Messages::WebProcessConnection::DestroyPlugin::DelayedReply>&& reply)
    180180{
    181181    // We return immediately from this synchronous IPC. We want to make sure the plugin destruction is just about to start so audio playback
     
    230230}
    231231
    232 void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> reply)
     232void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&& reply)
    233233{
    234234    // Ensure we don't clamp any timers during initialization
     
    241241        // It might still be in the middle of initialization in which case we have to let that initialization complete and respond to this message later.
    242242        if (pluginControllerProxy->isInitializing()) {
    243             pluginControllerProxy->setInitializationReply(reply);
     243            pluginControllerProxy->setInitializationReply(WTFMove(reply));
    244244            return;
    245245        }
  • trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h

    r208329 r216448  
    2424 */
    2525
    26 #ifndef WebProcessConnection_h
    27 #define WebProcessConnection_h
     26#pragma once
    2827
    2928#if ENABLE(NETSCAPE_PLUGIN_API)
     
    7170    void didReceiveWebProcessConnectionMessage(IPC::Connection&, IPC::Decoder&);
    7271    void didReceiveSyncWebProcessConnectionMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
    73     void createPlugin(const PluginCreationParameters&, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>);
     72    void createPlugin(const PluginCreationParameters&, Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&&);
    7473    void createPluginAsynchronously(const PluginCreationParameters&);
    75     void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, PassRefPtr<Messages::WebProcessConnection::DestroyPlugin::DelayedReply>);
     74    void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, Ref<Messages::WebProcessConnection::DestroyPlugin::DelayedReply>&&);
    7675   
    7776    void createPluginInternal(const PluginCreationParameters&, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID);
     
    8786
    8887#endif // ENABLE(NETSCAPE_PLUGIN_API)
    89 
    90 
    91 #endif // WebProcessConnection_h
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r216047 r216448  
    774774        return;
    775775
    776     m_page.setActiveOpenPanelResultListener(WebOpenPanelResultListener::create(&m_page, &fileChooser));
     776    m_page.setActiveOpenPanelResultListener(WebOpenPanelResultListener::create(m_page, fileChooser));
    777777
    778778    auto* webFrame = WebFrame::fromCoreFrame(frame);
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp

    r216426 r216448  
    246246        return;
    247247
    248     auto webStep = WebUndoStep::create(&step);
    249     auto editAction = static_cast<uint32_t>(webStep->step()->editingAction());
     248    auto webStep = WebUndoStep::create(step);
     249    auto editAction = static_cast<uint32_t>(webStep->step().editingAction());
    250250
    251251    m_page->addWebUndoStep(webStep->stepID(), webStep.ptr());
  • trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp

    r207620 r216448  
    4545}
    4646
    47 PassRefPtr<VisitedLinkTableController> VisitedLinkTableController::getOrCreate(uint64_t identifier)
     47Ref<VisitedLinkTableController> VisitedLinkTableController::getOrCreate(uint64_t identifier)
    4848{
    4949    auto& visitedLinkTableControllerPtr = visitedLinkTableControllers().add(identifier, nullptr).iterator->value;
    5050    if (visitedLinkTableControllerPtr)
    51         return visitedLinkTableControllerPtr;
     51        return *visitedLinkTableControllerPtr;
    5252
    5353    auto visitedLinkTableController = adoptRef(*new VisitedLinkTableController(identifier));
    5454    visitedLinkTableControllerPtr = visitedLinkTableController.ptr();
    5555
    56     return WTFMove(visitedLinkTableController);
     56    return visitedLinkTableController;
    5757}
    5858
  • trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.h

    r204668 r216448  
    2424 */
    2525
    26 #ifndef VisitedLinkTableController_h
    27 #define VisitedLinkTableController_h
     26#pragma once
    2827
    2928#include "MessageReceiver.h"
     
    3635class VisitedLinkTableController final : public WebCore::VisitedLinkStore , private IPC::MessageReceiver {
    3736public:
    38     static PassRefPtr<VisitedLinkTableController> getOrCreate(uint64_t identifier);
     37    static Ref<VisitedLinkTableController> getOrCreate(uint64_t identifier);
    3938    virtual ~VisitedLinkTableController();
    4039
     
    5958
    6059} // namespace WebKit
    61 
    62 #endif // VisitedLinkTableController_h
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

    r216338 r216448  
    604604}
    605605
    606 PassRefPtr<InjectedBundleHitTestResult> WebFrame::hitTest(const IntPoint point) const
    607 {
    608     if (!m_coreFrame)
    609         return 0;
     606RefPtr<InjectedBundleHitTestResult> WebFrame::hitTest(const IntPoint point) const
     607{
     608    if (!m_coreFrame)
     609        return nullptr;
    610610
    611611    return InjectedBundleHitTestResult::create(m_coreFrame->eventHandler().hitTestResultAtPoint(point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowUserAgentShadowContent));
     
    819819#endif
    820820
    821 PassRefPtr<ShareableBitmap> WebFrame::createSelectionSnapshot() const
     821RefPtr<ShareableBitmap> WebFrame::createSelectionSnapshot() const
    822822{
    823823    std::unique_ptr<ImageBuffer> snapshot = snapshotSelection(*coreFrame(), WebCore::SnapshotOptionsForceBlackText);
     
    836836    graphicsContext->drawConsumingImageBuffer(WTFMove(snapshot), FloatPoint());
    837837
    838     return WTFMove(sharedSnapshot);
     838    return sharedSnapshot;
    839839}
    840840   
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h

    r212312 r216448  
    2424 */
    2525
    26 #ifndef WebFrame_h
    27 #define WebFrame_h
     26#pragma once
    2827
    2928#include "APIObject.h"
     
    3736#include <WebCore/PolicyChecker.h>
    3837#include <wtf/Forward.h>
    39 #include <wtf/PassRefPtr.h>
    4038#include <wtf/RefPtr.h>
    4139#include <wtf/RetainPtr.h>
     
    112110    bool hasHorizontalScrollbar() const;
    113111    bool hasVerticalScrollbar() const;
    114     PassRefPtr<InjectedBundleHitTestResult> hitTest(const WebCore::IntPoint) const;
     112    RefPtr<InjectedBundleHitTestResult> hitTest(const WebCore::IntPoint) const;
    115113    bool getDocumentBackgroundColor(double* red, double* green, double* blue, double* alpha);
    116114    bool containsAnyFormElements() const;
     
    159157#endif
    160158
    161     PassRefPtr<ShareableBitmap> createSelectionSnapshot() const;
     159    RefPtr<ShareableBitmap> createSelectionSnapshot() const;
    162160
    163161#if PLATFORM(IOS)
     
    187185
    188186} // namespace WebKit
    189 
    190 #endif // WebFrame_h
  • trunk/Source/WebKit2/WebProcess/WebPage/WebOpenPanelResultListener.cpp

    r186566 r216448  
    2727#include "WebOpenPanelResultListener.h"
    2828
     29#include <WebCore/FileChooser.h>
    2930#include <WebCore/Icon.h>
    3031
    3132namespace WebKit {
    3233
    33 Ref<WebOpenPanelResultListener> WebOpenPanelResultListener::create(WebPage* page, PassRefPtr<WebCore::FileChooser> fileChooser)
     34Ref<WebOpenPanelResultListener> WebOpenPanelResultListener::create(WebPage& page, Ref<WebCore::FileChooser>&& fileChooser)
    3435{
    35     return adoptRef(*new WebOpenPanelResultListener(page, fileChooser));
     36    return adoptRef(*new WebOpenPanelResultListener(page, WTFMove(fileChooser)));
    3637}
    3738
    38 WebOpenPanelResultListener::WebOpenPanelResultListener(WebPage* page, PassRefPtr<WebCore::FileChooser> fileChooser)
    39     : m_page(page)
    40     , m_fileChooser(fileChooser)
     39WebOpenPanelResultListener::WebOpenPanelResultListener(WebPage& page, Ref<WebCore::FileChooser>&& fileChooser)
     40    : m_page(&page)
     41    , m_fileChooser(WTFMove(fileChooser))
    4142{
    4243}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebOpenPanelResultListener.h

    r186566 r216448  
    2424 */
    2525
    26 #ifndef WebOpenPanelResultListener_h
    27 #define WebOpenPanelResultListener_h
     26#pragma once
    2827
     28#include <wtf/Forward.h>
     29#include <wtf/Ref.h>
    2930#include <wtf/RefCounted.h>
    30 #include <WebCore/FileChooser.h>
     31#include <wtf/Vector.h>
    3132
    3233namespace WebCore {
     34class FileChooser;
    3335class Icon;
    3436}
     
    4042class WebOpenPanelResultListener : public RefCounted<WebOpenPanelResultListener> {
    4143public:
    42     static Ref<WebOpenPanelResultListener> create(WebPage*, PassRefPtr<WebCore::FileChooser>);
     44    static Ref<WebOpenPanelResultListener> create(WebPage&, Ref<WebCore::FileChooser>&&);
    4345    ~WebOpenPanelResultListener();
    4446
     
    5052
    5153private:
    52     WebOpenPanelResultListener(WebPage*, PassRefPtr<WebCore::FileChooser>);
     54    WebOpenPanelResultListener(WebPage&, Ref<WebCore::FileChooser>&&);
    5355
    5456    WebPage* m_page;
    55     RefPtr<WebCore::FileChooser> m_fileChooser;
     57    Ref<WebCore::FileChooser> m_fileChooser;
    5658};
    5759
    5860} // namespace WebKit
    59 
    60 
    61 #endif // WebOpenPanelResultListener_h
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r216348 r216448  
    37113711        return;
    37123712
    3713     step->step()->unapply();
     3713    step->step().unapply();
    37143714}
    37153715
     
    37213721
    37223722    m_isInRedo = true;
    3723     step->step()->reapply();
     3723    step->step().reapply();
    37243724    m_isInRedo = false;
    37253725}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp

    r202242 r216448  
    3636namespace WebKit {
    3737
    38 PassRefPtr<WebPageGroupProxy> WebPageGroupProxy::create(const WebPageGroupData& data)
     38Ref<WebPageGroupProxy> WebPageGroupProxy::create(const WebPageGroupData& data)
    3939{
    4040    auto pageGroup = adoptRef(*new WebPageGroupProxy(data));
     
    4343        WebProcess::singleton().injectedBundle()->didInitializePageGroup(pageGroup.ptr());
    4444
    45     return WTFMove(pageGroup);
     45    return pageGroup;
    4646}
    4747
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h

    r198180 r216448  
    2424 */
    2525
    26 #ifndef WebPageGroupProxy_h
    27 #define WebPageGroupProxy_h
     26#pragma once
    2827
    2928#include "APIObject.h"
    3029#include "WebPageGroupData.h"
    31 #include <wtf/PassRefPtr.h>
     30#include <wtf/Ref.h>
    3231
    3332namespace WebCore {
     
    4140class WebPageGroupProxy : public API::ObjectImpl<API::Object::Type::BundlePageGroup> {
    4241public:
    43     static PassRefPtr<WebPageGroupProxy> create(const WebPageGroupData&);
     42    static Ref<WebPageGroupProxy> create(const WebPageGroupData&);
    4443    virtual ~WebPageGroupProxy();
    4544
     
    6160
    6261} // namespace WebKit
    63 
    64 #endif // WebPageGroupProxy_h
  • trunk/Source/WebKit2/WebProcess/WebPage/WebUndoStep.cpp

    r208342 r216448  
    3535}
    3636
    37 Ref<WebUndoStep> WebUndoStep::create(PassRefPtr<WebCore::UndoStep> step)
     37Ref<WebUndoStep> WebUndoStep::create(Ref<WebCore::UndoStep>&& step)
    3838{
    39     return adoptRef(*new WebUndoStep(step, generateUndoStep()));
     39    return adoptRef(*new WebUndoStep(WTFMove(step), generateUndoStep()));
    4040}
    4141
  • trunk/Source/WebKit2/WebProcess/WebPage/WebUndoStep.h

    r208342 r216448  
    2424 */
    2525
    26 #ifndef WebUndoStep_h
    27 #define WebUndoStep_h
     26#pragma once
    2827
    2928#include <WebCore/UndoStep.h>
    30 #include <wtf/PassRefPtr.h>
    31 #include <wtf/RefPtr.h>
     29#include <wtf/Ref.h>
    3230
    3331namespace WebKit {
     
    3533class WebUndoStep : public RefCounted<WebUndoStep> {
    3634public:
    37     static Ref<WebUndoStep> create(PassRefPtr<WebCore::UndoStep>);
     35    static Ref<WebUndoStep> create(Ref<WebCore::UndoStep>&&);
    3836    ~WebUndoStep();
    3937
    40     WebCore::UndoStep* step() const { return m_step.get(); }
     38    WebCore::UndoStep& step() const { return m_step.get(); }
    4139    uint64_t stepID() const { return m_stepID; }
    4240
    4341private:
    44     WebUndoStep(PassRefPtr<WebCore::UndoStep> step, uint64_t stepID)
    45         : m_step(step)
     42    WebUndoStep(Ref<WebCore::UndoStep>&& step, uint64_t stepID)
     43        : m_step(WTFMove(step))
    4644        , m_stepID(stepID)
    4745    {
    4846    }
    4947
    50     RefPtr<WebCore::UndoStep> m_step;
     48    Ref<WebCore::UndoStep> m_step;
    5149    uint64_t m_stepID;
    5250};
    5351
    5452} // namespace WebKit
    55 
    56 #endif // WebEditCommand_h
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp

    r212590 r216448  
    5050        result->setWantsDeepColorBackingStore(screenSupportsExtendedColor());
    5151
    52     return result;
     52    return WTFMove(result);
    5353}
    5454
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r216104 r216448  
    4545namespace WebKit {
    4646
    47 PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
     47Ref<PlatformCALayerRemote> PlatformCALayerRemote::create(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
    4848{
    4949    RefPtr<PlatformCALayerRemote> layer;
     
    5656    context.layerWasCreated(*layer, layerType);
    5757
    58     return WTFMove(layer);
    59 }
    60 
    61 PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(PlatformLayer *platformLayer, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
     58    return layer.releaseNonNull();
     59}
     60
     61Ref<PlatformCALayerRemote> PlatformCALayerRemote::create(PlatformLayer *platformLayer, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
    6262{
    6363    return PlatformCALayerRemoteCustom::create(platformLayer, owner, context);
    6464}
    6565
    66 PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(const PlatformCALayerRemote& other, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
     66Ref<PlatformCALayerRemote> PlatformCALayerRemote::create(const PlatformCALayerRemote& other, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
    6767{
    6868    auto layer = adoptRef(*new PlatformCALayerRemote(other, owner, context));
     
    7070    context.layerWasCreated(layer.get(), other.layerType());
    7171
    72     return WTFMove(layer);
     72    return layer;
    7373}
    7474
     
    9090}
    9191
    92 PassRefPtr<PlatformCALayer> PlatformCALayerRemote::clone(PlatformCALayerClient* owner) const
     92Ref<PlatformCALayer> PlatformCALayerRemote::clone(PlatformCALayerClient* owner) const
    9393{
    9494    auto clone = PlatformCALayerRemote::create(*this, owner, *m_context);
    9595
    96     updateClonedLayerProperties(*clone);
     96    updateClonedLayerProperties(clone);
    9797
    9898    clone->setClonedLayer(this);
     
    358358}
    359359
    360 PassRefPtr<PlatformCAAnimation> PlatformCALayerRemote::animationForKey(const String& key)
     360RefPtr<PlatformCAAnimation> PlatformCALayerRemote::animationForKey(const String& key)
    361361{
    362362    return m_animations.get(key);
     
    822822}
    823823
    824 PassRefPtr<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
     824Ref<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
    825825{
    826826    return PlatformCALayerRemote::create(layerType, client, *m_context);
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h

    r212776 r216448  
    4040class PlatformCALayerRemote : public WebCore::PlatformCALayer {
    4141public:
    42     static PassRefPtr<PlatformCALayerRemote> create(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
    43     static PassRefPtr<PlatformCALayerRemote> create(PlatformLayer *, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
    44     static PassRefPtr<PlatformCALayerRemote> create(const PlatformCALayerRemote&, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
     42    static Ref<PlatformCALayerRemote> create(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
     43    static Ref<PlatformCALayerRemote> create(PlatformLayer *, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
     44    static Ref<PlatformCALayerRemote> create(const PlatformCALayerRemote&, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
    4545
    4646    virtual ~PlatformCALayerRemote();
     
    6767    void addAnimationForKey(const String& key, WebCore::PlatformCAAnimation&) override;
    6868    void removeAnimationForKey(const String& key) override;
    69     PassRefPtr<WebCore::PlatformCAAnimation> animationForKey(const String& key) override;
     69    RefPtr<WebCore::PlatformCAAnimation> animationForKey(const String& key) override;
    7070    void animationStarted(const String& key, CFTimeInterval beginTime) override;
    7171    void animationEnded(const String& key) override;
     
    176176    WebCore::TiledBacking* tiledBacking() override { return nullptr; }
    177177
    178     PassRefPtr<WebCore::PlatformCALayer> clone(WebCore::PlatformCALayerClient* owner) const override;
    179 
    180     PassRefPtr<PlatformCALayer> createCompatibleLayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*) const override;
     178    Ref<WebCore::PlatformCALayer> clone(WebCore::PlatformCALayerClient* owner) const override;
     179
     180    Ref<PlatformCALayer> createCompatibleLayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*) const override;
    181181
    182182    void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) override;
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h

    r197563 r216448  
    2424 */
    2525
    26 #ifndef PlatformCALayerRemoteCustom_h
    27 #define PlatformCALayerRemoteCustom_h
     26#pragma once
    2827
    2928#include "PlatformCALayerRemote.h"
     
    3736    friend class PlatformCALayerRemote;
    3837public:
    39     static PassRefPtr<PlatformCALayerRemote> create(PlatformLayer *, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
     38    static Ref<PlatformCALayerRemote> create(PlatformLayer *, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext&);
    4039
    4140    virtual ~PlatformCALayerRemoteCustom();
     
    5150    PlatformCALayerRemoteCustom(WebCore::PlatformCALayer::LayerType, PlatformLayer *, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext&);
    5251
    53     PassRefPtr<WebCore::PlatformCALayer> clone(WebCore::PlatformCALayerClient* owner) const override;
     52    Ref<WebCore::PlatformCALayer> clone(WebCore::PlatformCALayerClient* owner) const override;
    5453
    5554    bool isPlatformCALayerRemoteCustom() const override { return true; }
     
    6665
    6766SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebKit::PlatformCALayerRemoteCustom, isPlatformCALayerRemote())
    68 
    69 #endif // PlatformCALayerRemoteCustom_h
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm

    r213940 r216448  
    4747static NSString * const platformCALayerPointer = @"WKPlatformCALayer";
    4848
    49 PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemoteCustom::create(PlatformLayer *platformLayer, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
     49Ref<PlatformCALayerRemote> PlatformCALayerRemoteCustom::create(PlatformLayer *platformLayer, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
    5050{
    5151    auto layer = adoptRef(*new PlatformCALayerRemoteCustom(PlatformCALayerCocoa::layerTypeForPlatformLayer(platformLayer), platformLayer, owner, context));
    5252    context.layerWasCreated(layer.get(), layer->layerType());
    53 
    5453    return WTFMove(layer);
    5554}
     
    101100}
    102101
    103 PassRefPtr<WebCore::PlatformCALayer> PlatformCALayerRemoteCustom::clone(PlatformCALayerClient* owner) const
     102Ref<WebCore::PlatformCALayer> PlatformCALayerRemoteCustom::clone(PlatformCALayerClient* owner) const
    104103{
    105104    RetainPtr<CALayer *> clonedLayer;
Note: See TracChangeset for help on using the changeset viewer.