Changeset 60566 in webkit


Ignore:
Timestamp:
Jun 2, 2010 7:31:13 AM (14 years ago)
Author:
yael.aharon@nokia.com
Message:

[Qt] Fix the lifecycle of notification objects
https://bugs.webkit.org/show_bug.cgi?id=40003

Reviewed by Kenneth Rohde Christiansen.

WebKit/qt:

Notification objects are not tightly related to the page that created them,
and should be decoupled from the page.
Create one NotificationPresenter that handles all notifications.
Add ref/deref to the notification objects when they are added/removed from
the queue of active notifications. The same technique is used for XMLHttpRequest.
Instead of deleting all notifications associated with a page when the page is navigated,
delete them on a timer, using the same timeout that QSystemTrayIcon is using.
Break up the show() method into smaller methods.
Use OwnPtr instead of raw pointer for QSystemTrayIcon.
Move creating the QIcon to just before showing it in the QSyetemTrayIcon.

No new tests as this is just a refactoring. Existing notifications test cover the code.

  • Api/qwebpage.cpp:

(QWebPagePrivate::QWebPagePrivate):
(QWebPagePrivate::~QWebPagePrivate):

  • Api/qwebpage_p.h:
  • WebCoreSupport/ChromeClientQt.cpp:

(WebCore::ChromeClientQt::notificationPresenter):

  • WebCoreSupport/DumpRenderTreeSupportQt.cpp:

(DumpRenderTreeSupportQt::setNotificationsReceiver):
(DumpRenderTreeSupportQt::allowNotificationForOrigin):

  • WebCoreSupport/DumpRenderTreeSupportQt.h:
  • WebCoreSupport/FrameLoaderClientQt.cpp:

(WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld):

  • WebCoreSupport/NotificationPresenterClientQt.cpp:

(WebCore::NotificationPresenterClientQt::notificationPresenter):
(WebCore::NotificationIconWrapper::NotificationIconWrapper):
(WebCore::NotificationIconWrapper::~NotificationIconWrapper):
(WebCore::NotificationIconWrapper::close):
(WebCore::NotificationPresenterClientQt::NotificationPresenterClientQt):
(WebCore::NotificationPresenterClientQt::removeClient):
(WebCore::NotificationPresenterClientQt::show):
(WebCore::NotificationPresenterClientQt::displayNotification):
(WebCore::NotificationPresenterClientQt::cancel):
(WebCore::NotificationPresenterClientQt::notificationObjectDestroyed):
(WebCore::NotificationPresenterClientQt::requestPermission):
(WebCore::NotificationPresenterClientQt::sendEvent):
(WebCore::NotificationPresenterClientQt::removeReplacedNotificationFromQueue):
(WebCore::NotificationPresenterClientQt::dumpReplacedIdText):
(WebCore::NotificationPresenterClientQt::dumpShowText):

  • WebCoreSupport/NotificationPresenterClientQt.h:

(WebCore::NotificationPresenterClientQt::addClient):

WebKitTools:

Remove the dependency of notifications on QWebPage.

  • DumpRenderTree/qt/DumpRenderTreeQt.cpp:

(WebCore::requestPermissionCallback):
(WebCore::WebPage::WebPage):
(WebCore::DumpRenderTree::requestPermission):

  • DumpRenderTree/qt/DumpRenderTreeQt.h:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r60410 r60566  
    300300   
    301301#if ENABLE(NOTIFICATIONS)   
    302     notificationPresenterClient = new NotificationPresenterClientQt(q);
     302    NotificationPresenterClientQt::notificationPresenter()->addClient();
    303303#endif
    304304}
     
    316316   
    317317#if ENABLE(NOTIFICATIONS)
    318     delete notificationPresenterClient;
     318    NotificationPresenterClientQt::notificationPresenter()->removeClient();
    319319#endif
    320320}
  • trunk/WebKit/qt/Api/qwebpage_p.h

    r58405 r60566  
    4545    class Element;
    4646    class InspectorController;
    47     class NotificationPresenterClientQt;
    4847    class Node;
    4948    class Page;
     
    192191    Qt::DropAction m_lastDropAction;
    193192   
    194     WebCore::NotificationPresenterClientQt* notificationPresenterClient;
    195 
    196193    QString viewMode;
    197194
  • trunk/WebKit/qt/ChangeLog

    r60537 r60566  
     12010-06-01  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Fix the lifecycle of notification objects
     6        https://bugs.webkit.org/show_bug.cgi?id=40003
     7
     8        Notification objects are not tightly related to the page that created them,
     9        and should be decoupled from the page.
     10        Create one NotificationPresenter that handles all notifications.
     11        Add ref/deref to the notification objects when they are added/removed from
     12        the queue of active notifications. The same technique is used for XMLHttpRequest.
     13        Instead of deleting all notifications associated with a page when the page is navigated,
     14        delete them on a timer, using the same timeout that QSystemTrayIcon is using.
     15        Break up the show() method into smaller methods.
     16        Use OwnPtr instead of raw pointer for QSystemTrayIcon.
     17        Move creating the QIcon to just before showing it in the QSyetemTrayIcon.
     18
     19        No new tests as this is just a refactoring. Existing notifications test cover the code.
     20
     21        * Api/qwebpage.cpp:
     22        (QWebPagePrivate::QWebPagePrivate):
     23        (QWebPagePrivate::~QWebPagePrivate):
     24        * Api/qwebpage_p.h:
     25        * WebCoreSupport/ChromeClientQt.cpp:
     26        (WebCore::ChromeClientQt::notificationPresenter):
     27        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     28        (DumpRenderTreeSupportQt::setNotificationsReceiver):
     29        (DumpRenderTreeSupportQt::allowNotificationForOrigin):
     30        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     31        * WebCoreSupport/FrameLoaderClientQt.cpp:
     32        (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld):
     33        * WebCoreSupport/NotificationPresenterClientQt.cpp:
     34        (WebCore::NotificationPresenterClientQt::notificationPresenter):
     35        (WebCore::NotificationIconWrapper::NotificationIconWrapper):
     36        (WebCore::NotificationIconWrapper::~NotificationIconWrapper):
     37        (WebCore::NotificationIconWrapper::close):
     38        (WebCore::NotificationPresenterClientQt::NotificationPresenterClientQt):
     39        (WebCore::NotificationPresenterClientQt::removeClient):
     40        (WebCore::NotificationPresenterClientQt::show):
     41        (WebCore::NotificationPresenterClientQt::displayNotification):
     42        (WebCore::NotificationPresenterClientQt::cancel):
     43        (WebCore::NotificationPresenterClientQt::notificationObjectDestroyed):
     44        (WebCore::NotificationPresenterClientQt::requestPermission):
     45        (WebCore::NotificationPresenterClientQt::sendEvent):
     46        (WebCore::NotificationPresenterClientQt::removeReplacedNotificationFromQueue):
     47        (WebCore::NotificationPresenterClientQt::dumpReplacedIdText):
     48        (WebCore::NotificationPresenterClientQt::dumpShowText):
     49        * WebCoreSupport/NotificationPresenterClientQt.h:
     50        (WebCore::NotificationPresenterClientQt::addClient):
     51
    1522010-06-01  Noam Rosenthal  <noam.rosenthal@nokia.com>
    253
  • trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r59765 r60566  
    488488NotificationPresenter* ChromeClientQt::notificationPresenter() const
    489489{
    490     return m_webPage->d->notificationPresenterClient;
     490    return NotificationPresenterClientQt::notificationPresenter();
    491491}
    492492#endif
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r60349 r60566  
    538538}
    539539
    540 void DumpRenderTreeSupportQt::setNotificationsReceiver(QWebPage* page, QObject* receiver)
     540void DumpRenderTreeSupportQt::setNotificationsReceiver(QObject* receiver)
    541541{
    542542#if ENABLE(NOTIFICATIONS)
    543     page->d->notificationPresenterClient->setReceiver(receiver);
    544 #endif
    545 }
    546 
    547 void DumpRenderTreeSupportQt::allowNotificationForOrigin(QWebPage* page, const QString& origin)
     543    NotificationPresenterClientQt::notificationPresenter()->setReceiver(receiver);
     544#endif
     545}
     546
     547void DumpRenderTreeSupportQt::allowNotificationForOrigin(const QString& origin)
    548548{
    549549#if ENABLE(NOTIFICATIONS)
    550     page->d->notificationPresenterClient->allowNotificationForOrigin(origin);
     550    NotificationPresenterClientQt::notificationPresenter()->allowNotificationForOrigin(origin);
    551551#endif
    552552}
  • trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r60348 r60566  
    3838
    3939typedef void (CheckPermissionFunctionType) (QObject* receiver, const QUrl&, NotificationPermission&);
    40 typedef void (RequestPermissionFunctionType) (QObject* receiver, QWebPage* page, const QString&);
     40typedef void (RequestPermissionFunctionType) (QObject* receiver, const QString&);
    4141
    4242extern CheckPermissionFunctionType* checkPermissionFunction;
     
    115115    // These functions should eventually turn into public API
    116116    // and the "receiver" concept would go away
    117     static void setNotificationsReceiver(QWebPage* page, QObject* receiver);
    118     static void allowNotificationForOrigin(QWebPage* page, const QString& origin);
     117    static void setNotificationsReceiver(QObject* receiver);
     118    static void allowNotificationForOrigin(const QString& origin);
    119119    static void setCheckPermissionFunction(CheckPermissionFunctionType*);
    120120    static void setRequestPermissionFunction(RequestPermissionFunctionType*);
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r60348 r60566  
    5252#include "HTMLPlugInElement.h"
    5353#include "HTTPParsers.h"
    54 #include "NotificationPresenterClientQt.h"
    5554#include "NotImplemented.h"
    5655#include "QNetworkReplyHandler.h"
     
    642641    if (m_webFrame) {
    643642        emit m_webFrame->javaScriptWindowObjectCleared();
    644 #if ENABLE(NOTIFICATIONS)
    645         m_webFrame->page()->d->notificationPresenterClient->clearNotificationsList();
    646 #endif
    647643    }
    648644}
  • trunk/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp

    r60348 r60566  
    3939#include "SecurityOrigin.h"
    4040
    41 #include "qwebframe.h"
    4241#include "qwebkitglobal.h"
    43 #include "qwebpage.h"
    4442#include <QtGui>
    4543
    46 
    4744#if ENABLE(NOTIFICATIONS)
    4845
    49 using namespace WebCore;
     46namespace WebCore {
     47
     48const double notificationTimeout = 10.0;
    5049
    5150bool NotificationPresenterClientQt::dumpNotification = false;
    5251
     52NotificationPresenterClientQt* s_notificationPresenter = 0;
     53
     54NotificationPresenterClientQt* NotificationPresenterClientQt::notificationPresenter()
     55{
     56    if (s_notificationPresenter)
     57        return s_notificationPresenter;
     58
     59    s_notificationPresenter = new NotificationPresenterClientQt();
     60    return s_notificationPresenter;
     61}
     62
    5363NotificationIconWrapper::NotificationIconWrapper()
     64    : m_closeTimer(this, &NotificationIconWrapper::close)
    5465{
    5566#ifndef QT_NO_SYSTEMTRAYICON
    5667    m_notificationIcon = 0;
    5768#endif
     69    m_closeTimer.startOneShot(notificationTimeout);
    5870}
    5971
    6072NotificationIconWrapper::~NotificationIconWrapper()
    6173{
    62 #ifndef QT_NO_SYSTEMTRAYICON
    63     delete m_notificationIcon;
    64 #endif
    65 }
    66 
    67 NotificationPresenterClientQt::NotificationPresenterClientQt(QWebPage* page) : m_page(page)
    68 {
     74}
     75
     76void NotificationIconWrapper::close(Timer<NotificationIconWrapper>*)
     77{
     78    NotificationPresenterClientQt::notificationPresenter()->cancel(this);
     79}
     80
     81NotificationPresenterClientQt::NotificationPresenterClientQt() : m_clientCount(0)
     82{
     83}
     84
     85void NotificationPresenterClientQt::removeClient()
     86{
     87    m_clientCount--;
     88    if (!m_clientCount) {
     89        s_notificationPresenter = 0;
     90        delete this;
     91    }
    6992}
    7093
    7194bool NotificationPresenterClientQt::show(Notification* notification)
    7295{
    73     QHash <Notification*, NotificationIconWrapper*>::Iterator end = m_notifications.end();
    74     QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.begin();
    75 
     96    // FIXME: workers based notifications are not supported yet.
     97    if (notification->scriptExecutionContext()->isWorkerContext())
     98        return false;
     99    notification->setPendingActivity(notification);
    76100    if (!notification->replaceId().isEmpty()) {
    77         while (iter != end) {
    78             Notification* existingNotification = iter.key();
    79             if (existingNotification->replaceId() == notification->replaceId() && existingNotification->url().protocol() == notification->url().protocol() && existingNotification->url().host() == notification->url().host())
    80                 break;
    81             iter++;
    82         }
    83     } else
    84         iter = end;
    85 
    86     if (dumpNotification) {
    87         if (iter != end) {
    88             Notification* oldNotification = iter.key();
    89             printf("REPLACING NOTIFICATION %s\n", oldNotification->isHTML() ? QString(oldNotification->url().string()).toUtf8().constData() : QString(oldNotification->contents().title()).toUtf8().constData());
    90         }
    91         if (notification->isHTML())
    92             printf("DESKTOP NOTIFICATION: contents at %s\n", QString(notification->url().string()).toUtf8().constData());
    93         else {
    94             printf("DESKTOP NOTIFICATION:%s icon %s, title %s, text %s\n",
    95                 notification->dir() == "rtl" ? "(RTL)" : "",
    96                 QString(notification->contents().icon().string()).toUtf8().constData(), QString(notification->contents().title()).toUtf8().constData(),
    97                 QString(notification->contents().body()).toUtf8().constData());
    98         }
    99     }
    100 
    101     if (iter != end) {
    102         sendEvent(iter.key(), eventNames().closeEvent);
    103         delete m_notifications.take(iter.key());
    104     }
     101        removeReplacedNotificationFromQueue(notification);
     102    }
     103    if (dumpNotification)
     104        dumpShowText(notification);
     105    displayNotification(notification, QByteArray());
     106    return true;
     107}
     108
     109void NotificationPresenterClientQt::displayNotification(Notification* notification, const QByteArray& bytes)
     110{
    105111    NotificationIconWrapper* wrapper = new NotificationIconWrapper();
    106112    m_notifications.insert(notification, wrapper);
     113    QString title;
     114    QString message;
     115    // FIXME: download & display HTML notifications
     116    if (notification->isHTML())
     117        message = notification->url().string();
     118    else {
     119        title = notification->contents().title();
     120        message = notification->contents().body();
     121    }
     122
     123#ifndef QT_NO_SYSTEMTRAYICON
     124    QPixmap pixmap;
     125    if (bytes.length() && pixmap.loadFromData(bytes)) {
     126        QIcon icon(pixmap);
     127        wrapper->m_notificationIcon = new QSystemTrayIcon(icon);
     128    } else
     129        wrapper->m_notificationIcon = new QSystemTrayIcon();
     130#endif
     131
    107132    sendEvent(notification, "display");
    108133
     134    // Make sure the notification was not cancelled during handling the display event
     135    if (m_notifications.find(notification) == m_notifications.end())
     136        return;
     137
    109138#ifndef QT_NO_SYSTEMTRAYICON
    110     wrapper->m_notificationIcon = new QSystemTrayIcon;
    111139    wrapper->m_notificationIcon->show();
    112140    wrapper->m_notificationIcon->showMessage(notification->contents().title(), notification->contents().body());
    113141#endif
    114     return true;
    115142}
    116143
    117144void NotificationPresenterClientQt::cancel(Notification* notification)
    118 { 
     145{
    119146    if (dumpNotification) {
    120147        if (notification->isHTML())
     
    124151    }
    125152
    126     QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.find(notification);
    127     if (iter != m_notifications.end())
    128         sendEvent(iter.key(), eventNames().closeEvent);
     153    NotificationsQueue::Iterator iter = m_notifications.find(notification);
     154    if (iter != m_notifications.end()) {
     155        sendEvent(notification, eventNames().closeEvent);
     156        delete m_notifications.take(notification);
     157        notification->unsetPendingActivity(notification);
     158    }
     159}
     160
     161void NotificationPresenterClientQt::cancel(NotificationIconWrapper* wrapper)
     162{
     163    NotificationsQueue::Iterator end = m_notifications.end();
     164    NotificationsQueue::Iterator iter = m_notifications.begin();
     165    while (iter != end && iter.value() != wrapper)
     166        iter++;
     167    if (iter != end)
     168        cancel(iter.key());
    129169}
    130170
     
    132172{
    133173    // Called from ~Notification(), Remove the entry from the notifications list and delete the icon.
    134     QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.find(notification);
     174    NotificationsQueue::Iterator iter = m_notifications.find(notification);
    135175    if (iter != m_notifications.end())
    136176        delete m_notifications.take(notification);
     
    140180
    141181    if (dumpNotification)
    142       printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", QString(origin->toString()).toUtf8().constData());
     182        printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", QString(origin->toString()).toUtf8().constData());
    143183
    144184    QString originString = origin->toString();
     
    152192        m_pendingPermissionRequests.insert(originString, callbacks);
    153193        if (requestPermissionFunction)
    154             requestPermissionFunction(m_receiver, m_page, originString);
     194            requestPermissionFunction(m_receiver, originString);
    155195    }
    156196}
     
    185225}
    186226
    187 void NotificationPresenterClientQt::clearNotificationsList()
    188 {
    189     m_pendingPermissionRequests.clear();
    190     while (!m_notifications.isEmpty()) {
    191         QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.begin();
    192         delete m_notifications.take(iter.key());
    193     }
    194 }
    195 
    196227void NotificationPresenterClientQt::sendEvent(Notification* notification, const AtomicString& eventName)
    197228{
    198     RefPtr<Event> event = Event::create(eventName, false, true);
    199     notification->dispatchEvent(event.release());
    200 }
    201 
     229    notification->dispatchEvent(Event::create(eventName, false, true));
     230}
     231
     232void NotificationPresenterClientQt::removeReplacedNotificationFromQueue(Notification* notification)
     233{
     234    Notification* oldNotification = 0;
     235    NotificationsQueue::Iterator end = m_notifications.end();
     236    NotificationsQueue::Iterator iter = m_notifications.begin();
     237
     238    while (iter != end) {
     239        Notification* existingNotification = iter.key();
     240        if (existingNotification->replaceId() == notification->replaceId() && existingNotification->url().protocol() == notification->url().protocol() && existingNotification->url().host() == notification->url().host()) {
     241            oldNotification = iter.key();
     242            break;
     243        }
     244        iter++;
     245    }
     246
     247    if (oldNotification) {
     248        if (dumpNotification)
     249            dumpReplacedIdText(oldNotification);
     250        sendEvent(oldNotification, eventNames().closeEvent);
     251        delete m_notifications.take(oldNotification);
     252        oldNotification->unsetPendingActivity(oldNotification);
     253    }
     254}
     255
     256void NotificationPresenterClientQt::dumpReplacedIdText(Notification* notification)
     257{
     258    if (notification)
     259        printf("REPLACING NOTIFICATION %s\n", notification->isHTML() ? QString(notification->url().string()).toUtf8().constData() : QString(notification->contents().title()).toUtf8().constData());
     260}
     261
     262void NotificationPresenterClientQt::dumpShowText(Notification* notification)
     263{
     264    if (notification->isHTML())
     265        printf("DESKTOP NOTIFICATION: contents at %s\n", QString(notification->url().string()).toUtf8().constData());
     266    else {
     267        printf("DESKTOP NOTIFICATION:%s icon %s, title %s, text %s\n",
     268                notification->dir() == "rtl" ? "(RTL)" : "",
     269            QString(notification->contents().icon().string()).toUtf8().constData(), QString(notification->contents().title()).toUtf8().constData(),
     270            QString(notification->contents().body()).toUtf8().constData());
     271    }
     272}
     273
     274}
    202275#endif // ENABLE(NOTIFICATIONS)
  • trunk/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h

    r60348 r60566  
    3535#include "Notification.h"
    3636#include "NotificationPresenter.h"
     37#include "Timer.h"
    3738
    3839#include <QMultiHash>
    3940#include <QSystemTrayIcon>
    4041
    41 
    4242#if ENABLE(NOTIFICATIONS)
    43 class QWebPage;
    4443
    4544namespace WebCore {
     45
    4646class Document;
    4747class KURL;
    4848
    49 struct NotificationIconWrapper {
     49class NotificationIconWrapper {
     50public:
    5051    NotificationIconWrapper();
    5152    ~NotificationIconWrapper();
     53    void close();
     54    void close(Timer<NotificationIconWrapper>*);
    5255#ifndef QT_NO_SYSTEMTRAYICON
    53     QSystemTrayIcon* m_notificationIcon;
     56    OwnPtr<QSystemTrayIcon> m_notificationIcon;
    5457#endif
     58    Timer<NotificationIconWrapper> m_closeTimer;
    5559};
     60
     61typedef QHash <Notification*, NotificationIconWrapper*> NotificationsQueue;
    5662
    5763class NotificationPresenterClientQt : public NotificationPresenter {
    5864public:
    59     NotificationPresenterClientQt(QWebPage*);
     65    NotificationPresenterClientQt();
    6066    ~NotificationPresenterClientQt() {}
    6167
     
    6773    virtual NotificationPresenter::Permission checkPermission(const KURL&);
    6874
     75    void cancel(NotificationIconWrapper*);
     76
    6977    void allowNotificationForOrigin(const QString& origin);
    70     void clearNotificationsList();
    7178
    7279    static bool dumpNotification;
     
    7481    void setReceiver(QObject* receiver) { m_receiver = receiver; }
    7582
     83    void addClient() { m_clientCount++; }
     84    void removeClient();
     85    static NotificationPresenterClientQt* notificationPresenter();
     86
    7687private:
    7788    void sendEvent(Notification*, const AtomicString& eventName);
    78     QWebPage* m_page;
    79     QMultiHash<QString,  QList<RefPtr<VoidCallback> > > m_pendingPermissionRequests;
    80     QHash <Notification*, NotificationIconWrapper*> m_notifications;
     89    void displayNotification(Notification*, const QByteArray&);
     90    void removeReplacedNotificationFromQueue(Notification*);
     91    void dumpReplacedIdText(Notification*);
     92    void dumpShowText(Notification*);
     93
     94    int m_clientCount;
     95    QHash<QString,  QList<RefPtr<VoidCallback> > > m_pendingPermissionRequests;
     96    NotificationsQueue m_notifications;
    8197    QObject* m_receiver;
    8298};
     99
    83100}
    84101
    85102#endif
    86103#endif
    87 
  • trunk/WebKitTools/ChangeLog

    r60560 r60566  
     12010-06-01  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Fix the lifecycle of notification objects
     6        https://bugs.webkit.org/show_bug.cgi?id=40003
     7
     8        Remove the dependency of notifications on QWebPage.
     9
     10        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     11        (WebCore::requestPermissionCallback):
     12        (WebCore::WebPage::WebPage):
     13        (WebCore::DumpRenderTree::requestPermission):
     14        * DumpRenderTree/qt/DumpRenderTreeQt.h:
     15
    1162010-06-02  Sheriff Bot  <webkit.review.bot@gmail.com>
    217
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r60525 r60566  
    136136}
    137137
    138 void requestPermissionCallback(QObject* receiver, QWebPage* page, const QString& origin)
    139 {
    140     qobject_cast<DumpRenderTree*>(receiver)->requestPermission(page, origin);
     138void requestPermissionCallback(QObject* receiver, const QString& origin)
     139{
     140    qobject_cast<DumpRenderTree*>(receiver)->requestPermission(origin);
    141141}
    142142
     
    168168    setPluginFactory(new TestPlugin(this));
    169169
    170     DumpRenderTreeSupportQt::setNotificationsReceiver(this, m_drt);
     170    DumpRenderTreeSupportQt::setNotificationsReceiver(m_drt);
    171171    DumpRenderTreeSupportQt::setCheckPermissionFunction(checkPermissionCallback);
    172172    DumpRenderTreeSupportQt::setRequestPermissionFunction(requestPermissionCallback);
     
    920920}
    921921
    922 void DumpRenderTree::requestPermission(QWebPage* page, const QString& origin)
    923 {
    924     DumpRenderTreeSupportQt::allowNotificationForOrigin(page, origin);
     922void DumpRenderTree::requestPermission(const QString& origin)
     923{
     924    DumpRenderTreeSupportQt::allowNotificationForOrigin(origin);
    925925}
    926926
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h

    r60348 r60566  
    116116    void windowCloseRequested();
    117117    void checkPermission(const QUrl&, NotificationPermission&);
    118     void requestPermission(QWebPage* page, const QString&);
     118    void requestPermission(const QString&);
    119119
    120120Q_SIGNALS:
Note: See TracChangeset for help on using the changeset viewer.