Changeset 86537 in webkit


Ignore:
Timestamp:
May 16, 2011 12:24:01 AM (13 years ago)
Author:
abarth@webkit.org
Message:

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

[Qt] QtPlatformPlugin create methods should use PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=60873

This change is slightly more than a build fix because the patch kind of
spidered a bit while I was trying to fix the build the "right way."
Hopefully nothing here is controversial.

  • Api/qwebpage.cpp: (QWebPagePrivate::adjustPointForClicking):
  • WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::createSelectPopup):
  • WebCoreSupport/FullScreenVideoQt.cpp: (WebCore::FullScreenVideoQt::FullScreenVideoQt): (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
  • WebCoreSupport/FullScreenVideoQt.h:
  • WebCoreSupport/NotificationPresenterClientQt.cpp: (WebCore::NotificationWrapper::NotificationWrapper): (WebCore::NotificationPresenterClientQt::displayNotification):
  • WebCoreSupport/PopupMenuQt.cpp: (WebCore::PopupMenuQt::PopupMenuQt): (WebCore::PopupMenuQt::~PopupMenuQt): (WebCore::PopupMenuQt::show):
  • WebCoreSupport/PopupMenuQt.h:
  • WebCoreSupport/QtPlatformPlugin.cpp: (WebCore::QtPlatformPlugin::createSelectInputMethod): (WebCore::QtPlatformPlugin::createNotificationPresenter): (WebCore::QtPlatformPlugin::createHapticFeedbackPlayer): (WebCore::QtPlatformPlugin::createTouchModifier): (WebCore::QtPlatformPlugin::createFullScreenVideoHandler):
  • WebCoreSupport/QtPlatformPlugin.h: (WebCore::QtPlatformPlugin::QtPlatformPlugin):

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

[Qt] QtPlatformPlugin create methods should use PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=60873

  • plugins/qt/PluginViewQt.cpp: (WebCore::PluginView::platformStart):
Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86532 r86537  
     12011-05-16  Adam Barth  <abarth@webkit.org>
     2
     3        [Qt] QtPlatformPlugin create methods should use PassOwnPtr
     4        https://bugs.webkit.org/show_bug.cgi?id=60873
     5
     6        * plugins/qt/PluginViewQt.cpp:
     7        (WebCore::PluginView::platformStart):
     8
    192011-05-15  Adam Barth  <abarth@webkit.org>
    210
  • trunk/Source/WebCore/plugins/qt/PluginViewQt.cpp

    r84371 r86537  
    946946            && m_parentFrame->page()->settings()
    947947            && m_parentFrame->page()->settings()->acceleratedCompositingEnabled()) {
    948             m_platformLayer = new PluginGraphicsLayerQt(this);
     948            m_platformLayer = adoptPtr(new PluginGraphicsLayerQt(this));
    949949            // Trigger layer computation in RenderLayerCompositor
    950950            m_element->setNeedsStyleRecalc(SyntheticStyleChange);
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r86533 r86537  
    13201320{
    13211321    QtPlatformPlugin platformPlugin;
    1322     QWebTouchModifier* touchModifier = platformPlugin.createTouchModifier();
     1322    OwnPtr<QWebTouchModifier> touchModifier = platformPlugin.createTouchModifier();
    13231323    if (!touchModifier)
    13241324        return;
     
    13291329    unsigned leftPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Left);
    13301330
    1331     delete touchModifier;
    1332     touchModifier = 0;
     1331    touchModifier = nullptr;
    13331332
    13341333    if (!topPadding && !rightPadding && !bottomPadding && !leftPadding)
  • trunk/Source/WebKit/qt/ChangeLog

    r86533 r86537  
     12011-05-16  Adam Barth  <abarth@webkit.org>
     2
     3        [Qt] QtPlatformPlugin create methods should use PassOwnPtr
     4        https://bugs.webkit.org/show_bug.cgi?id=60873
     5
     6        This change is slightly more than a build fix because the patch kind of
     7        spidered a bit while I was trying to fix the build the "right way."
     8        Hopefully nothing here is controversial.
     9
     10        * Api/qwebpage.cpp:
     11        (QWebPagePrivate::adjustPointForClicking):
     12        * WebCoreSupport/ChromeClientQt.cpp:
     13        (WebCore::ChromeClientQt::createSelectPopup):
     14        * WebCoreSupport/FullScreenVideoQt.cpp:
     15        (WebCore::FullScreenVideoQt::FullScreenVideoQt):
     16        (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
     17        * WebCoreSupport/FullScreenVideoQt.h:
     18        * WebCoreSupport/NotificationPresenterClientQt.cpp:
     19        (WebCore::NotificationWrapper::NotificationWrapper):
     20        (WebCore::NotificationPresenterClientQt::displayNotification):
     21        * WebCoreSupport/PopupMenuQt.cpp:
     22        (WebCore::PopupMenuQt::PopupMenuQt):
     23        (WebCore::PopupMenuQt::~PopupMenuQt):
     24        (WebCore::PopupMenuQt::show):
     25        * WebCoreSupport/PopupMenuQt.h:
     26        * WebCoreSupport/QtPlatformPlugin.cpp:
     27        (WebCore::QtPlatformPlugin::createSelectInputMethod):
     28        (WebCore::QtPlatformPlugin::createNotificationPresenter):
     29        (WebCore::QtPlatformPlugin::createHapticFeedbackPlayer):
     30        (WebCore::QtPlatformPlugin::createTouchModifier):
     31        (WebCore::QtPlatformPlugin::createFullScreenVideoHandler):
     32        * WebCoreSupport/QtPlatformPlugin.h:
     33        (WebCore::QtPlatformPlugin::QtPlatformPlugin):
     34
    1352011-05-15  Adam Barth  <abarth@webkit.org>
    236
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r86451 r86537  
    697697#endif
    698698
    699 QWebSelectMethod* ChromeClientQt::createSelectPopup() const
    700 {
    701     QWebSelectMethod* result = m_platformPlugin.createSelectInputMethod();
     699PassOwnPtr<QWebSelectMethod> ChromeClientQt::createSelectPopup() const
     700{
     701    OwnPtr<QWebSelectMethod> result = m_platformPlugin.createSelectInputMethod();
    702702    if (result)
    703         return result;
     703        return result.release();
    704704
    705705#if defined(Q_WS_MAEMO_5)
    706     return new QtMaemoWebPopup;
     706    return adoptPtr(new QtMaemoWebPopup);
    707707#elif !defined(QT_NO_COMBOBOX)
    708     return new QtFallbackWebPopup(this);
     708    return adoptPtr(new QtFallbackWebPopup(this));
    709709#else
    710     return 0;
     710    return nullptr;
    711711#endif
    712712}
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r85823 r86537  
    3535#include "PlatformString.h"
    3636#include "QtPlatformPlugin.h"
     37#include <wtf/PassOwnPtr.h>
    3738#include <wtf/RefCounted.h>
    3839
     
    190191    virtual void populateVisitedLinks();
    191192
    192     QWebSelectMethod* createSelectPopup() const;
     193    PassOwnPtr<QWebSelectMethod> createSelectPopup() const;
    193194
    194195    virtual void dispatchViewportDataDidChange(const ViewportArguments&) const;
  • trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp

    r83108 r86537  
    139139    m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler();
    140140    if (!m_FullScreenVideoHandler)
    141         m_FullScreenVideoHandler = new DefaultFullScreenVideoHandler;
     141        m_FullScreenVideoHandler = adoptPtr(new DefaultFullScreenVideoHandler);
    142142
    143143    if (m_FullScreenVideoHandler)
    144         connect(m_FullScreenVideoHandler, SIGNAL(fullScreenClosed()), this, SLOT(aboutToClose()));
    145 #endif
    146 
    147 #if USE(GSTREAMER)
    148     m_FullScreenVideoHandlerGStreamer = new GStreamerFullScreenVideoHandler;
     144        connect(m_FullScreenVideoHandler.get(), SIGNAL(fullScreenClosed()), this, SLOT(aboutToClose()));
     145#endif
     146
     147#if USE(GSTREAMER)
     148    m_FullScreenVideoHandlerGStreamer = adoptPtr(new GStreamerFullScreenVideoHandler);
    149149#endif
    150150}
     
    152152FullScreenVideoQt::~FullScreenVideoQt()
    153153{
    154 #if USE(QT_MULTIMEDIA)
    155     delete m_FullScreenVideoHandler;
    156 #endif
    157 #if USE(GSTREAMER)
    158     delete m_FullScreenVideoHandlerGStreamer;
    159 #endif
    160154}
    161155
  • trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h

    r83108 r86537  
    2424#include <QObject>
    2525#include <wtf/Platform.h>
     26#include <wtf/OwnPtr.h>
    2627
    2728QT_BEGIN_NAMESPACE
     
    105106    HTMLVideoElement* m_videoElement;
    106107#if USE(QT_MULTIMEDIA)
    107     QWebFullScreenVideoHandler* m_FullScreenVideoHandler;
     108    OwnPtr<QWebFullScreenVideoHandler> m_FullScreenVideoHandler;
    108109#endif
    109110#if USE(GSTREAMER)
    110     GStreamerFullScreenVideoHandler* m_FullScreenVideoHandlerGStreamer;
     111    OwnPtr<GStreamerFullScreenVideoHandler> m_FullScreenVideoHandlerGStreamer;
    111112#endif
    112113};
  • trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp

    r79098 r86537  
    7474
    7575#ifndef QT_NO_SYSTEMTRAYICON
    76     m_notificationIcon = 0;
    77 #endif
    78     m_presenter = 0;
     76    m_notificationIcon = nullptr;
     77#endif
     78    m_presenter = nullptr;
    7979#endif
    8080}
     
    212212        if (bytes.length() && pixmap.loadFromData(bytes)) {
    213213            QIcon icon(pixmap);
    214             wrapper->m_notificationIcon = new QSystemTrayIcon(icon);
     214            wrapper->m_notificationIcon = adoptPtr(new QSystemTrayIcon(icon));
    215215        } else
    216             wrapper->m_notificationIcon = new QSystemTrayIcon();
     216            wrapper->m_notificationIcon = adoptPtr(new QSystemTrayIcon());
    217217#endif
    218218    }
  • trunk/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp

    r82075 r86537  
    8383PopupMenuQt::PopupMenuQt(PopupMenuClient* client, const ChromeClientQt* chromeClient)
    8484    : m_popupClient(client)
    85     , m_popup(0)
    86     , m_selectData(0)
    8785    , m_chromeClient(chromeClient)
    8886{
     
    9189PopupMenuQt::~PopupMenuQt()
    9290{
    93     delete m_selectData;
    94     delete m_popup;
    9591}
    9692
     
    108104    if (!m_popup) {
    109105        m_popup = m_chromeClient->createSelectPopup();
    110         connect(m_popup, SIGNAL(didHide()), this, SLOT(didHide()));
    111         connect(m_popup, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool)));
     106        connect(m_popup.get(), SIGNAL(didHide()), this, SLOT(didHide()));
     107        connect(m_popup.get(), SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool)));
    112108    }
    113109
    114     if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup)) {
     110    if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup.get())) {
    115111        QRect geometry(rect);
    116112        geometry.moveTopLeft(view->contentsToWindow(rect.location()));
     
    119115    }
    120116
    121     if (m_selectData)
    122         delete m_selectData;
    123     m_selectData = new SelectData(m_popupClient);
    124     m_popup->show(*m_selectData);
     117    m_selectData = adoptPtr(new SelectData(m_popupClient));
     118    m_popup->show(*m_selectData.get());
    125119#endif
    126120}
  • trunk/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h

    r64829 r86537  
    2323#include "PopupMenu.h"
    2424#include <QObject>
     25#include <wtf/PassOwnPtr.h>
    2526
    2627class QWebSelectData;
     
    5051private:
    5152    PopupMenuClient* m_popupClient;
    52     QWebSelectMethod* m_popup;
    53     QWebSelectData* m_selectData;
     53    OwnPtr<QWebSelectMethod> m_popup;
     54    OwnPtr<QWebSelectData> m_selectData;
    5455    const ChromeClientQt* m_chromeClient;
    5556};
  • trunk/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp

    r83108 r86537  
    103103}
    104104
    105 QWebSelectMethod* QtPlatformPlugin::createSelectInputMethod()
     105PassOwnPtr<QWebSelectMethod> QtPlatformPlugin::createSelectInputMethod()
    106106{
    107107    QWebKitPlatformPlugin* p = plugin();
    108     return p ? static_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0;
     108    return adoptPtr(p ? static_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0);
    109109}
    110110
    111 
    112 QWebNotificationPresenter* QtPlatformPlugin::createNotificationPresenter()
     111PassOwnPtr<QWebNotificationPresenter> QtPlatformPlugin::createNotificationPresenter()
    113112{
    114113    QWebKitPlatformPlugin* p = plugin();
    115     return p ? static_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0;
     114    return adoptPtr(p ? static_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0);
    116115}
    117116
    118 QWebHapticFeedbackPlayer* QtPlatformPlugin::createHapticFeedbackPlayer()
     117PassOwnPtr<QWebHapticFeedbackPlayer> QtPlatformPlugin::createHapticFeedbackPlayer()
    119118{
    120119    QWebKitPlatformPlugin* p = plugin();
    121     return p ? static_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0;
     120    return adoptPtr(p ? static_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0);
    122121}
    123122
    124 QWebTouchModifier* QtPlatformPlugin::createTouchModifier()
     123PassOwnPtr<QWebTouchModifier> QtPlatformPlugin::createTouchModifier()
    125124{
    126125    QWebKitPlatformPlugin* p = plugin();
    127     return p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0;
     126    return adoptPtr(p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0);
    128127}
    129128
    130129#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
    131 QWebFullScreenVideoHandler* QtPlatformPlugin::createFullScreenVideoHandler()
     130PassOwnPtr<QWebFullScreenVideoHandler> QtPlatformPlugin::createFullScreenVideoHandler()
    132131{
    133132    QWebKitPlatformPlugin* p = plugin();
    134     return p ? static_cast<QWebFullScreenVideoHandler*>(p->createExtension(QWebKitPlatformPlugin::FullScreenVideoPlayer)) : 0;
     133    return adoptPtr(p ? static_cast<QWebFullScreenVideoHandler*>(p->createExtension(QWebKitPlatformPlugin::FullScreenVideoPlayer)) : 0);
    135134}
    136135#endif
  • trunk/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h

    r83108 r86537  
    2323
    2424#include <QPluginLoader>
     25#include <wtf/PassOwnPtr.h>
    2526
    2627class QWebSelectMethod;
     
    3839class QtPlatformPlugin {
    3940public:
    40     QtPlatformPlugin() : m_loaded(false), m_plugin(0) {}
     41    QtPlatformPlugin()
     42        : m_loaded(false)
     43        , m_plugin(0)
     44    {
     45    }
     46
    4147    ~QtPlatformPlugin();
    4248
    43     QWebSelectMethod* createSelectInputMethod();
    44     QWebNotificationPresenter* createNotificationPresenter();
    45     QWebHapticFeedbackPlayer* createHapticFeedbackPlayer();
    46     QWebTouchModifier* createTouchModifier();
     49    PassOwnPtr<QWebSelectMethod> createSelectInputMethod();
     50    PassOwnPtr<QWebNotificationPresenter> createNotificationPresenter();
     51    PassOwnPtr<QWebHapticFeedbackPlayer> createHapticFeedbackPlayer();
     52    PassOwnPtr<QWebTouchModifier> createTouchModifier();
    4753#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
    48     QWebFullScreenVideoHandler* createFullScreenVideoHandler();
     54    PassOwnPtr<QWebFullScreenVideoHandler> createFullScreenVideoHandler();
    4955#endif
    5056
Note: See TracChangeset for help on using the changeset viewer.