| Differences between
and this patch
- a/Source/WebCore/ChangeLog +47 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-03-11  Kentaro Hara  <haraken@chromium.org>
2
3
        Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl
4
        https://bugs.webkit.org/show_bug.cgi?id=79636
5
6
        Reviewed by Adam Barth.
7
8
        For WebKit modularization, this patch moves Notifications-related APIs
9
        from DOMWindow.idl to DOMWindowNotifications.idl.
10
11
        Tests: fast/notifications/* (No change in test results)
12
13
        * CMakeLists.txt: Added DOMWindowNotifications.{h,cpp,idl}.
14
        * DerivedSources.make: Ditto.
15
        * DerivedSources.pri: Ditto.
16
        * GNUmakefile.list.am: Ditto.
17
        * Target.pri: Ditto.
18
        * WebCore.gypi: Ditto.
19
        * WebCore.vcproj/WebCore.vcproj: Ditto.
20
21
        * WebCore.exp.in: Added mangled signatures of webkitNotifications().
22
23
        * notifications/DOMWindowNotifications.cpp: Added.
24
        (WebCore):
25
        (WebCore::DOMWindowNotifications::DOMWindowNotifications):
26
        (WebCore::DOMWindowNotifications::~DOMWindowNotifications):
27
        (WebCore::DOMWindowNotifications::from):
28
        (WebCore::DOMWindowNotifications::webkitNotifications):
29
        (WebCore::DOMWindowNotifications::ensureWebkitNotifications):
30
        (WebCore::DOMWindowNotifications::disconnectFrame):
31
        * notifications/DOMWindowNotifications.h: Added.
32
        (WebCore):
33
        (DOMWindowNotifications):
34
        * notifications/DOMWindowNotifications.idl: Added.
35
36
        * page/DOMWindow.cpp: Removed ENABLE(NOTIFICATIONS).
37
        (WebCore::DOMWindow::~DOMWindow):
38
        (WebCore::DOMWindow::willDetachPage):
39
        (WebCore::DOMWindow::clear):
40
        * page/DOMWindow.h: Ditto.
41
        (WebCore):
42
        (DOMWindow):
43
        * page/DOMWindow.idl: Ditto.
44
        * page/Frame.cpp: Ditto.
45
        (WebCore::Frame::willDetachPage):
46
        (WebCore::Frame::transferChildFrameToNewDocument):
47
1
2012-03-15  Brent Fulgham  <bfulgham@webkit.org>
48
2012-03-15  Brent Fulgham  <bfulgham@webkit.org>
2
49
3
        [WinCairo] Correct <wtf/*.h> include paths.
50
        [WinCairo] Correct <wtf/*.h> include paths.
- a/Source/WebCore/CMakeLists.txt +2 lines
Lines 1622-1633 ENDIF () a/Source/WebCore/CMakeLists.txt_sec1
1622
1622
1623
IF (ENABLE_NOTIFICATIONS)
1623
IF (ENABLE_NOTIFICATIONS)
1624
    LIST(APPEND WebCore_SOURCES
1624
    LIST(APPEND WebCore_SOURCES
1625
        notifications/DOMWindowNotifications.cpp
1625
        notifications/NotificationCenter.cpp
1626
        notifications/NotificationCenter.cpp
1626
        notifications/NotificationController.cpp
1627
        notifications/NotificationController.cpp
1627
        notifications/Notification.cpp
1628
        notifications/Notification.cpp
1628
    )
1629
    )
1629
1630
1630
    LIST(APPEND WebCore_IDL_FILES
1631
    LIST(APPEND WebCore_IDL_FILES
1632
        notifications/DOMWindowNotifications.idl
1631
        notifications/Notification.idl
1633
        notifications/Notification.idl
1632
        notifications/NotificationCenter.idl
1634
        notifications/NotificationCenter.idl
1633
    )
1635
    )
- a/Source/WebCore/DerivedSources.make +1 lines
Lines 356-361 BINDING_IDLS = \ a/Source/WebCore/DerivedSources.make_sec1
356
    $(WebCore)/inspector/ScriptProfile.idl \
356
    $(WebCore)/inspector/ScriptProfile.idl \
357
    $(WebCore)/inspector/ScriptProfileNode.idl \
357
    $(WebCore)/inspector/ScriptProfileNode.idl \
358
    $(WebCore)/loader/appcache/DOMApplicationCache.idl \
358
    $(WebCore)/loader/appcache/DOMApplicationCache.idl \
359
    $(WebCore)/notifications/DOMWindowNotifications.idl \
359
    $(WebCore)/notifications/Notification.idl \
360
    $(WebCore)/notifications/Notification.idl \
360
    $(WebCore)/notifications/NotificationCenter.idl \
361
    $(WebCore)/notifications/NotificationCenter.idl \
361
    $(WebCore)/page/AbstractView.idl \
362
    $(WebCore)/page/AbstractView.idl \
- a/Source/WebCore/DerivedSources.pri +1 lines
Lines 375-380 IDL_BINDINGS += \ a/Source/WebCore/DerivedSources.pri_sec1
375
    $$PWD/inspector/ScriptProfile.idl \
375
    $$PWD/inspector/ScriptProfile.idl \
376
    $$PWD/inspector/ScriptProfileNode.idl \
376
    $$PWD/inspector/ScriptProfileNode.idl \
377
    $$PWD/loader/appcache/DOMApplicationCache.idl \
377
    $$PWD/loader/appcache/DOMApplicationCache.idl \
378
    $$PWD/notifications/DOMWindowNotifications.idl \
378
    $$PWD/notifications/Notification.idl \
379
    $$PWD/notifications/Notification.idl \
379
    $$PWD/notifications/NotificationCenter.idl \
380
    $$PWD/notifications/NotificationCenter.idl \
380
    $$PWD/page/BarInfo.idl \
381
    $$PWD/page/BarInfo.idl \
- a/Source/WebCore/GNUmakefile.list.am +2 lines
Lines 2823-2828 webcore_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec1
2823
	Source/WebCore/mathml/MathMLMathElement.h \
2823
	Source/WebCore/mathml/MathMLMathElement.h \
2824
	Source/WebCore/mathml/MathMLTextElement.cpp \
2824
	Source/WebCore/mathml/MathMLTextElement.cpp \
2825
	Source/WebCore/mathml/MathMLTextElement.h \
2825
	Source/WebCore/mathml/MathMLTextElement.h \
2826
	Source/WebCore/notifications/DOMWindowNotifications.cpp \
2827
	Source/WebCore/notifications/DOMWindowNotifications.h \
2826
	Source/WebCore/notifications/NotificationCenter.cpp \
2828
	Source/WebCore/notifications/NotificationCenter.cpp \
2827
	Source/WebCore/notifications/NotificationCenter.h \
2829
	Source/WebCore/notifications/NotificationCenter.h \
2828
	Source/WebCore/notifications/NotificationClient.h \
2830
	Source/WebCore/notifications/NotificationClient.h \
- a/Source/WebCore/Target.pri +2 lines
Lines 979-984 SOURCES += \ a/Source/WebCore/Target.pri_sec1
979
    loader/SubresourceLoader.cpp \
979
    loader/SubresourceLoader.cpp \
980
    loader/TextResourceDecoder.cpp \
980
    loader/TextResourceDecoder.cpp \
981
    loader/ThreadableLoader.cpp \
981
    loader/ThreadableLoader.cpp \
982
    notifications/DOMWindowNotifications.cpp \
982
    notifications/Notification.cpp \
983
    notifications/Notification.cpp \
983
    notifications/NotificationCenter.cpp \
984
    notifications/NotificationCenter.cpp \
984
    notifications/NotificationController.cpp \
985
    notifications/NotificationController.cpp \
Lines 2073-2078 HEADERS += \ a/Source/WebCore/Target.pri_sec2
2073
    mathml/MathMLInlineContainerElement.h \
2074
    mathml/MathMLInlineContainerElement.h \
2074
    mathml/MathMLMathElement.h \
2075
    mathml/MathMLMathElement.h \
2075
    mathml/MathMLTextElement.h \
2076
    mathml/MathMLTextElement.h \
2077
    notifications/DOMWindowNotifications.h \
2076
    notifications/Notification.h \
2078
    notifications/Notification.h \
2077
    notifications/NotificationCenter.h \
2079
    notifications/NotificationCenter.h \
2078
    notifications/NotificationClient.h \
2080
    notifications/NotificationClient.h \
- a/Source/WebCore/WebCore.gypi +3 lines
Lines 1054-1059 a/Source/WebCore/WebCore.gypi_sec1
1054
            'inspector/ScriptProfile.idl',
1054
            'inspector/ScriptProfile.idl',
1055
            'inspector/ScriptProfileNode.idl',
1055
            'inspector/ScriptProfileNode.idl',
1056
            'loader/appcache/DOMApplicationCache.idl',
1056
            'loader/appcache/DOMApplicationCache.idl',
1057
            'notifications/DOMWindowNotifications.idl',
1057
            'notifications/Notification.idl',
1058
            'notifications/Notification.idl',
1058
            'notifications/NotificationCenter.idl',
1059
            'notifications/NotificationCenter.idl',
1059
            'page/AbstractView.idl',
1060
            'page/AbstractView.idl',
Lines 2784-2789 a/Source/WebCore/WebCore.gypi_sec2
2784
            'mathml/MathMLMathElement.h',
2785
            'mathml/MathMLMathElement.h',
2785
            'mathml/MathMLTextElement.cpp',
2786
            'mathml/MathMLTextElement.cpp',
2786
            'mathml/MathMLTextElement.h',
2787
            'mathml/MathMLTextElement.h',
2788
            'notifications/DOMWindowNotifications.cpp',
2789
            'notifications/DOMWindowNotifications.h',
2787
            'notifications/Notification.cpp',
2790
            'notifications/Notification.cpp',
2788
            'notifications/Notification.h',
2791
            'notifications/Notification.h',
2789
            'notifications/NotificationCenter.cpp',
2792
            'notifications/NotificationCenter.cpp',
- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj +8 lines
Lines 53598-53603 a/Source/WebCore/WebCore.vcproj/WebCore.vcproj_sec1
53598
			Name="notifications"
53598
			Name="notifications"
53599
			>
53599
			>
53600
			<File
53600
			<File
53601
				RelativePath="..\notifications\DOMWindowNotifications.cpp"
53602
				>
53603
			</File>
53604
			<File
53605
				RelativePath="..\notifications\DOMWindowNotifications.h"
53606
				>
53607
			</File>
53608
			<File
53601
				RelativePath="..\notifications\Notification.cpp"
53609
				RelativePath="..\notifications\Notification.cpp"
53602
				>
53610
				>
53603
			</File>
53611
			</File>
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +12 lines
Lines 4113-4118 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
4113
		A8748BE012CBF2DC001FBA41 /* HashTools.h in Headers */ = {isa = PBXBuildFile; fileRef = A8748BDF12CBF2DC001FBA41 /* HashTools.h */; };
4113
		A8748BE012CBF2DC001FBA41 /* HashTools.h in Headers */ = {isa = PBXBuildFile; fileRef = A8748BDF12CBF2DC001FBA41 /* HashTools.h */; };
4114
		A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; };
4114
		A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; };
4115
		A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; };
4115
		A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; };
4116
		A886CF761512301700D279F4 /* DOMWindowNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */; };
4117
		A886CF771512301700D279F4 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = A886CF741512301700D279F4 /* DOMWindowNotifications.h */; };
4118
		A886CF781512301700D279F4 /* DOMWindowNotifications.idl in Resources */ = {isa = PBXBuildFile; fileRef = A886CF751512301700D279F4 /* DOMWindowNotifications.idl */; };
4116
		A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
4119
		A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
4117
		A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */ = {isa = PBXBuildFile; fileRef = A88DD4860B4629A300C02990 /* PathTraversalState.h */; };
4120
		A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */ = {isa = PBXBuildFile; fileRef = A88DD4860B4629A300C02990 /* PathTraversalState.h */; };
4118
		A88DD4890B4629B000C02990 /* PathTraversalState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A88DD4880B4629B000C02990 /* PathTraversalState.cpp */; };
4121
		A88DD4890B4629B000C02990 /* PathTraversalState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A88DD4880B4629B000C02990 /* PathTraversalState.cpp */; };
Lines 10969-10974 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
10969
		A8748BDF12CBF2DC001FBA41 /* HashTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTools.h; sourceTree = "<group>"; };
10972
		A8748BDF12CBF2DC001FBA41 /* HashTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTools.h; sourceTree = "<group>"; };
10970
		A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; };
10973
		A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; };
10971
		A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; };
10974
		A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; };
10975
		A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMWindowNotifications.cpp; path = notifications/DOMWindowNotifications.cpp; sourceTree = "<group>"; };
10976
		A886CF741512301700D279F4 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMWindowNotifications.h; path = notifications/DOMWindowNotifications.h; sourceTree = "<group>"; };
10977
		A886CF751512301700D279F4 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DOMWindowNotifications.idl; path = notifications/DOMWindowNotifications.idl; sourceTree = "<group>"; };
10972
		A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; };
10978
		A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; };
10973
		A88DD4880B4629B000C02990 /* PathTraversalState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathTraversalState.cpp; sourceTree = "<group>"; };
10979
		A88DD4880B4629B000C02990 /* PathTraversalState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathTraversalState.cpp; sourceTree = "<group>"; };
10974
		A89943260B42338700D7C802 /* BitmapImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapImage.h; sourceTree = "<group>"; };
10980
		A89943260B42338700D7C802 /* BitmapImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapImage.h; sourceTree = "<group>"; };
Lines 14391-14396 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
14391
		333F703D0FB49C16008E12A6 /* notifications */ = {
14397
		333F703D0FB49C16008E12A6 /* notifications */ = {
14392
			isa = PBXGroup;
14398
			isa = PBXGroup;
14393
			children = (
14399
			children = (
14400
				A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */,
14401
				A886CF741512301700D279F4 /* DOMWindowNotifications.h */,
14402
				A886CF751512301700D279F4 /* DOMWindowNotifications.idl */,
14394
				33503CC61017A1B1003B47E1 /* Notification.cpp */,
14403
				33503CC61017A1B1003B47E1 /* Notification.cpp */,
14395
				333F704F0FB49CA2008E12A6 /* Notification.h */,
14404
				333F704F0FB49CA2008E12A6 /* Notification.h */,
14396
				333F704E0FB49CA2008E12A6 /* Notification.idl */,
14405
				333F704E0FB49CA2008E12A6 /* Notification.idl */,
Lines 24575-24580 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
24575
				E1CDE9221501916900862CC5 /* AsyncFileStream.h in Headers */,
24584
				E1CDE9221501916900862CC5 /* AsyncFileStream.h in Headers */,
24576
				450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
24585
				450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
24577
				C5B4C24D1509236C00A6EF37 /* WebCoreNSURLExtras.h in Headers */,
24586
				C5B4C24D1509236C00A6EF37 /* WebCoreNSURLExtras.h in Headers */,
24587
				A886CF771512301700D279F4 /* DOMWindowNotifications.h in Headers */,
24578
			);
24588
			);
24579
			runOnlyForDeploymentPostprocessing = 0;
24589
			runOnlyForDeploymentPostprocessing = 0;
24580
		};
24590
		};
Lines 24727-24732 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
24727
				1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */,
24737
				1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */,
24728
				1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
24738
				1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
24729
				2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */,
24739
				2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */,
24740
				A886CF781512301700D279F4 /* DOMWindowNotifications.idl in Resources */,
24730
			);
24741
			);
24731
			runOnlyForDeploymentPostprocessing = 0;
24742
			runOnlyForDeploymentPostprocessing = 0;
24732
		};
24743
		};
Lines 27556-27561 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec6
27556
				C5B4C24E1509236C00A6EF37 /* WebCoreNSURLExtras.mm in Sources */,
27567
				C5B4C24E1509236C00A6EF37 /* WebCoreNSURLExtras.mm in Sources */,
27557
				9B2B7AC11509850A008932CC /* MicroDataItemValue.cpp in Sources */,
27568
				9B2B7AC11509850A008932CC /* MicroDataItemValue.cpp in Sources */,
27558
				7157F062150B6564006EAABD /* SVGAnimatedTransformList.cpp in Sources */,
27569
				7157F062150B6564006EAABD /* SVGAnimatedTransformList.cpp in Sources */,
27570
				A886CF761512301700D279F4 /* DOMWindowNotifications.cpp in Sources */,
27559
			);
27571
			);
27560
			runOnlyForDeploymentPostprocessing = 0;
27572
			runOnlyForDeploymentPostprocessing = 0;
27561
		};
27573
		};
- a/Source/WebCore/notifications/DOMWindowNotifications.cpp +98 lines
Line 0 a/Source/WebCore/notifications/DOMWindowNotifications.cpp_sec1
1
/*
2
 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
27
#include "config.h"
28
#include "DOMWindowNotifications.h"
29
30
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
31
32
#include "DOMWindow.h"
33
#include "Document.h"
34
#include "NotificationCenter.h"
35
#include "NotificationController.h"
36
#include "Page.h"
37
38
namespace WebCore {
39
40
DOMWindowNotifications::DOMWindowNotifications(DOMWindow *window)
41
    : DOMWindowProperty(window->frame())
42
    , m_window(window)
43
{
44
}
45
46
DOMWindowNotifications::~DOMWindowNotifications()
47
{
48
}
49
50
DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window)
51
{
52
    DEFINE_STATIC_LOCAL(AtomicString, supplementName, ("DOMWindowNotifications"));
53
    DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName));
54
    if (!supplement) {
55
        supplement = new DOMWindowNotifications(window);
56
        Supplement<DOMWindow>::provideTo(window, supplementName, adoptPtr(supplement));
57
    }
58
    return supplement;
59
}
60
61
NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow* window)
62
{
63
    return DOMWindowNotifications::from(window)->ensureWebkitNotifications();
64
}
65
66
NotificationCenter* DOMWindowNotifications::ensureWebkitNotifications()
67
{
68
    if (m_notificationCenter)
69
        return m_notificationCenter.get();
70
71
    if (!m_window->isCurrentlyDisplayedInFrame())
72
        return 0;
73
74
    Document* document = m_window->document();
75
    if (!document)
76
        return 0;
77
78
    Page* page = document->page();
79
    if (!page)
80
        return 0;
81
82
    NotificationClient* provider = NotificationController::clientFrom(page);
83
    if (provider)
84
        m_notificationCenter = NotificationCenter::create(m_window->scriptExecutionContext(), provider);
85
    return m_notificationCenter.get();
86
}
87
88
void DOMWindowNotifications::disconnectFrame()
89
{
90
    if (m_notificationCenter) {
91
        m_notificationCenter->disconnectFrame();
92
        m_notificationCenter = 0;
93
    }
94
}
95
96
} // namespace WebCore
97
98
#endif // ENABLE(NOTIFICATIONS)
- a/Source/WebCore/notifications/DOMWindowNotifications.h +63 lines
Line 0 a/Source/WebCore/notifications/DOMWindowNotifications.h_sec1
1
/*
2
 * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
3
 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
27
#ifndef DOMWindowNotifications_h
28
#define DOMWindowNotifications_h
29
30
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
31
32
#include "DOMWindowProperty.h"
33
#include "PlatformString.h"
34
#include "Supplementable.h"
35
36
namespace WebCore {
37
38
class DOMWindow;
39
class NotificationCenter;
40
class ScriptExecutionContext;
41
42
class DOMWindowNotifications : public Supplement<DOMWindow>, public DOMWindowProperty {
43
public:
44
    virtual ~DOMWindowNotifications();
45
46
    static NotificationCenter* webkitNotifications(DOMWindow*);
47
    static DOMWindowNotifications* from(DOMWindow*);
48
49
private:
50
    DOMWindowNotifications(DOMWindow*);
51
52
    NotificationCenter* ensureWebkitNotifications();
53
    void disconnectFrame() OVERRIDE;
54
55
    RefPtr<NotificationCenter> m_notificationCenter;
56
    DOMWindow* m_window;
57
};
58
59
} // namespace WebCore
60
61
#endif // ENABLE(NOTIFICATIONS)
62
63
#endif // DOMWindowNotifications_h
- a/Source/WebCore/notifications/DOMWindowNotifications.idl +36 lines
Line 0 a/Source/WebCore/notifications/DOMWindowNotifications.idl_sec1
1
/*
2
 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3
 * Copyright (C) 2011 Google Inc. All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
27
module window {
28
29
    interface [
30
        Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
31
        Supplemental=DOMWindow
32
    ] DOMWindowNotifications {
33
        readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
34
    };
35
36
}
- a/Source/WebCore/page/DOMWindow.cpp -57 lines
Lines 72-79 a/Source/WebCore/page/DOMWindow.cpp_sec1
72
#include "MediaQueryMatcher.h"
72
#include "MediaQueryMatcher.h"
73
#include "MessageEvent.h"
73
#include "MessageEvent.h"
74
#include "Navigator.h"
74
#include "Navigator.h"
75
#include "NotificationCenter.h"
76
#include "NotificationController.h"
77
#include "Page.h"
75
#include "Page.h"
78
#include "PageGroup.h"
76
#include "PageGroup.h"
79
#include "PageTransitionEvent.h"
77
#include "PageTransitionEvent.h"
Lines 418-426 DOMWindow::~DOMWindow() a/Source/WebCore/page/DOMWindow.cpp_sec2
418
        ASSERT(!m_sessionStorage);
416
        ASSERT(!m_sessionStorage);
419
        ASSERT(!m_localStorage);
417
        ASSERT(!m_localStorage);
420
        ASSERT(!m_applicationCache);
418
        ASSERT(!m_applicationCache);
421
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
422
        ASSERT(!m_notifications);
423
#endif
424
#if ENABLE(BLOB)
419
#if ENABLE(BLOB)
425
        ASSERT(!m_domURL);
420
        ASSERT(!m_domURL);
426
#endif
421
#endif
Lines 478-489 void DOMWindow::willDetachPage() a/Source/WebCore/page/DOMWindow.cpp_sec3
478
{
473
{
479
    InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
474
    InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
480
475
481
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
482
    // Clearing Notifications requests involves accessing the client so it must be done
483
    // before the frame is detached.
484
    resetNotifications();
485
#endif
486
487
    HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
476
    HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
488
    for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
477
    for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
489
        (*it)->willDetachPage();
478
        (*it)->willDetachPage();
Lines 527-541 void DOMWindow::disconnectDOMWindowProperties() a/Source/WebCore/page/DOMWindow.cpp_sec4
527
    HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
516
    HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
528
    for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
517
    for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
529
        (*it)->disconnectFrame();
518
        (*it)->disconnectFrame();
530
531
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
532
    // FIXME: Notifications shouldn't have different disconnection logic than
533
    // the rest of the DOMWindowProperties.
534
    // There is currently no way to reconnect them in resumeFromPageCache() so
535
    // they will be broken after returning to a cached page.
536
    // This should be fixed as part of https://bugs.webkit.org/show_bug.cgi?id=79636
537
    resetNotifications();
538
#endif
539
}
519
}
540
520
541
void DOMWindow::reconnectDOMWindowProperties()
521
void DOMWindow::reconnectDOMWindowProperties()
Lines 571-581 void DOMWindow::clearDOMWindowProperties() a/Source/WebCore/page/DOMWindow.cpp_sec5
571
    m_sessionStorage = 0;
551
    m_sessionStorage = 0;
572
    m_localStorage = 0;
552
    m_localStorage = 0;
573
    m_applicationCache = 0;
553
    m_applicationCache = 0;
574
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
575
    // FIXME: Notifications shouldn't have different disconnection logic than
576
    // the rest of the DOMWindowProperties.
577
    resetNotifications();
578
#endif
579
#if ENABLE(BLOB)
554
#if ENABLE(BLOB)
580
    m_domURL = 0;
555
    m_domURL = 0;
581
#endif
556
#endif
Lines 784-821 Storage* DOMWindow::localStorage(ExceptionCode& ec) const a/Source/WebCore/page/DOMWindow.cpp_sec6
784
    return m_localStorage.get();
759
    return m_localStorage.get();
785
}
760
}
786
761
787
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
788
NotificationCenter* DOMWindow::webkitNotifications() const
789
{
790
    if (!isCurrentlyDisplayedInFrame())
791
        return 0;
792
    if (m_notifications)
793
        return m_notifications.get();
794
795
    Document* document = this->document();
796
    if (!document)
797
        return 0;
798
    
799
    Page* page = document->page();
800
    if (!page)
801
        return 0;
802
803
    NotificationClient* provider = NotificationController::clientFrom(page);
804
    if (provider) 
805
        m_notifications = NotificationCenter::create(document, provider);    
806
      
807
    return m_notifications.get();
808
}
809
810
void DOMWindow::resetNotifications()
811
{
812
    if (!m_notifications)
813
        return;
814
    m_notifications->disconnectFrame();
815
    m_notifications = 0;
816
}
817
#endif
818
819
void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
762
void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
820
{
763
{
821
    MessagePortArray ports;
764
    MessagePortArray ports;
- a/Source/WebCore/page/DOMWindow.h -12 lines
Lines 56-62 namespace WebCore { a/Source/WebCore/page/DOMWindow.h_sec1
56
    class MediaQueryList;
56
    class MediaQueryList;
57
    class Navigator;
57
    class Navigator;
58
    class Node;
58
    class Node;
59
    class NotificationCenter;
60
    class Page;
59
    class Page;
61
    class Performance;
60
    class Performance;
62
    class PostMessageTimer;
61
    class PostMessageTimer;
Lines 356-368 namespace WebCore { a/Source/WebCore/page/DOMWindow.h_sec2
356
        Storage* sessionStorage(ExceptionCode&) const;
355
        Storage* sessionStorage(ExceptionCode&) const;
357
        Storage* localStorage(ExceptionCode&) const;
356
        Storage* localStorage(ExceptionCode&) const;
358
357
359
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
360
        NotificationCenter* webkitNotifications() const;
361
        // Renders webkitNotifications object safely inoperable, disconnects
362
        // if from embedder-provided NotificationClient.
363
        void resetNotifications();
364
#endif
365
366
#if ENABLE(QUOTA)
358
#if ENABLE(QUOTA)
367
        StorageInfo* webkitStorageInfo() const;
359
        StorageInfo* webkitStorageInfo() const;
368
#endif
360
#endif
Lines 450-459 namespace WebCore { a/Source/WebCore/page/DOMWindow.h_sec3
450
        mutable RefPtr<Storage> m_localStorage;
442
        mutable RefPtr<Storage> m_localStorage;
451
        mutable RefPtr<DOMApplicationCache> m_applicationCache;
443
        mutable RefPtr<DOMApplicationCache> m_applicationCache;
452
444
453
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
454
        mutable RefPtr<NotificationCenter> m_notifications;
455
#endif
456
457
#if ENABLE(WEB_TIMING)
445
#if ENABLE(WEB_TIMING)
458
        mutable RefPtr<Performance> m_performance;
446
        mutable RefPtr<Performance> m_performance;
459
#endif
447
#endif
- a/Source/WebCore/page/DOMWindow.idl -4 lines
Lines 170-179 module window { a/Source/WebCore/page/DOMWindow.idl_sec1
170
        readonly attribute [V8EnabledAtRuntime] Storage localStorage
170
        readonly attribute [V8EnabledAtRuntime] Storage localStorage
171
            getter raises(DOMException);
171
            getter raises(DOMException);
172
172
173
#if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)
174
        readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
175
#endif
176
177
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
173
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
178
        // This is the interface orientation in degrees. Some examples are:
174
        // This is the interface orientation in degrees. Some examples are:
179
        //  0 is straight up; -90 is when the device is rotated 90 clockwise;
175
        //  0 is straight up; -90 is when the device is rotated 90 clockwise;
- a/Source/WebCore/page/Frame.cpp -11 lines
Lines 687-697 void Frame::willDetachPage() a/Source/WebCore/page/Frame.cpp_sec1
687
    if (Frame* parent = tree()->parent())
687
    if (Frame* parent = tree()->parent())
688
        parent->loader()->checkLoadComplete();
688
        parent->loader()->checkLoadComplete();
689
689
690
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
691
    if (m_domWindow)
692
        m_domWindow->resetNotifications();
693
#endif
694
695
    HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
690
    HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
696
    for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
691
    for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
697
        (*it)->willDetachPage();
692
        (*it)->willDetachPage();
Lines 736-747 void Frame::transferChildFrameToNewDocument() a/Source/WebCore/page/Frame.cpp_sec2
736
             m_page->decrementFrameCount();
731
             m_page->decrementFrameCount();
737
        }
732
        }
738
733
739
        if (m_domWindow) {
740
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
741
            m_domWindow->resetNotifications();
742
#endif
743
        }
744
745
        HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
734
        HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
746
        for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
735
        for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
747
            (*it)->willDetachPage();
736
            (*it)->willDetachPage();

Return to Bug 79636