Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (111140 => 111141)
--- trunk/Source/WebCore/CMakeLists.txt 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/CMakeLists.txt 2012-03-18 23:50:01 UTC (rev 111141)
@@ -1623,14 +1623,12 @@
IF (ENABLE_NOTIFICATIONS)
LIST(APPEND WebCore_SOURCES
- notifications/DOMWindowNotifications.cpp
notifications/NotificationCenter.cpp
notifications/NotificationController.cpp
notifications/Notification.cpp
)
LIST(APPEND WebCore_IDL_FILES
- notifications/DOMWindowNotifications.idl
notifications/Notification.idl
notifications/NotificationCenter.idl
)
Modified: trunk/Source/WebCore/ChangeLog (111140 => 111141)
--- trunk/Source/WebCore/ChangeLog 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/ChangeLog 2012-03-18 23:50:01 UTC (rev 111141)
@@ -1,5 +1,36 @@
2012-03-18 Kentaro Hara <[email protected]>
+ Unreviewed, rolling out r110994 due to Chromium crash
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * notifications/DOMWindowNotifications.cpp: Removed.
+ * notifications/DOMWindowNotifications.h: Removed.
+ * notifications/DOMWindowNotifications.idl: Removed.
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::~DOMWindow):
+ (WebCore::DOMWindow::willDetachPage):
+ (WebCore::DOMWindow::disconnectDOMWindowProperties):
+ (WebCore::DOMWindow::clearDOMWindowProperties):
+ (WebCore):
+ (WebCore::DOMWindow::webkitNotifications):
+ (WebCore::DOMWindow::resetNotifications):
+ * page/DOMWindow.h:
+ (WebCore):
+ (DOMWindow):
+ * page/DOMWindow.idl:
+ * page/Frame.cpp:
+ (WebCore::Frame::willDetachPage):
+ (WebCore::Frame::transferChildFrameToNewDocument):
+
+2012-03-18 Kentaro Hara <[email protected]>
+
Unreviewed, rolling out r111086.
http://trac.webkit.org/changeset/111086
https://bugs.webkit.org/show_bug.cgi?id=81374
Modified: trunk/Source/WebCore/DerivedSources.make (111140 => 111141)
--- trunk/Source/WebCore/DerivedSources.make 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/DerivedSources.make 2012-03-18 23:50:01 UTC (rev 111141)
@@ -356,7 +356,6 @@
$(WebCore)/inspector/ScriptProfile.idl \
$(WebCore)/inspector/ScriptProfileNode.idl \
$(WebCore)/loader/appcache/DOMApplicationCache.idl \
- $(WebCore)/notifications/DOMWindowNotifications.idl \
$(WebCore)/notifications/Notification.idl \
$(WebCore)/notifications/NotificationCenter.idl \
$(WebCore)/page/AbstractView.idl \
Modified: trunk/Source/WebCore/DerivedSources.pri (111140 => 111141)
--- trunk/Source/WebCore/DerivedSources.pri 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/DerivedSources.pri 2012-03-18 23:50:01 UTC (rev 111141)
@@ -375,7 +375,6 @@
$$PWD/inspector/ScriptProfile.idl \
$$PWD/inspector/ScriptProfileNode.idl \
$$PWD/loader/appcache/DOMApplicationCache.idl \
- $$PWD/notifications/DOMWindowNotifications.idl \
$$PWD/notifications/Notification.idl \
$$PWD/notifications/NotificationCenter.idl \
$$PWD/page/BarInfo.idl \
Modified: trunk/Source/WebCore/GNUmakefile.list.am (111140 => 111141)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-03-18 23:50:01 UTC (rev 111141)
@@ -2829,8 +2829,6 @@
Source/WebCore/mathml/MathMLMathElement.h \
Source/WebCore/mathml/MathMLTextElement.cpp \
Source/WebCore/mathml/MathMLTextElement.h \
- Source/WebCore/notifications/DOMWindowNotifications.cpp \
- Source/WebCore/notifications/DOMWindowNotifications.h \
Source/WebCore/notifications/NotificationCenter.cpp \
Source/WebCore/notifications/NotificationCenter.h \
Source/WebCore/notifications/NotificationClient.h \
Modified: trunk/Source/WebCore/Target.pri (111140 => 111141)
--- trunk/Source/WebCore/Target.pri 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/Target.pri 2012-03-18 23:50:01 UTC (rev 111141)
@@ -979,7 +979,6 @@
loader/SubresourceLoader.cpp \
loader/TextResourceDecoder.cpp \
loader/ThreadableLoader.cpp \
- notifications/DOMWindowNotifications.cpp \
notifications/Notification.cpp \
notifications/NotificationCenter.cpp \
notifications/NotificationController.cpp \
@@ -2076,7 +2075,6 @@
mathml/MathMLInlineContainerElement.h \
mathml/MathMLMathElement.h \
mathml/MathMLTextElement.h \
- notifications/DOMWindowNotifications.h \
notifications/Notification.h \
notifications/NotificationCenter.h \
notifications/NotificationClient.h \
Modified: trunk/Source/WebCore/WebCore.gypi (111140 => 111141)
--- trunk/Source/WebCore/WebCore.gypi 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/WebCore.gypi 2012-03-18 23:50:01 UTC (rev 111141)
@@ -1067,7 +1067,6 @@
'inspector/ScriptProfile.idl',
'inspector/ScriptProfileNode.idl',
'loader/appcache/DOMApplicationCache.idl',
- 'notifications/DOMWindowNotifications.idl',
'notifications/Notification.idl',
'notifications/NotificationCenter.idl',
'page/AbstractView.idl',
@@ -2805,8 +2804,6 @@
'mathml/MathMLMathElement.h',
'mathml/MathMLTextElement.cpp',
'mathml/MathMLTextElement.h',
- 'notifications/DOMWindowNotifications.cpp',
- 'notifications/DOMWindowNotifications.h',
'notifications/Notification.cpp',
'notifications/Notification.h',
'notifications/NotificationCenter.cpp',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (111140 => 111141)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-03-18 23:50:01 UTC (rev 111141)
@@ -53854,14 +53854,6 @@
Name="notifications"
>
<File
- RelativePath="..\notifications\DOMWindowNotifications.cpp"
- >
- </File>
- <File
- RelativePath="..\notifications\DOMWindowNotifications.h"
- >
- </File>
- <File
RelativePath="..\notifications\Notification.cpp"
>
</File>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (111140 => 111141)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-03-18 23:50:01 UTC (rev 111141)
@@ -4113,8 +4113,6 @@
A8748BE012CBF2DC001FBA41 /* HashTools.h in Headers */ = {isa = PBXBuildFile; fileRef = A8748BDF12CBF2DC001FBA41 /* HashTools.h */; };
A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; };
A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A886CF761512301700D279F4 /* DOMWindowNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */; };
- A886CF771512301700D279F4 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = A886CF741512301700D279F4 /* DOMWindowNotifications.h */; };
A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */ = {isa = PBXBuildFile; fileRef = A88DD4860B4629A300C02990 /* PathTraversalState.h */; };
A88DD4890B4629B000C02990 /* PathTraversalState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A88DD4880B4629B000C02990 /* PathTraversalState.cpp */; };
@@ -10913,7 +10911,6 @@
A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMouseEvent.cpp; sourceTree = "<group>"; };
A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSKeyboardEvent.h; sourceTree = "<group>"; };
A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyboardEvent.cpp; sourceTree = "<group>"; };
- A86E87711512DCEA00AD14C1 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DOMWindowNotifications.idl; path = notifications/DOMWindowNotifications.idl; sourceTree = "<group>"; };
A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLPlugInElement.h; sourceTree = "<group>"; };
A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPlugInElement.cpp; sourceTree = "<group>"; };
A871D44E0A127CBC00B12A68 /* HTMLParamElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLParamElement.h; sourceTree = "<group>"; };
@@ -10975,8 +10972,6 @@
A8748BDF12CBF2DC001FBA41 /* HashTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTools.h; sourceTree = "<group>"; };
A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; };
A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; };
- A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMWindowNotifications.cpp; path = notifications/DOMWindowNotifications.cpp; sourceTree = "<group>"; };
- A886CF741512301700D279F4 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMWindowNotifications.h; path = notifications/DOMWindowNotifications.h; sourceTree = "<group>"; };
A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; };
A88DD4880B4629B000C02990 /* PathTraversalState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathTraversalState.cpp; sourceTree = "<group>"; };
A89943260B42338700D7C802 /* BitmapImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapImage.h; sourceTree = "<group>"; };
@@ -14402,9 +14397,6 @@
333F703D0FB49C16008E12A6 /* notifications */ = {
isa = PBXGroup;
children = (
- A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */,
- A886CF741512301700D279F4 /* DOMWindowNotifications.h */,
- A86E87711512DCEA00AD14C1 /* DOMWindowNotifications.idl */,
33503CC61017A1B1003B47E1 /* Notification.cpp */,
333F704F0FB49CA2008E12A6 /* Notification.h */,
333F704E0FB49CA2008E12A6 /* Notification.idl */,
Deleted: trunk/Source/WebCore/notifications/DOMWindowNotifications.cpp (111140 => 111141)
--- trunk/Source/WebCore/notifications/DOMWindowNotifications.cpp 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/notifications/DOMWindowNotifications.cpp 2012-03-18 23:50:01 UTC (rev 111141)
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * 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
- * 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
- * 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
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DOMWindowNotifications.h"
-
-#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-
-#include "DOMWindow.h"
-#include "Document.h"
-#include "NotificationCenter.h"
-#include "NotificationController.h"
-#include "Page.h"
-
-namespace WebCore {
-
-DOMWindowNotifications::DOMWindowNotifications(DOMWindow* window)
- : DOMWindowProperty(window->frame())
- , m_window(window)
-{
-}
-
-DOMWindowNotifications::~DOMWindowNotifications()
-{
-}
-
-DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window)
-{
- DEFINE_STATIC_LOCAL(AtomicString, supplementName, ("DOMWindowNotifications"));
- DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName));
- if (!supplement) {
- supplement = new DOMWindowNotifications(window);
- Supplement<DOMWindow>::provideTo(window, supplementName, adoptPtr(supplement));
- }
- return supplement;
-}
-
-NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow* window)
-{
- return DOMWindowNotifications::from(window)->ensureWebkitNotifications();
-}
-
-NotificationCenter* DOMWindowNotifications::ensureWebkitNotifications()
-{
- if (!m_window->isCurrentlyDisplayedInFrame())
- return 0;
-
- if (m_notificationCenter)
- return m_notificationCenter.get();
-
- Document* document = m_window->document();
- if (!document)
- return 0;
-
- Page* page = document->page();
- if (!page)
- return 0;
-
- NotificationClient* provider = NotificationController::clientFrom(page);
- if (provider)
- m_notificationCenter = NotificationCenter::create(m_window->scriptExecutionContext(), provider);
- return m_notificationCenter.get();
-}
-
-void DOMWindowNotifications::disconnectFrame()
-{
- if (m_notificationCenter) {
- m_notificationCenter->disconnectFrame();
- m_notificationCenter = 0;
- }
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(NOTIFICATIONS)
Deleted: trunk/Source/WebCore/notifications/DOMWindowNotifications.h (111140 => 111141)
--- trunk/Source/WebCore/notifications/DOMWindowNotifications.h 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/notifications/DOMWindowNotifications.h 2012-03-18 23:50:01 UTC (rev 111141)
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * 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
- * 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
- * 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
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DOMWindowNotifications_h
-#define DOMWindowNotifications_h
-
-#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-
-#include "DOMWindowProperty.h"
-#include "PlatformString.h"
-#include "Supplementable.h"
-
-namespace WebCore {
-
-class DOMWindow;
-class NotificationCenter;
-class ScriptExecutionContext;
-
-class DOMWindowNotifications : public Supplement<DOMWindow>, public DOMWindowProperty {
-public:
- virtual ~DOMWindowNotifications();
-
- static NotificationCenter* webkitNotifications(DOMWindow*);
- static DOMWindowNotifications* from(DOMWindow*);
-
-private:
- explicit DOMWindowNotifications(DOMWindow*);
-
- NotificationCenter* ensureWebkitNotifications();
- void disconnectFrame() OVERRIDE;
-
- RefPtr<NotificationCenter> m_notificationCenter;
- DOMWindow* m_window;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(NOTIFICATIONS)
-
-#endif // DOMWindowNotifications_h
Deleted: trunk/Source/WebCore/notifications/DOMWindowNotifications.idl (111140 => 111141)
--- trunk/Source/WebCore/notifications/DOMWindowNotifications.idl 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/notifications/DOMWindowNotifications.idl 2012-03-18 23:50:01 UTC (rev 111141)
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * 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
- * 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
- * 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
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-module window {
-
- interface [
- Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
- Supplemental=DOMWindow
- ] DOMWindowNotifications {
- readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
- };
-
-}
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (111140 => 111141)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2012-03-18 23:50:01 UTC (rev 111141)
@@ -72,6 +72,8 @@
#include "MediaQueryMatcher.h"
#include "MessageEvent.h"
#include "Navigator.h"
+#include "NotificationCenter.h"
+#include "NotificationController.h"
#include "Page.h"
#include "PageGroup.h"
#include "PageTransitionEvent.h"
@@ -416,6 +418,9 @@
ASSERT(!m_sessionStorage);
ASSERT(!m_localStorage);
ASSERT(!m_applicationCache);
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ ASSERT(!m_notifications);
+#endif
#if ENABLE(BLOB)
ASSERT(!m_domURL);
#endif
@@ -473,6 +478,12 @@
{
InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ // Clearing Notifications requests involves accessing the client so it must be done
+ // before the frame is detached.
+ resetNotifications();
+#endif
+
HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
(*it)->willDetachPage();
@@ -516,6 +527,15 @@
HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
(*it)->disconnectFrame();
+
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ // FIXME: Notifications shouldn't have different disconnection logic than
+ // the rest of the DOMWindowProperties.
+ // There is currently no way to reconnect them in resumeFromPageCache() so
+ // they will be broken after returning to a cached page.
+ // This should be fixed as part of https://bugs.webkit.org/show_bug.cgi?id=79636
+ resetNotifications();
+#endif
}
void DOMWindow::reconnectDOMWindowProperties()
@@ -551,6 +571,11 @@
m_sessionStorage = 0;
m_localStorage = 0;
m_applicationCache = 0;
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ // FIXME: Notifications shouldn't have different disconnection logic than
+ // the rest of the DOMWindowProperties.
+ resetNotifications();
+#endif
#if ENABLE(BLOB)
m_domURL = 0;
#endif
@@ -759,6 +784,38 @@
return m_localStorage.get();
}
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+NotificationCenter* DOMWindow::webkitNotifications() const
+{
+ if (!isCurrentlyDisplayedInFrame())
+ return 0;
+ if (m_notifications)
+ return m_notifications.get();
+
+ Document* document = this->document();
+ if (!document)
+ return 0;
+
+ Page* page = document->page();
+ if (!page)
+ return 0;
+
+ NotificationClient* provider = NotificationController::clientFrom(page);
+ if (provider)
+ m_notifications = NotificationCenter::create(document, provider);
+
+ return m_notifications.get();
+}
+
+void DOMWindow::resetNotifications()
+{
+ if (!m_notifications)
+ return;
+ m_notifications->disconnectFrame();
+ m_notifications = 0;
+}
+#endif
+
void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
{
MessagePortArray ports;
Modified: trunk/Source/WebCore/page/DOMWindow.h (111140 => 111141)
--- trunk/Source/WebCore/page/DOMWindow.h 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/page/DOMWindow.h 2012-03-18 23:50:01 UTC (rev 111141)
@@ -56,6 +56,7 @@
class MediaQueryList;
class Navigator;
class Node;
+ class NotificationCenter;
class Page;
class Performance;
class PostMessageTimer;
@@ -355,6 +356,13 @@
Storage* sessionStorage(ExceptionCode&) const;
Storage* localStorage(ExceptionCode&) const;
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ NotificationCenter* webkitNotifications() const;
+ // Renders webkitNotifications object safely inoperable, disconnects
+ // if from embedder-provided NotificationClient.
+ void resetNotifications();
+#endif
+
#if ENABLE(QUOTA)
StorageInfo* webkitStorageInfo() const;
#endif
@@ -442,6 +450,10 @@
mutable RefPtr<Storage> m_localStorage;
mutable RefPtr<DOMApplicationCache> m_applicationCache;
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ mutable RefPtr<NotificationCenter> m_notifications;
+#endif
+
#if ENABLE(WEB_TIMING)
mutable RefPtr<Performance> m_performance;
#endif
Modified: trunk/Source/WebCore/page/DOMWindow.idl (111140 => 111141)
--- trunk/Source/WebCore/page/DOMWindow.idl 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/page/DOMWindow.idl 2012-03-18 23:50:01 UTC (rev 111141)
@@ -170,6 +170,10 @@
readonly attribute [V8EnabledAtRuntime] Storage localStorage
getter raises(DOMException);
+#if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)
+ readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
+#endif
+
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
// This is the interface orientation in degrees. Some examples are:
// 0 is straight up; -90 is when the device is rotated 90 clockwise;
Modified: trunk/Source/WebCore/page/Frame.cpp (111140 => 111141)
--- trunk/Source/WebCore/page/Frame.cpp 2012-03-18 23:39:57 UTC (rev 111140)
+++ trunk/Source/WebCore/page/Frame.cpp 2012-03-18 23:50:01 UTC (rev 111141)
@@ -687,6 +687,11 @@
if (Frame* parent = tree()->parent())
parent->loader()->checkLoadComplete();
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ if (m_domWindow)
+ m_domWindow->resetNotifications();
+#endif
+
HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
(*it)->willDetachPage();
@@ -731,6 +736,12 @@
m_page->decrementFrameCount();
}
+ if (m_domWindow) {
+#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
+ m_domWindow->resetNotifications();
+#endif
+ }
+
HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
(*it)->willDetachPage();