Skip to content
  • yael.aharon@nokia.com's avatar
    [Qt] Fix the lifecycle of notification objects · bdc54d7f
    yael.aharon@nokia.com authored
    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:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    bdc54d7f