summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp')
-rw-r--r--Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp b/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
index 21a6b9352..be9d681b3 100644
--- a/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
+++ b/Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
@@ -11,10 +11,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -56,27 +56,28 @@ DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window)
{
DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName()));
if (!supplement) {
- supplement = new DOMWindowNotifications(window);
- Supplement<DOMWindow>::provideTo(window, supplementName(), adoptPtr(supplement));
+ auto newSupplement = std::make_unique<DOMWindowNotifications>(window);
+ supplement = newSupplement.get();
+ provideTo(window, supplementName(), WTFMove(newSupplement));
}
return supplement;
}
-NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow* window)
+NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow& window)
{
- return DOMWindowNotifications::from(window)->webkitNotifications();
+ return DOMWindowNotifications::from(&window)->webkitNotifications();
}
-void DOMWindowNotifications::disconnectFrameForPageCache()
+void DOMWindowNotifications::disconnectFrameForDocumentSuspension()
{
- m_suspendedNotificationCenter = m_notificationCenter.release();
- DOMWindowProperty::disconnectFrameForPageCache();
+ m_suspendedNotificationCenter = WTFMove(m_notificationCenter);
+ DOMWindowProperty::disconnectFrameForDocumentSuspension();
}
-void DOMWindowNotifications::reconnectFrameFromPageCache(Frame* frame)
+void DOMWindowNotifications::reconnectFrameFromDocumentSuspension(Frame* frame)
{
- DOMWindowProperty::reconnectFrameFromPageCache(frame);
- m_notificationCenter = m_suspendedNotificationCenter.release();
+ DOMWindowProperty::reconnectFrameFromDocumentSuspension(frame);
+ m_notificationCenter = WTFMove(m_suspendedNotificationCenter);
}
void DOMWindowNotifications::willDestroyGlobalObjectInCachedFrame()
@@ -100,23 +101,24 @@ void DOMWindowNotifications::willDetachGlobalObjectFromFrame()
NotificationCenter* DOMWindowNotifications::webkitNotifications()
{
if (!m_window->isCurrentlyDisplayedInFrame())
- return 0;
+ return nullptr;
if (m_notificationCenter)
return m_notificationCenter.get();
- Document* document = m_window->document();
+ auto* document = m_window->document();
if (!document)
- return 0;
+ return nullptr;
- Page* page = document->page();
+ auto* page = document->page();
if (!page)
- return 0;
+ return nullptr;
- NotificationClient* provider = NotificationController::clientFrom(page);
- if (provider)
- m_notificationCenter = NotificationCenter::create(document, provider);
+ auto* provider = NotificationController::clientFrom(*page);
+ if (!provider)
+ return nullptr;
+ m_notificationCenter = NotificationCenter::create(*document, provider);
return m_notificationCenter.get();
}