| Differences between
and this patch
- JavaScriptCore/ChangeLog +8 lines
Lines 1-3 JavaScriptCore/ChangeLog_sec1
1
2009-05-20  John Gregg  <johnnyg@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Adds ENABLE_NOTIFICATION flag for the build of custom JS code.
6
7
        * Configurations/FeatureDefines.xcconfig:
8
1
2009-05-19  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
9
2009-05-19  Kenneth Rohde Christiansen  <kenneth.christiansen@openbossa.org>
2
10
3
        Reviewed by Simon Hausmann.
11
        Reviewed by Simon Hausmann.
- JavaScriptCore/Configurations/FeatureDefines.xcconfig -1 / +2 lines
Lines 34-39 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE; JavaScriptCore/Configurations/FeatureDefines.xcconfig_sec1
34
ENABLE_GEOLOCATION = ;
34
ENABLE_GEOLOCATION = ;
35
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
35
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
36
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
36
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
37
ENABLE_NOTIFICATIONS = ;
37
ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS;
38
ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS;
38
ENABLE_SVG = ENABLE_SVG;
39
ENABLE_SVG = ENABLE_SVG;
39
ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION;
40
ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION;
Lines 48-51 ENABLE_WORKERS = ENABLE_WORKERS; JavaScriptCore/Configurations/FeatureDefines.xcconfig_sec2
48
ENABLE_XPATH = ENABLE_XPATH;
49
ENABLE_XPATH = ENABLE_XPATH;
49
ENABLE_XSLT = ENABLE_XSLT;
50
ENABLE_XSLT = ENABLE_XSLT;
50
51
51
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DOM_STORAGE) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT);
52
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DOM_STORAGE) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT);
- JavaScriptCore/wtf/Platform.h +4 lines
Lines 461-466 JavaScriptCore/wtf/Platform.h_sec1
461
#define ENABLE_GEOLOCATION 0
461
#define ENABLE_GEOLOCATION 0
462
#endif
462
#endif
463
463
464
#if !defined(ENABLE_NOTIFICATIONS)
465
#define ENABLE_NOTIFICATIONS 0
466
#endif
467
464
#if !defined(ENABLE_TEXT_CARET)
468
#if !defined(ENABLE_TEXT_CARET)
465
#define ENABLE_TEXT_CARET 1
469
#define ENABLE_TEXT_CARET 1
466
#endif
470
#endif
- WebCore/ChangeLog +33 lines
Lines 1-3 WebCore/ChangeLog_sec1
1
2009-05-20  John Gregg  <johnnyg@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        This change adds an (experimental) HTML desktop API, being prototyped in Chromium.  It's protected by compile-time feature flag ENABLE_NOTIFICATIONS.
6
        
7
        Test: fast/notifications/notifications-accessor-disabled.html
8
9
        * Configurations/FeatureDefines.xcconfig:
10
        * DerivedSources.make:
11
        * GNUmakefile.am:
12
        * WebCore.vcproj/WebCore.vcproj:
13
        * bindings/js/JSWorkerContextCustom.cpp:
14
        (WebCore::JSWorkerContext::notifications):
15
        * bindings/v8/custom/V8NotificationsCustom.cpp: Added.
16
        * notifications: Added.
17
        * notifications/Notification.cpp: Added.
18
        * notifications/Notification.h: Added.
19
        * notifications/Notification.idl: Added.
20
        * notifications/NotificationParameters.h: Added.
21
        * notifications/NotificationProvider.h: Added.
22
        * notifications/Notifications.cpp: Added.
23
        * notifications/Notifications.h: Added.
24
        * notifications/Notifications.idl: Added.
25
        * workers/WorkerContext.cpp:
26
        * workers/WorkerContext.h:
27
        (WebCore::WorkerContext::notifications):
28
        * workers/WorkerContext.idl:
29
        * workers/WorkerMessagingProxy.cpp:
30
        (WebCore::WorkerMessagingProxy::getNotificationProvider):
31
        * workers/WorkerMessagingProxy.h:
32
        * workers/WorkerObjectProxy.h:
33
1
2009-05-20  Holger Hans Peter Freyther  <zecke@selfish.org>
34
2009-05-20  Holger Hans Peter Freyther  <zecke@selfish.org>
2
35
3
        Reviewed by Anders Carlsson.
36
        Reviewed by Anders Carlsson.
- WebCore/DerivedSources.make +3 lines
Lines 34-39 VPATH = \ WebCore/DerivedSources.make_sec1
34
    $(WebCore)/html \
34
    $(WebCore)/html \
35
    $(WebCore)/inspector \
35
    $(WebCore)/inspector \
36
    $(WebCore)/loader/appcache \
36
    $(WebCore)/loader/appcache \
37
    $(WebCore)/notifications \
37
    $(WebCore)/page \
38
    $(WebCore)/page \
38
    $(WebCore)/plugins \
39
    $(WebCore)/plugins \
39
    $(WebCore)/storage \
40
    $(WebCore)/storage \
Lines 183-188 DOM_CLASSES = \ WebCore/DerivedSources.make_sec2
183
    NodeIterator \
184
    NodeIterator \
184
    NodeList \
185
    NodeList \
185
    Notation \
186
    Notation \
187
    Notification \
188
    Notifications \
186
    OverflowEvent \
189
    OverflowEvent \
187
    Plugin \
190
    Plugin \
188
    PluginArray \
191
    PluginArray \
- WebCore/GNUmakefile.am -1 / +21 lines
Lines 24-29 webcore_cppflags += \ WebCore/GNUmakefile.am_sec1
24
	-I$(srcdir)/WebCore/loader/appcache \
24
	-I$(srcdir)/WebCore/loader/appcache \
25
	-I$(srcdir)/WebCore/loader/archive \
25
	-I$(srcdir)/WebCore/loader/archive \
26
	-I$(srcdir)/WebCore/loader/icon \
26
	-I$(srcdir)/WebCore/loader/icon \
27
	-I$(srcdir)/WebCore/notifications \
27
	-I$(srcdir)/WebCore/page \
28
	-I$(srcdir)/WebCore/page \
28
	-I$(srcdir)/WebCore/page/animation \
29
	-I$(srcdir)/WebCore/page/animation \
29
	-I$(srcdir)/WebCore/platform \
30
	-I$(srcdir)/WebCore/platform \
Lines 217-222 IDL_BINDINGS += \ WebCore/GNUmakefile.am_sec2
217
	WebCore/html/TextMetrics.idl \
218
	WebCore/html/TextMetrics.idl \
218
	WebCore/inspector/JavaScriptCallFrame.idl \
219
	WebCore/inspector/JavaScriptCallFrame.idl \
219
	WebCore/inspector/InspectorController.idl \
220
	WebCore/inspector/InspectorController.idl \
221
	WebCore/notifications/Notification.idl \
222
	WebCore/notifications/Notifications.idl \
220
	WebCore/page/BarInfo.idl \
223
	WebCore/page/BarInfo.idl \
221
	WebCore/page/Console.idl \
224
	WebCore/page/Console.idl \
222
	WebCore/page/Coordinates.idl \
225
	WebCore/page/Coordinates.idl \
Lines 2346-2351 webcoregtk_sources += \ WebCore/GNUmakefile.am_sec3
2346
	WebCore/platform/gtk/GeolocationServiceGtk.h
2349
	WebCore/platform/gtk/GeolocationServiceGtk.h
2347
endif # END ENABLE_GEOLOCATION
2350
endif # END ENABLE_GEOLOCATION
2348
2351
2352
# ----
2353
# Notifications support
2354
# ----
2355
if ENABLE_NOTIFICATIONS
2356
FEATURE_DEFINES_JAVASCRIPT += ENABLE_NOTIFICATIONS=1
2357
2358
webcore_cppflags += \
2359
	-DENABLE_NOTIFICATIONS=1
2360
2361
webcore_sources += \
2362
	WebCore/notifications/Notification.cpp \
2363
	WebCore/notifications/Notification.h \
2364
	WebCore/notifications/Notifications.cpp \
2365
	WebCore/notifications/Notifications.h \
2366
	WebCore/notifications/NotificationProvider.h \
2367
	WebCore/notifications/NotificationParameters.h
2368
2369
endif # END ENABLE_NOTIFICATIONS
2349
2370
2350
# ----
2371
# ----
2351
# SVG Support
2372
# SVG Support
Lines 3210-3213 CLEANFILES += \ WebCore/GNUmakefile.am_sec4
3210
	WebCore/bindings/js/JSDOMWindowBase.lut.h \
3231
	WebCore/bindings/js/JSDOMWindowBase.lut.h \
3211
	WebCore/bindings/js/JSRGBColor.lut.h \
3232
	WebCore/bindings/js/JSRGBColor.lut.h \
3212
	WebCore/bindings/js/JSWorkerContextBase.lut.h
3233
	WebCore/bindings/js/JSWorkerContextBase.lut.h
3213
- WebCore/Configurations/FeatureDefines.xcconfig -1 / +2 lines
Lines 34-39 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE; WebCore/Configurations/FeatureDefines.xcconfig_sec1
34
ENABLE_GEOLOCATION = ;
34
ENABLE_GEOLOCATION = ;
35
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
35
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
36
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
36
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
37
ENABLE_NOTIFICATIONS = ;
37
ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS;
38
ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS;
38
ENABLE_SVG = ENABLE_SVG;
39
ENABLE_SVG = ENABLE_SVG;
39
ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION;
40
ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION;
Lines 48-51 ENABLE_WORKERS = ENABLE_WORKERS; WebCore/Configurations/FeatureDefines.xcconfig_sec2
48
ENABLE_XPATH = ENABLE_XPATH;
49
ENABLE_XPATH = ENABLE_XPATH;
49
ENABLE_XSLT = ENABLE_XSLT;
50
ENABLE_XSLT = ENABLE_XSLT;
50
51
51
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DOM_STORAGE) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT);
52
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DOM_STORAGE) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT);
- WebCore/WebCore.xcodeproj/project.pbxproj +32 lines
Lines 604-609 WebCore/WebCore.xcodeproj/project.pbxproj_sec1
604
		31C0FF4C0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */; };
604
		31C0FF4C0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */; };
605
		31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */; };
605
		31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */; };
606
		31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */; };
606
		31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */; };
607
		333F70520FB49CA2008E12A6 /* Notifications.idl in Resources */ = {isa = PBXBuildFile; fileRef = 333F704A0FB49CA2008E12A6 /* Notifications.idl */; };
608
		333F70530FB49CA2008E12A6 /* Notifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333F704B0FB49CA2008E12A6 /* Notifications.cpp */; };
609
		333F70540FB49CA2008E12A6 /* Notifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 333F704C0FB49CA2008E12A6 /* Notifications.h */; };
610
		333F70550FB49CA2008E12A6 /* NotificationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 333F704D0FB49CA2008E12A6 /* NotificationParameters.h */; };
611
		333F70560FB49CA2008E12A6 /* Notification.idl in Resources */ = {isa = PBXBuildFile; fileRef = 333F704E0FB49CA2008E12A6 /* Notification.idl */; };
612
		333F70570FB49CA2008E12A6 /* Notification.h in Headers */ = {isa = PBXBuildFile; fileRef = 333F704F0FB49CA2008E12A6 /* Notification.h */; };
613
		333F70580FB49CA2008E12A6 /* Notification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333F70500FB49CA2008E12A6 /* Notification.cpp */; };
614
		333F70590FB49CA2008E12A6 /* NotificationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 333F70510FB49CA2008E12A6 /* NotificationProvider.h */; };
607
		371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; };
615
		371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; };
608
		371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */; };
616
		371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */; };
609
		371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */; };
617
		371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */; };
Lines 5533-5538 WebCore/WebCore.xcodeproj/project.pbxproj_sec2
5533
		31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEvent.h; sourceTree = "<group>"; };
5541
		31C0FF460E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEvent.h; sourceTree = "<group>"; };
5534
		31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitTransitionEvent.mm; sourceTree = "<group>"; };
5542
		31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMWebKitTransitionEvent.mm; sourceTree = "<group>"; };
5535
		31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEventInternal.h; sourceTree = "<group>"; };
5543
		31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEventInternal.h; sourceTree = "<group>"; };
5544
		333F704A0FB49CA2008E12A6 /* Notifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Notifications.idl; path = notifications/Notifications.idl; sourceTree = "<group>"; };
5545
		333F704B0FB49CA2008E12A6 /* Notifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Notifications.cpp; path = notifications/Notifications.cpp; sourceTree = "<group>"; };
5546
		333F704C0FB49CA2008E12A6 /* Notifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Notifications.h; path = notifications/Notifications.h; sourceTree = "<group>"; };
5547
		333F704D0FB49CA2008E12A6 /* NotificationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationParameters.h; path = notifications/NotificationParameters.h; sourceTree = "<group>"; };
5548
		333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Notification.idl; path = notifications/Notification.idl; sourceTree = "<group>"; };
5549
		333F704F0FB49CA2008E12A6 /* Notification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Notification.h; path = notifications/Notification.h; sourceTree = "<group>"; };
5550
		333F70500FB49CA2008E12A6 /* Notification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Notification.cpp; path = notifications/Notification.cpp; sourceTree = "<group>"; };
5551
		333F70510FB49CA2008E12A6 /* NotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationProvider.h; path = notifications/NotificationProvider.h; sourceTree = "<group>"; };
5536
		371F4F3E0D25B9AF00ECE0D5 /* FontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontData.h; sourceTree = "<group>"; };
5552
		371F4F3E0D25B9AF00ECE0D5 /* FontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontData.h; sourceTree = "<group>"; };
5537
		371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontData.cpp; sourceTree = "<group>"; };
5553
		371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontData.cpp; sourceTree = "<group>"; };
5538
		371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SegmentedFontData.h; sourceTree = "<group>"; };
5554
		371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SegmentedFontData.h; sourceTree = "<group>"; };
Lines 9417-9422 WebCore/WebCore.xcodeproj/project.pbxproj_sec3
9417
				93EEC1EC09C2877700C515D1 /* html */,
9433
				93EEC1EC09C2877700C515D1 /* html */,
9418
				1C81B94D0E9732D900266E07 /* inspector */,
9434
				1C81B94D0E9732D900266E07 /* inspector */,
9419
				BCB16BFB0979C38700467741 /* loader */,
9435
				BCB16BFB0979C38700467741 /* loader */,
9436
				333F703D0FB49C16008E12A6 /* notifications */,
9420
				65BF02180974806300C43196 /* page */,
9437
				65BF02180974806300C43196 /* page */,
9421
				BCF1A5BA097832090061A123 /* platform */,
9438
				BCF1A5BA097832090061A123 /* platform */,
9422
				5DCF83690D59157800953BC6 /* plugins */,
9439
				5DCF83690D59157800953BC6 /* plugins */,
Lines 9885-9890 WebCore/WebCore.xcodeproj/project.pbxproj_sec4
9885
			name = animation;
9902
			name = animation;
9886
			sourceTree = "<group>";
9903
			sourceTree = "<group>";
9887
		};
9904
		};
9905
		333F703D0FB49C16008E12A6 /* notifications */ = {
9906
			isa = PBXGroup;
9907
			children = (
9908
				333F704A0FB49CA2008E12A6 /* Notifications.idl */,
9909
				333F704B0FB49CA2008E12A6 /* Notifications.cpp */,
9910
				333F704C0FB49CA2008E12A6 /* Notifications.h */,
9911
				333F704D0FB49CA2008E12A6 /* NotificationParameters.h */,
9912
				333F704E0FB49CA2008E12A6 /* Notification.idl */,
9913
				333F704F0FB49CA2008E12A6 /* Notification.h */,
9914
				333F70500FB49CA2008E12A6 /* Notification.cpp */,
9915
				333F70510FB49CA2008E12A6 /* NotificationProvider.h */,
9916
			);
9917
			name = notifications;
9918
			sourceTree = "<group>";
9919
		};
9888
		449195900FBE175B00D9F824 /* Exports */ = {
9920
		449195900FBE175B00D9F824 /* Exports */ = {
9889
			isa = PBXGroup;
9921
			isa = PBXGroup;
9890
			children = (
9922
			children = (
- WebCore/bindings/v8/WorkerContextExecutionProxy.cpp +10 lines
Lines 38-43 WebCore/bindings/v8/WorkerContextExecutionProxy.cpp_sec1
38
#include "V8Binding.h"
38
#include "V8Binding.h"
39
#include "V8Proxy.h"
39
#include "V8Proxy.h"
40
#include "Event.h"
40
#include "Event.h"
41
#include "Notification.h"
42
#include "Notifications.h"
41
#include "V8WorkerContextEventListener.h"
43
#include "V8WorkerContextEventListener.h"
42
#include "V8WorkerContextObjectEventListener.h"
44
#include "V8WorkerContextObjectEventListener.h"
43
#include "Worker.h"
45
#include "Worker.h"
Lines 252-257 v8::Handle<v8::Value> WorkerContextExecu WebCore/bindings/v8/WorkerContextExecutionProxy.cpp_sec2
252
            case V8ClassIndex::WORKERNAVIGATOR:
254
            case V8ClassIndex::WORKERNAVIGATOR:
253
                static_cast<WorkerNavigator*>(impl)->ref();
255
                static_cast<WorkerNavigator*>(impl)->ref();
254
                break;
256
                break;
257
#if ENABLE(NOTIFICATIONS)
258
            case V8ClassIndex::NOTIFICATIONS:
259
                static_cast<Notifications*>(impl)->ref();
260
                break;
261
            case V8ClassIndex::NOTIFICATION:
262
                static_cast<Notification*>(impl)->ref();
263
                break;
264
#endif
255
            default:
265
            default:
256
                ASSERT(false);
266
                ASSERT(false);
257
            }
267
            }
- WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp +9 lines
Lines 648-651 CALLBACK_FUNC_DECL(DOMWindowClearInterva WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp_sec1
648
    return v8::Undefined();
648
    return v8::Undefined();
649
}
649
}
650
650
651
#if ENABLE(NOTIFICATIONS)
652
ACCESSOR_GETTER(DOMWindowNotifications)
653
{
654
    INC_STATS(L"DOM.DOMWindow.notifications._get");
655
    DOMWindow* imp = V8Proxy::ToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
656
    return V8Proxy::ToV8Object(V8ClassIndex::NOTIFICATIONS, imp->notifications());
657
}
658
#endif // ENABLE(NOTIFICATIONS)
659
651
} // namespace WebCore
660
} // namespace WebCore
- WebCore/bindings/v8/custom/V8NotificationsCustom.cpp +238 lines
Line 0 WebCore/bindings/v8/custom/V8NotificationsCustom.cpp_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include "config.h"
32
33
#if ENABLE(NOTIFICATIONS)
34
35
#include "v8_binding.h"
36
#include "v8_custom.h"
37
#include "V8Proxy.h"
38
39
#include "NotImplemented.h"
40
#include "Notification.h"
41
#include "Notifications.h"
42
#include "WorkerContext.h"
43
#include "WorkerContextExecutionProxy.h"
44
#include "V8Binding.h"
45
#include "V8CustomEventListener.h"
46
#include "V8Utilities.h"
47
48
namespace WebCore {
49
50
ACCESSOR_GETTER(NotificationOndisplay)
51
{
52
    INC_STATS(L"DOM.Notification.ondisplay._get");
53
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, info.Holder());
54
    if (notif->ondisplay()) {
55
        V8EventListener* listener = static_cast<V8EventListener*>(notif->ondisplay());
56
        v8::Local<v8::Object> v8Listener = listener->getListenerObject();
57
        return v8Listener;
58
    }
59
    return v8::Undefined();
60
}
61
62
ACCESSOR_SETTER(NotificationOndisplay) 
63
{
64
    INC_STATS(L"DOM.Notification.ondisplay._set");
65
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, info.Holder());
66
    V8EventListener* oldListener = static_cast<V8EventListener*>(notif->ondisplay());
67
    if (value->IsNull()) {
68
        if (oldListener) {
69
            v8::Local<v8::Object> oldV8Listener = oldListener->getListenerObject();
70
            removeHiddenDependency(info.Holder(), oldV8Listener, V8Custom::kNotificationRequestCacheIndex);
71
        }
72
73
        // Clear the listener
74
        notif->setOndisplay(0);
75
    } else {
76
        RefPtr<EventListener> listener;
77
        ScriptExecutionContext* context = notif->scriptExecutionContext();
78
            if (context->isWorkerContext())
79
                listener = static_cast<WorkerContext*>(context)->script()->proxy()->findOrCreateEventListener(v8::Local<v8::Object>::Cast(value), false, false);
80
            else
81
                listener = V8Proxy::retrieve(context)->FindOrCreateV8EventListener(v8::Local<v8::Object>::Cast(value), false);
82
83
        if (listener) {
84
            if (oldListener) {
85
                v8::Local<v8::Object> oldV8Listener = oldListener->getListenerObject();
86
                removeHiddenDependency(info.Holder(), oldV8Listener, V8Custom::kNotificationRequestCacheIndex);
87
            }
88
    
89
            notif->setOndisplay(listener);
90
            createHiddenDependency(info.Holder(), value, V8Custom::kNotificationRequestCacheIndex);
91
        }
92
    }
93
}
94
95
ACCESSOR_GETTER(NotificationOnerror)
96
{
97
    INC_STATS(L"DOM.Notification.onerror._get");
98
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, info.Holder());
99
    if (notif->onerror()) {
100
        V8EventListener* listener = static_cast<V8EventListener*>(notif->onerror());
101
        v8::Local<v8::Object> v8Listener = listener->getListenerObject();
102
        return v8Listener;
103
    }
104
    return v8::Undefined();
105
}
106
107
ACCESSOR_SETTER(NotificationOnerror)
108
{
109
    INC_STATS(L"DOM.Notification.onerror._set");
110
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, info.Holder());
111
    V8EventListener* oldListener = static_cast<V8EventListener*>(notif->onerror());
112
    if (value->IsNull()) {
113
        if (oldListener) {
114
            v8::Local<v8::Object> oldV8Listener = oldListener->getListenerObject();
115
            removeHiddenDependency(info.Holder(), oldV8Listener, V8Custom::kNotificationRequestCacheIndex);
116
        }
117
118
        // Clear the listener
119
        notif->setOnerror(0);
120
    } else {
121
        RefPtr<EventListener> listener;
122
        ScriptExecutionContext* context = notif->scriptExecutionContext();
123
            if (context->isWorkerContext())
124
                listener = static_cast<WorkerContext*>(context)->script()->proxy()->findOrCreateEventListener(v8::Local<v8::Object>::Cast(value), false, false);
125
            else
126
                listener = V8Proxy::retrieve(context)->FindOrCreateV8EventListener(v8::Local<v8::Object>::Cast(value), false);
127
        if (listener) {
128
            if (oldListener) {
129
                v8::Local<v8::Object> oldV8Listener =
130
                    oldListener->getListenerObject();
131
                removeHiddenDependency(info.Holder(), oldV8Listener, V8Custom::kNotificationRequestCacheIndex);
132
            }
133
134
            notif->setOnerror(listener);
135
            createHiddenDependency(info.Holder(), value, V8Custom::kNotificationRequestCacheIndex);
136
        }
137
    }
138
}
139
140
ACCESSOR_GETTER(NotificationOnclose) 
141
{
142
    INC_STATS(L"DOM.Notification.onclose._get");
143
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, info.Holder());
144
    if (notif->onclose()) {
145
        V8EventListener* listener = static_cast<V8EventListener*>(notif->onclose());
146
        v8::Local<v8::Object> v8Listener = listener->getListenerObject();
147
        return v8Listener;
148
    }
149
    return v8::Undefined();
150
}
151
152
ACCESSOR_SETTER(NotificationOnclose)
153
{
154
    INC_STATS(L"DOM.Notification.onerror._set");
155
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, info.Holder());
156
    V8EventListener* oldListener = static_cast<V8EventListener*>(notif->onclose());
157
    if (value->IsNull()) {
158
        if (oldListener) {
159
            v8::Local<v8::Object> oldV8Listener = oldListener->getListenerObject();
160
            removeHiddenDependency(info.Holder(), oldV8Listener, V8Custom::kNotificationRequestCacheIndex);
161
        }
162
163
        // Clear the listener
164
        notif->setOnclose(0);
165
    } else {
166
        RefPtr<EventListener> listener;
167
        ScriptExecutionContext* context = notif->scriptExecutionContext();
168
            if (context->isWorkerContext())
169
                listener = static_cast<WorkerContext*>(context)->script()->proxy()->findOrCreateEventListener(v8::Local<v8::Object>::Cast(value), false, false);
170
            else
171
                listener = V8Proxy::retrieve(context)->FindOrCreateV8EventListener(v8::Local<v8::Object>::Cast(value), false);
172
        if (listener) {
173
            if (oldListener) {
174
                v8::Local<v8::Object> oldV8Listener =
175
                    oldListener->getListenerObject();
176
                removeHiddenDependency(info.Holder(), oldV8Listener, V8Custom::kNotificationRequestCacheIndex);
177
            }
178
179
            notif->setOnclose(listener);
180
            createHiddenDependency(info.Holder(), value, V8Custom::kNotificationRequestCacheIndex);
181
        }
182
    }
183
}
184
185
CALLBACK_FUNC_DECL(NotificationsCreateHTMLNotification)
186
{
187
    INC_STATS(L"DOM.Notifications.CreateHTMLNotification()");
188
    Notifications* notifInterface = V8Proxy::ToNativeObject<Notifications>(V8ClassIndex::NOTIFICATIONS, args.Holder());
189
  
190
    ExceptionCode ec = 0;
191
    String url = toWebCoreString(args[0]);
192
    RefPtr<Notification> notif = Notification::create(url, notifInterface->context(), ec, notifInterface->provider());
193
194
    if (ec) {
195
        return throwError(ec);
196
    }
197
198
    return WorkerContextExecutionProxy::ToV8Object(V8ClassIndex::NOTIFICATION, notif.get());
199
}
200
201
CALLBACK_FUNC_DECL(NotificationsCreateNotification)
202
{
203
    INC_STATS(L"DOM.Notifications.CreateNotification()");
204
    Notifications* notifInterface = V8Proxy::ToNativeObject<Notifications>(V8ClassIndex::NOTIFICATIONS, args.Holder());
205
    
206
    NotificationParameters parameters(toWebCoreString(args[0]), toWebCoreString(args[1]), toWebCoreString(args[2]));
207
    
208
    ExceptionCode ec = 0;
209
    RefPtr<Notification> notif = Notification::create(parameters, notifInterface->context(), ec, notifInterface->provider());
210
211
    if (ec) {
212
        return throwError(ec);
213
    }
214
215
    return WorkerContextExecutionProxy::ToV8Object(V8ClassIndex::NOTIFICATION, notif.get());
216
}
217
218
CALLBACK_FUNC_DECL(NotificationShow) 
219
{
220
    INC_STATS(L"DOM.Notification.Show()");
221
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, args.Holder());
222
    notif->show();
223
224
    return v8::Undefined();
225
}
226
227
CALLBACK_FUNC_DECL(NotificationCancel) 
228
{
229
    INC_STATS(L"DOM.Notification.Cancel()");
230
    Notification* notif = V8Proxy::ToNativeObject<Notification>(V8ClassIndex::NOTIFICATION, args.Holder());
231
    notif->cancel();
232
233
    return v8::Undefined();
234
}
235
236
}  // namespace WebCore
237
238
#endif  // ENABLE(NOTIFICATIONS)
- WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp +9 lines
Lines 91-96 ACCESSOR_SETTER(WorkerContextOnmessage) WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp_sec1
91
    }
91
    }
92
}
92
}
93
93
94
#if ENABLE(NOTIFICATIONS)
95
ACCESSOR_GETTER(WorkerContextNotifications)
96
{
97
    INC_STATS(L"DOM.WorkerContext.notifications._get");
98
    WorkerContext* workerContext = V8Proxy::ToNativeObject<WorkerContext>(V8ClassIndex::WORKERCONTEXT, info.Holder());
99
    return WorkerContextExecutionProxy::ToV8Object(V8ClassIndex::NOTIFICATIONS, workerContext->notifications());
100
}
101
#endif // ENABLE(NOTIFICATIONS)
102
94
v8::Handle<v8::Value> SetTimeoutOrInterval(const v8::Arguments& args, bool singleShot)
103
v8::Handle<v8::Value> SetTimeoutOrInterval(const v8::Arguments& args, bool singleShot)
95
{
104
{
96
    WorkerContext* workerContext = V8Proxy::ToNativeObject<WorkerContext>(V8ClassIndex::WORKERCONTEXT, args.Holder());
105
    WorkerContext* workerContext = V8Proxy::ToNativeObject<WorkerContext>(V8ClassIndex::WORKERCONTEXT, args.Holder());
- WebCore/loader/EmptyClients.h +4 lines
Lines 133-138 public: WebCore/loader/EmptyClients.h_sec1
133
    virtual void exceededDatabaseQuota(Frame*, const String&) { }
133
    virtual void exceededDatabaseQuota(Frame*, const String&) { }
134
#endif
134
#endif
135
135
136
#if ENABLE(NOTIFICATIONS)
137
    virtual NotificationProvider* notificationProvider() const { return 0; }
138
#endif
139
136
    virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) { }
140
    virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) { }
137
141
138
    virtual void formStateDidChange(const Node*) { }
142
    virtual void formStateDidChange(const Node*) { }
- WebCore/notifications/Notification.cpp +146 lines
Line 0 WebCore/notifications/Notification.cpp_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
#include "config.h"
31
32
#if ENABLE(NOTIFICATIONS)
33
34
#include "Notification.h"
35
#include "NotificationParameters.h"
36
37
#include "Document.h"
38
#include "EventNames.h"
39
#include "WorkerContext.h"
40
41
namespace WebCore {
42
43
Notification::Notification(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationProvider* provider)
44
    : ActiveDOMObject(context, this)
45
    , m_HTML(true)
46
    , m_provider(provider)
47
    , m_id(0)
48
{
49
    m_notificationURL = context->completeURL(url);
50
    if (url.isEmpty() || !m_notificationURL.isValid()) {
51
        ec = SYNTAX_ERR;
52
        return;
53
    }
54
}
55
56
Notification::Notification(const NotificationParameters& fields, ScriptExecutionContext* context, ExceptionCode& ec, NotificationProvider* provider)
57
    : ActiveDOMObject(context, this)
58
    , m_HTML(false)
59
    , m_fields(fields)
60
    , m_provider(provider)
61
    , m_id(0)
62
{
63
    KURL icon = context->completeURL(fields.icon());
64
    if (!icon.isEmpty() && !icon.isValid()) {
65
        ec = SYNTAX_ERR;
66
        return;
67
    }
68
}
69
70
Notification::~Notification() 
71
{
72
}
73
74
void Notification::show() 
75
{
76
    if (m_HTML)
77
        m_id = m_provider->show(m_notificationURL, this);
78
    else
79
        m_id = m_provider->show(m_fields.icon(), m_fields.title(), m_fields.body(), this);
80
}
81
82
void Notification::cancel() 
83
{
84
    m_provider->cancel(m_id);
85
}
86
87
void Notification::dispatchDisplayEvent() 
88
{   
89
    RefPtr<Event> event = Event::create(eventNames().loadEvent, false, true);
90
    if (m_onDisplayListener) {
91
        event->setTarget(this);
92
        event->setCurrentTarget(this);
93
        m_onDisplayListener->handleEvent(event.get(), true);
94
    }
95
96
    ExceptionCode ec = 0;
97
    dispatchEvent(event.release(), ec);
98
    ASSERT(!ec);
99
}
100
101
void Notification::dispatchErrorEvent(const String&/* message */)
102
{  
103
    RefPtr<Event> event = Event::create(eventNames().errorEvent, false, true);
104
    if (m_onErrorListener) {
105
        event->setTarget(this);
106
        event->setCurrentTarget(this);
107
        m_onErrorListener->handleEvent(event.get(), true);
108
    }
109
110
    ExceptionCode ec = 0;
111
    dispatchEvent(event.release(), ec);
112
    ASSERT(!ec);
113
}
114
115
void Notification::dispatchCloseEvent(bool /* xplicit */) 
116
{   
117
    RefPtr<Event> event = Event::create(eventNames().closeEvent, false, true);
118
    if (m_onCloseListener) {
119
        event->setTarget(this);
120
        event->setCurrentTarget(this);
121
        m_onCloseListener->handleEvent(event.get(), true);
122
    }
123
124
    ExceptionCode ec = 0;
125
    dispatchEvent(event.release(), ec);
126
    ASSERT(!ec);
127
}
128
129
void Notification::display()
130
{
131
    dispatchDisplayEvent();
132
}
133
134
void Notification::error(const String& errorMessage)
135
{
136
    dispatchErrorEvent(errorMessage);
137
}
138
139
void Notification::close(bool xplicit)
140
{
141
    dispatchCloseEvent(xplicit);
142
}
143
144
} // namespace WebCore
145
146
#endif // ENABLE(NOTIFICATIONS)
- WebCore/notifications/Notification.h +113 lines
Line 0 WebCore/notifications/Notification.h_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef Notification_h  
32
#define Notification_h
33
34
#include "ActiveDOMObject.h"
35
#include "AtomicStringHash.h"
36
#include "Event.h"
37
#include "EventListener.h"
38
#include "EventTarget.h"
39
#include "ExceptionCode.h"
40
#include "KURL.h"
41
#include "NotificationProvider.h"
42
#include "NotificationParameters.h"
43
#include <wtf/OwnPtr.h>
44
#include <wtf/PassRefPtr.h>
45
#include <wtf/RefCounted.h>
46
#include <wtf/RefPtr.h>
47
48
#if ENABLE(NOTIFICATIONS)
49
namespace WebCore {
50
51
    class WorkerContext;
52
53
    class Notification : public RefCounted<Notification>, public ActiveDOMObject, public EventTarget { 
54
    public:
55
        static PassRefPtr<Notification> create(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationProvider* provider) { return adoptRef(new Notification(url, context, ec, provider)); }
56
        static PassRefPtr<Notification> create(const NotificationParameters& fields, ScriptExecutionContext* context, ExceptionCode& ec, NotificationProvider* provider) { return adoptRef(new Notification(fields, context, ec, provider)); }
57
        
58
        virtual ~Notification();
59
60
        void show();
61
        void cancel();
62
    
63
        EventListener* ondisplay() const { return m_onDisplayListener.get(); }
64
        void setOndisplay(PassRefPtr<EventListener> eventListener) { m_onDisplayListener = eventListener; }
65
        EventListener* onerror() const { return m_onErrorListener.get(); }
66
        void setOnerror(PassRefPtr<EventListener> eventListener) { m_onErrorListener = eventListener; }
67
        EventListener* onclose() const { return m_onCloseListener.get(); }
68
        void setOnclose(PassRefPtr<EventListener> eventListener) { m_onCloseListener = eventListener; }
69
    
70
        using RefCounted<Notification>::ref;
71
        using RefCounted<Notification>::deref;
72
    
73
        // Callback methods for the provider
74
        void display();
75
        void error(const String& errorMessage);
76
        void close(bool xplicit);
77
78
        // EventTarget interface
79
        virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
80
        virtual void addEventListener(const AtomicString&, PassRefPtr<EventListener>, bool) {}
81
        virtual void removeEventListener(const AtomicString&, EventListener*, bool) {}
82
        virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&) { return false; }
83
      
84
    private:
85
        Notification(const String& url, ScriptExecutionContext* context, ExceptionCode& ec, NotificationProvider* provider);
86
        Notification(const NotificationParameters& fields, ScriptExecutionContext* context, ExceptionCode& ec, NotificationProvider* provider);
87
88
        void dispatchDisplayEvent();
89
        void dispatchErrorEvent(const String&);
90
        void dispatchCloseEvent(bool);
91
92
        // EventTarget interface
93
        virtual void refEventTarget() { ref(); }
94
        virtual void derefEventTarget() { deref(); }
95
  
96
        bool m_HTML;
97
        KURL m_notificationURL;
98
        NotificationParameters m_fields;
99
100
        RefPtr<EventListener> m_onDisplayListener;
101
        RefPtr<EventListener> m_onErrorListener;
102
        RefPtr<EventListener> m_onCloseListener;
103
104
        NotificationProvider* m_provider;
105
106
        int m_id;
107
    };
108
109
} // namespace WebCore
110
111
#endif // ENABLE(NOTIFICATIONS)
112
113
#endif // Notifications_h
- WebCore/notifications/Notification.idl +44 lines
Line 0 WebCore/notifications/Notification.idl_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
module threads {
32
33
    interface [
34
        Conditional=NOTIFICATIONS
35
    ] Notification {
36
        [Custom] void show();
37
        [Custom] void cancel();
38
39
        attribute EventListener ondisplay;
40
        attribute EventListener onerror;
41
        attribute EventListener onclose;
42
    };
43
44
}
- WebCore/notifications/NotificationParameters.h +60 lines
Line 0 WebCore/notifications/NotificationParameters.h_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef NotificationParameters_h
32
#define NotificationParameters_h
33
34
#if ENABLE(NOTIFICATIONS)
35
36
namespace WebCore {
37
38
    class NotificationParameters { 
39
    public:
40
        NotificationParameters() {}
41
        NotificationParameters(const String& iconUrl, const String& title, const String& body) 
42
            : m_icon(iconUrl)
43
            , m_title(title)
44
            , m_body(body) {}
45
46
        String icon() const { return m_icon; }
47
        String title() const { return m_title; }
48
        String body() const { return m_body; }
49
50
    private:
51
        String m_icon;
52
        String m_title;
53
        String m_body;
54
    };
55
56
} // namespace WebCore
57
58
#endif // ENABLE(NOTIFICATIONS)
59
60
#endif // NotificationParameters_h
- WebCore/notifications/NotificationProvider.h +56 lines
Line 0 WebCore/notifications/NotificationProvider.h_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef NotificationProvider_h
32
#define NotificationProvider_h
33
34
#if ENABLE(NOTIFICATIONS)
35
36
namespace WebCore {
37
38
    class String;
39
    class Notification;
40
41
    class NotificationProvider {
42
    public:
43
        virtual ~NotificationProvider() {}
44
45
        virtual int show(const String& URL, Notification* object) = 0;
46
47
        virtual int show(const String& iconUrl, const String& title, const String& body, Notification* object) = 0;
48
49
        virtual void cancel(int handle) = 0;
50
    };
51
52
} // namespace WebCore
53
54
#endif // ENABLE(NOTIFICATIONS)
55
56
#endif // NotificationProvider_h
- WebCore/notifications/Notifications.cpp +49 lines
Line 0 WebCore/notifications/Notifications.cpp_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include "config.h"
32
33
#if ENABLE(NOTIFICATIONS)
34
35
#include "Notifications.h"
36
37
#include "Document.h"
38
#include "WorkerContext.h"
39
40
namespace WebCore {
41
42
Notifications::Notifications(ScriptExecutionContext* context, NotificationProvider* provider) 
43
    : ActiveDOMObject(context, this)
44
    , m_scriptExecutionContext(context)
45
    , m_notificationProvider(provider) {}
46
47
} // namespace WebCore
48
49
#endif // ENABLE(NOTIFICATIONS)
- WebCore/notifications/Notifications.h +74 lines
Line 0 WebCore/notifications/Notifications.h_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef Notifications_h
32
#define Notifications_h
33
34
#include "Notification.h"
35
#include "WorkerThread.h"
36
#include <wtf/OwnPtr.h>
37
#include <wtf/PassRefPtr.h>
38
#include <wtf/RefCounted.h>
39
#include <wtf/RefPtr.h>
40
41
#if ENABLE(NOTIFICATIONS)
42
43
namespace WebCore {
44
45
    class ScriptExecutionContext;
46
47
    class Notifications : public RefCounted<Notifications>, public ActiveDOMObject { 
48
    public:
49
        static PassRefPtr<Notifications> create(ScriptExecutionContext* context, NotificationProvider* provider) { return adoptRef(new Notifications(context, provider)); }
50
        
51
        PassRefPtr<Notification> createHTMLNotification(const String& URI, ExceptionCode& ec)
52
        {
53
            return Notification::create(KURL(URI), m_scriptExecutionContext, ec, m_notificationProvider);
54
        }
55
        PassRefPtr<Notification> createNotification(NotificationParameters parameters, ExceptionCode& ec)
56
        {
57
            return Notification::create(parameters, m_scriptExecutionContext, ec, m_notificationProvider);
58
        }
59
60
        ScriptExecutionContext* context() const { return m_scriptExecutionContext; }
61
        NotificationProvider* provider() const { return m_notificationProvider; }
62
63
    private:
64
        Notifications(ScriptExecutionContext*, NotificationProvider*);
65
66
        ScriptExecutionContext* m_scriptExecutionContext;
67
        NotificationProvider* m_notificationProvider;
68
    };
69
70
} // namespace WebCore
71
72
#endif // ENABLE(NOTIFICATIONS)
73
74
#endif // Notifications_h
- WebCore/notifications/Notifications.idl +40 lines
Line 0 WebCore/notifications/Notifications.idl_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
module threads {
32
33
    interface [
34
        Conditional=NOTIFICATIONS
35
    ] Notifications {
36
       [ReturnsNew] [Custom] Notification createHTMLNotification(in DOMString url);
37
       [ReturnsNew] [Custom] Notification createNotification(in DOMString iconUrl, in DOMString title, in DOMString body);
38
    };
39
40
}
- WebCore/page/Chrome.cpp +7 lines
Lines 391-396 bool Chrome::setCursor(PlatformCursorHan WebCore/page/Chrome.cpp_sec1
391
    return m_client->setCursor(cursor);
391
    return m_client->setCursor(cursor);
392
}
392
}
393
393
394
#if ENABLE(NOTIFICATIONS)
395
NotificationProvider* Chrome::notificationProvider() const
396
{
397
    return m_client->notificationProvider();
398
}
399
#endif
400
394
// --------
401
// --------
395
402
396
#if ENABLE(DASHBOARD_SUPPORT)
403
#if ENABLE(DASHBOARD_SUPPORT)
- WebCore/page/Chrome.h +7 lines
Lines 44-49 namespace WebCore { WebCore/page/Chrome.h_sec1
44
    class IntRect;
44
    class IntRect;
45
    class Page;
45
    class Page;
46
    class String;
46
    class String;
47
#if ENABLE(NOTIFICATIONS)
48
    class NotificationProvider;
49
#endif
47
50
48
    struct FrameLoadRequest;
51
    struct FrameLoadRequest;
49
    struct WindowFeatures;
52
    struct WindowFeatures;
Lines 128-133 namespace WebCore { WebCore/page/Chrome.h_sec2
128
        void focusNSView(NSView*);
131
        void focusNSView(NSView*);
129
#endif
132
#endif
130
133
134
#if ENABLE(NOTIFICATIONS)
135
        NotificationProvider* notificationProvider() const; 
136
#endif
137
131
    private:
138
    private:
132
        Page* m_page;
139
        Page* m_page;
133
        ChromeClient* m_client;
140
        ChromeClient* m_client;
- WebCore/page/ChromeClient.h +8 lines
Lines 60-65 namespace WebCore { WebCore/page/ChromeClient.h_sec1
60
    class GraphicsLayer;
60
    class GraphicsLayer;
61
#endif
61
#endif
62
62
63
#if ENABLE(NOTIFICATIONS)
64
    class NotificationProvider;
65
#endif
66
63
    class ChromeClient {
67
    class ChromeClient {
64
    public:
68
    public:
65
        virtual void chromeDestroyed() = 0;
69
        virtual void chromeDestroyed() = 0;
Lines 141-146 namespace WebCore { WebCore/page/ChromeClient.h_sec2
141
        virtual void dashboardRegionsChanged();
145
        virtual void dashboardRegionsChanged();
142
#endif
146
#endif
143
147
148
#if ENABLE(NOTIFICATIONS)
149
        virtual NotificationProvider* notificationProvider() const = 0;
150
#endif
151
144
        virtual void populateVisitedLinks();
152
        virtual void populateVisitedLinks();
145
153
146
        virtual FloatRect customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect);
154
        virtual FloatRect customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect);
- WebCore/page/DOMWindow.cpp +28 lines
Lines 80-85 WebCore/page/DOMWindow.cpp_sec1
80
#include "DOMApplicationCache.h"
80
#include "DOMApplicationCache.h"
81
#endif
81
#endif
82
82
83
#if ENABLE(NOTIFICATIONS)
84
#include "Notifications.h"
85
#endif
86
83
using std::min;
87
using std::min;
84
using std::max;
88
using std::max;
85
89
Lines 440-445 void DOMWindow::clear() WebCore/page/DOMWindow.cpp_sec2
440
        m_applicationCache->disconnectFrame();
444
        m_applicationCache->disconnectFrame();
441
    m_applicationCache = 0;
445
    m_applicationCache = 0;
442
#endif
446
#endif
447
448
#if ENABLE(NOTIFICATIONS)
449
    m_notifications = 0;
450
#endif
443
}
451
}
444
452
445
Screen* DOMWindow::screen() const
453
Screen* DOMWindow::screen() const
Lines 575-580 Storage* DOMWindow::localStorage() const WebCore/page/DOMWindow.cpp_sec3
575
}
583
}
576
#endif
584
#endif
577
585
586
#if ENABLE(NOTIFICATIONS)
587
Notifications* DOMWindow::notifications() const
588
{
589
    if (m_notifications)
590
        return m_notifications.get();
591
592
    Document* document = this->document();
593
    if (!document)
594
        return 0;
595
    
596
    Page* page = document->page();
597
    if (!page)
598
        return 0;
599
600
    m_notifications = Notifications::create(document, page->chrome()->notificationProvider());    
601
      
602
    return m_notifications.get();
603
}
604
#endif
605
578
void DOMWindow::postMessage(const String& message, MessagePort* messagePort, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
606
void DOMWindow::postMessage(const String& message, MessagePort* messagePort, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
579
{
607
{
580
    if (!m_frame)
608
    if (!m_frame)
- WebCore/page/DOMWindow.h +8 lines
Lines 55-60 namespace WebCore { WebCore/page/DOMWindow.h_sec1
55
    class MessagePort;
55
    class MessagePort;
56
    class Navigator;
56
    class Navigator;
57
    class Node;
57
    class Node;
58
    class Notifications;
58
    class PostMessageTimer;
59
    class PostMessageTimer;
59
    class ScheduledAction;
60
    class ScheduledAction;
60
    class Screen;
61
    class Screen;
Lines 200-205 namespace WebCore { WebCore/page/DOMWindow.h_sec2
200
        DOMApplicationCache* applicationCache() const;
201
        DOMApplicationCache* applicationCache() const;
201
#endif
202
#endif
202
203
204
#if ENABLE(NOTIFICATIONS)
205
        Notifications* notifications() const;
206
#endif
207
203
        void postMessage(const String& message, MessagePort*, const String& targetOrigin, DOMWindow* source, ExceptionCode&);
208
        void postMessage(const String& message, MessagePort*, const String& targetOrigin, DOMWindow* source, ExceptionCode&);
204
        void postMessageTimerFired(PostMessageTimer*);
209
        void postMessageTimerFired(PostMessageTimer*);
205
210
Lines 359-364 namespace WebCore { WebCore/page/DOMWindow.h_sec3
359
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
364
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
360
        mutable RefPtr<DOMApplicationCache> m_applicationCache;
365
        mutable RefPtr<DOMApplicationCache> m_applicationCache;
361
#endif
366
#endif
367
#if ENABLE(NOTIFICATIONS)
368
        mutable RefPtr<Notifications> m_notifications;
369
#endif
362
370
363
        RegisteredEventListenerVector m_eventListeners;
371
        RegisteredEventListenerVector m_eventListeners;
364
    };
372
    };
- WebCore/page/DOMWindow.idl +3 lines
Lines 163-168 module window { WebCore/page/DOMWindow.idl_sec1
163
        readonly attribute Storage sessionStorage;
163
        readonly attribute Storage sessionStorage;
164
        readonly attribute Storage localStorage;
164
        readonly attribute Storage localStorage;
165
#endif
165
#endif
166
#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
167
        readonly attribute [Custom] Notifications notifications;
168
#endif
166
169
167
                 attribute [Replaceable] Console console;
170
                 attribute [Replaceable] Console console;
168
171
- WebCore/page/Page.h +7 lines
Lines 69-74 namespace WebCore { WebCore/page/Page.h_sec1
69
#if ENABLE(WML)
69
#if ENABLE(WML)
70
    class WMLPageState;
70
    class WMLPageState;
71
#endif
71
#endif
72
#if ENABLE(NOTIFICATIONS)
73
    class NotificationProvider;
74
#endif
72
75
73
    enum FindDirection { FindDirectionForward, FindDirectionBackward };
76
    enum FindDirection { FindDirectionForward, FindDirectionBackward };
74
77
Lines 258-263 namespace WebCore { WebCore/page/Page.h_sec2
258
#if ENABLE(WML)
261
#if ENABLE(WML)
259
        OwnPtr<WMLPageState> m_wmlPageState;
262
        OwnPtr<WMLPageState> m_wmlPageState;
260
#endif
263
#endif
264
265
#if ENABLE(NOTIFICATIONS)
266
        NotificationProvider* m_notificationProvider;
267
#endif
261
    };
268
    };
262
269
263
} // namespace WebCore
270
} // namespace WebCore
- WebCore/workers/WorkerContext.cpp -1 / +16 lines
Lines 51-56 WebCore/workers/WorkerContext.cpp_sec1
51
#include "XMLHttpRequestException.h"
51
#include "XMLHttpRequestException.h"
52
#include <wtf/RefPtr.h>
52
#include <wtf/RefPtr.h>
53
53
54
#if ENABLE(NOTIFICATIONS)
55
#include "Notifications.h"
56
#endif
57
54
namespace WebCore {
58
namespace WebCore {
55
59
56
WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThread* thread)
60
WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThread* thread)
Lines 65-71 WorkerContext::WorkerContext(const KURL& WebCore/workers/WorkerContext.cpp_sec2
65
WorkerContext::~WorkerContext()
69
WorkerContext::~WorkerContext()
66
{
70
{
67
    ASSERT(currentThread() == m_thread->threadID());
71
    ASSERT(currentThread() == m_thread->threadID());
68
72
#if ENABLE(NOTIFICATIONS)  
73
    m_notifications.clear();
74
#endif
69
    m_thread->workerObjectProxy()->workerContextDestroyed();
75
    m_thread->workerObjectProxy()->workerContextDestroyed();
70
}
76
}
71
77
Lines 280-285 void WorkerContext::importScripts(const WebCore/workers/WorkerContext.cpp_sec3
280
    }
286
    }
281
}
287
}
282
288
289
#if ENABLE(NOTIFICATIONS)
290
Notifications* WorkerContext::notifications() const
291
{
292
    if (!m_notifications)
293
        m_notifications = Notifications::create(scriptExecutionContext(), m_thread->workerObjectProxy()->getNotificationProvider());
294
    return m_notifications.get();
295
}
296
#endif
297
283
} // namespace WebCore
298
} // namespace WebCore
284
299
285
#endif // ENABLE(WORKERS)
300
#endif // ENABLE(WORKERS)
- WebCore/workers/WorkerContext.h +9 lines
Lines 41-46 WebCore/workers/WorkerContext.h_sec1
41
41
42
namespace WebCore {
42
namespace WebCore {
43
43
44
    class Notifications;
44
    class ScheduledAction;
45
    class ScheduledAction;
45
    class WorkerLocation;
46
    class WorkerLocation;
46
    class WorkerNavigator;
47
    class WorkerNavigator;
Lines 112-117 namespace WebCore { WebCore/workers/WorkerContext.h_sec2
112
113
113
        void dispatchMessage(const String&);
114
        void dispatchMessage(const String&);
114
115
116
#if ENABLE(NOTIFICATIONS)
117
        Notifications* notifications() const;
118
#endif
119
115
        // These methods are used for GC marking. See JSWorkerContext::mark() in
120
        // These methods are used for GC marking. See JSWorkerContext::mark() in
116
        // JSWorkerContextCustom.cpp.
121
        // JSWorkerContextCustom.cpp.
117
        WorkerNavigator* optionalNavigator() const { return m_navigator.get(); }
122
        WorkerNavigator* optionalNavigator() const { return m_navigator.get(); }
Lines 142-147 namespace WebCore { WebCore/workers/WorkerContext.h_sec3
142
147
143
        RefPtr<EventListener> m_onmessageListener;
148
        RefPtr<EventListener> m_onmessageListener;
144
        EventListenersMap m_eventListeners;
149
        EventListenersMap m_eventListeners;
150
151
#if ENABLE_NOTIFICATIONS
152
        mutable RefPtr<Notifications> m_notifications;
153
#endif
145
    };
154
    };
146
155
147
} // namespace WebCore
156
} // namespace WebCore
- WebCore/workers/WorkerContext.idl +4 lines
Lines 75-80 module threads { WebCore/workers/WorkerContext.idl_sec1
75
        boolean dispatchEvent(in Event evt)
75
        boolean dispatchEvent(in Event evt)
76
            raises(EventException);
76
            raises(EventException);
77
77
78
#if ENABLE_NOTIFICATIONS
79
        // Notification interface
80
        readonly attribute Notifications notifications;
81
#endif
78
82
79
        // Constructors
83
        // Constructors
80
        attribute MessageEventConstructor MessageEvent;
84
        attribute MessageEventConstructor MessageEvent;
- WebCore/workers/WorkerMessagingProxy.cpp +8 lines
Lines 222-227 void WorkerMessagingProxy::postMessageTo WebCore/workers/WorkerMessagingProxy.cpp_sec1
222
        m_queuedEarlyTasks.append(MessageWorkerContextTask::create(message));
222
        m_queuedEarlyTasks.append(MessageWorkerContextTask::create(message));
223
}
223
}
224
224
225
#if ENABLE(NOTIFICATIONS)
226
NotificationProvider* WorkerMessagingProxy::getNotificationProvider() 
227
{
228
    // Notification Provider must be provided by the container.
229
    return NULL;
230
}
231
#endif
232
225
void WorkerMessagingProxy::postTaskToWorkerContext(PassRefPtr<ScriptExecutionContext::Task> task)
233
void WorkerMessagingProxy::postTaskToWorkerContext(PassRefPtr<ScriptExecutionContext::Task> task)
226
{
234
{
227
    postTaskForModeToWorkerContext(task, WorkerRunLoop::defaultMode());
235
    postTaskForModeToWorkerContext(task, WorkerRunLoop::defaultMode());
- WebCore/workers/WorkerMessagingProxy.h +4 lines
Lines 65-70 namespace WebCore { WebCore/workers/WorkerMessagingProxy.h_sec1
65
        virtual void reportPendingActivity(bool hasPendingActivity);
65
        virtual void reportPendingActivity(bool hasPendingActivity);
66
        virtual void workerContextDestroyed();
66
        virtual void workerContextDestroyed();
67
67
68
#if ENABLE(NOTIFICATIONS)
69
        virtual NotificationProvider* getNotificationProvider();
70
#endif
71
68
        void postTaskToWorkerObject(PassRefPtr<ScriptExecutionContext::Task>);
72
        void postTaskToWorkerObject(PassRefPtr<ScriptExecutionContext::Task>);
69
        void postTaskToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>);
73
        void postTaskToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>);
70
        void postTaskForModeToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>, const String& mode);
74
        void postTaskForModeToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>, const String& mode);
- WebCore/workers/WorkerObjectProxy.h +5 lines
Lines 38-43 WebCore/workers/WorkerObjectProxy.h_sec1
38
namespace WebCore {
38
namespace WebCore {
39
39
40
    class String;
40
    class String;
41
    class NotificationProvider;
41
42
42
    // A proxy to talk to the worker object.
43
    // A proxy to talk to the worker object.
43
    class WorkerObjectProxy {
44
    class WorkerObjectProxy {
Lines 55-60 namespace WebCore { WebCore/workers/WorkerObjectProxy.h_sec2
55
        virtual void reportPendingActivity(bool hasPendingActivity) = 0;
56
        virtual void reportPendingActivity(bool hasPendingActivity) = 0;
56
57
57
        virtual void workerContextDestroyed() = 0;
58
        virtual void workerContextDestroyed() = 0;
59
60
#if ENABLE(NOTIFICATIONS)
61
        virtual NotificationProvider* getNotificationProvider() = 0;
62
#endif
58
    };
63
    };
59
64
60
} // namespace WebCore
65
} // namespace WebCore
- WebKitTools/ChangeLog +8 lines
Lines 1-3 WebKitTools/ChangeLog_sec1
1
2009-05-20  John Gregg  <johnnyg@google.com>
2
3
        Adds --notifications switch to the build script.
4
5
        Reviewed by NOBODY (OOPS!).
6
7
        * Scripts/build-webkit:
8
1
2009-05-14  Holger Hans Peter Freyther  <zecke@selfish.org>
9
2009-05-14  Holger Hans Peter Freyther  <zecke@selfish.org>
2
10
3
        Reviewed by Anders Carlsson.
11
        Reviewed by Anders Carlsson.
- WebKitTools/Scripts/build-webkit +5 lines
Lines 50-55 my $geolocationSupport = 0; WebKitTools/Scripts/build-webkit_sec1
50
my $gnomeKeyringSupport = 0;
50
my $gnomeKeyringSupport = 0;
51
my $iconDatabaseSupport = 1;
51
my $iconDatabaseSupport = 1;
52
my $javaScriptDebuggerSupport = 1;
52
my $javaScriptDebuggerSupport = 1;
53
my $notificationsSupport = 0;
53
my $offlineWebApplicationSupport = 1;
54
my $offlineWebApplicationSupport = 1;
54
my $svgSupport = 1;
55
my $svgSupport = 1;
55
my $svgAnimationSupport = 1;
56
my $svgAnimationSupport = 1;
Lines 85-90 Usage: $programName [options] [options t WebKitTools/Scripts/build-webkit_sec2
85
  --[no-]gnomekeyring               Toggle GNOME Keyring Support (GTK+ port only) (default: $gnomeKeyringSupport)
86
  --[no-]gnomekeyring               Toggle GNOME Keyring Support (GTK+ port only) (default: $gnomeKeyringSupport)
86
  --[no-]icon-database              Toggle Icon database support (default: $iconDatabaseSupport)
87
  --[no-]icon-database              Toggle Icon database support (default: $iconDatabaseSupport)
87
  --[no-]javascript-debugger        Toggle JavaScript Debugger/Profiler support (default: $javaScriptDebuggerSupport)
88
  --[no-]javascript-debugger        Toggle JavaScript Debugger/Profiler support (default: $javaScriptDebuggerSupport)
89
  --[no-]notifications              Toogle Notifications support (default: $notificationsSupport)
88
  --[no-]offline-web-applications   Toggle Offline Web Application Support (default: $offlineWebApplicationSupport)
90
  --[no-]offline-web-applications   Toggle Offline Web Application Support (default: $offlineWebApplicationSupport)
89
  --[no-]svg                        Toggle SVG support (default: $svgSupport)
91
  --[no-]svg                        Toggle SVG support (default: $svgSupport)
90
  --[no-]svg-animation              Toggle SVG animation support (default: $svgAnimationSupport, implies SVG Support)
92
  --[no-]svg-animation              Toggle SVG animation support (default: $svgAnimationSupport, implies SVG Support)
Lines 113-118 GetOptions( WebKitTools/Scripts/build-webkit_sec3
113
           'gnomekeyring!' => \$gnomeKeyringSupport,
115
           'gnomekeyring!' => \$gnomeKeyringSupport,
114
           'icon-database!' => \$iconDatabaseSupport,
116
           'icon-database!' => \$iconDatabaseSupport,
115
           'javascript-debugger!' => \$javaScriptDebuggerSupport,
117
           'javascript-debugger!' => \$javaScriptDebuggerSupport,
118
           'notifications!' => \$notificationsSupport,
116
           'offline-web-applications!' => \$offlineWebApplicationSupport,
119
           'offline-web-applications!' => \$offlineWebApplicationSupport,
117
           'svg!' => \$svgSupport,
120
           'svg!' => \$svgSupport,
118
           'svg-animation!' => \$svgAnimationSupport,
121
           'svg-animation!' => \$svgAnimationSupport,
Lines 181-186 if (isGtk()) { WebKitTools/Scripts/build-webkit_sec4
181
    push @options, autotoolsFlag($gnomeKeyringSupport, "gnomekeyring");
184
    push @options, autotoolsFlag($gnomeKeyringSupport, "gnomekeyring");
182
    push @options, autotoolsFlag($iconDatabaseSupport, "icon-database");
185
    push @options, autotoolsFlag($iconDatabaseSupport, "icon-database");
183
    push @options, autotoolsFlag($javaScriptDebuggerSupport, "javascript-debugger");
186
    push @options, autotoolsFlag($javaScriptDebuggerSupport, "javascript-debugger");
187
    push @options, autotoolsFlag($notificationsSupport, "notifications");
184
    push @options, autotoolsFlag($offlineWebApplicationSupport, "offline-web-applications");
188
    push @options, autotoolsFlag($offlineWebApplicationSupport, "offline-web-applications");
185
    push @options, autotoolsFlag($svgSupport, "svg");
189
    push @options, autotoolsFlag($svgSupport, "svg");
186
    push @options, autotoolsFlag($svgAnimationSupport, "svg-animation");
190
    push @options, autotoolsFlag($svgAnimationSupport, "svg-animation");
Lines 212-217 if (isAppleMacWebKit()) { WebKitTools/Scripts/build-webkit_sec5
212
    push @options, option("ENABLE_GEOLOCATION", $geolocationSupport);
216
    push @options, option("ENABLE_GEOLOCATION", $geolocationSupport);
213
    push @options, option("ENABLE_ICONDATABASE", $iconDatabaseSupport);
217
    push @options, option("ENABLE_ICONDATABASE", $iconDatabaseSupport);
214
    push @options, option("ENABLE_JAVASCRIPT_DEBUGGER", $javaScriptDebuggerSupport);
218
    push @options, option("ENABLE_JAVASCRIPT_DEBUGGER", $javaScriptDebuggerSupport);
219
    push @options, option("ENABLE_NOTIFICATIONS", $notificationsSupport);
215
    push @options, option("ENABLE_OFFLINE_WEB_APPLICATIONS", $offlineWebApplicationSupport);
220
    push @options, option("ENABLE_OFFLINE_WEB_APPLICATIONS", $offlineWebApplicationSupport);
216
    push @options, option("ENABLE_SVG", $svgSupport);
221
    push @options, option("ENABLE_SVG", $svgSupport);
217
    push @options, option("ENABLE_SVG_ANIMATION", $svgAnimationSupport);
222
    push @options, option("ENABLE_SVG_ANIMATION", $svgAnimationSupport);
- LayoutTests/ChangeLog +12 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2009-05-20  John Gregg  <johnnyg@google.com>
2
3
        Adds basic layout test to confirm the notifications interface is visible from worker script.
4
        
5
        Reviewed by NOBODY (OOPS!).
6
7
        * fast/notifications: Added.
8
        * fast/notifications/notifications-accessor-disabled.html: Added.
9
        * fast/notifications/notifications-accessor-expected.txt: Added.
10
        * fast/notifications/resources: Added.
11
        * fast/notifications/resources/worker-notifications.js: Added.
12
1
2009-05-20  Holger Hans Peter Freyther  <zecke@selfish.org>
13
2009-05-20  Holger Hans Peter Freyther  <zecke@selfish.org>
2
14
3
        Reviewed by Anders Carlsson.
15
        Reviewed by Anders Carlsson.
- LayoutTests/fast/notifications/notifications-accessor-expected.txt +8 lines
Line 0 LayoutTests/fast/notifications/notifications-accessor-expected.txt_sec1
1
Test Worker Notifications access. Should print a series of PASS messages, followed with DONE.
2
3
Test started.
4
PASS: notifications object exists.
5
PASS: notifications.createHTMLNotifications does not exist.
6
PASS: notifications.createNotifications does not exist.
7
DONE
8
- LayoutTests/fast/notifications/notifications-accessor.html-disabled +30 lines
Line 0 LayoutTests/fast/notifications/notifications-accessor.html-disabled_sec1
1
<body>
2
<p>Test Worker Notifications access. Should print a series of PASS messages, followed with DONE.</p>
3
<div id=result></div>
4
<script>
5
function log(message)
6
{
7
    document.getElementById("result").innerHTML += message + "<br>";
8
}
9
10
if (window.layoutTestController) {
11
    layoutTestController.dumpAsText();
12
    layoutTestController.waitUntilDone();
13
}
14
15
try {
16
    var worker = new Worker("resources/worker-notifications.js");
17
18
    worker.onmessage = function(evt) {
19
        log(evt.data);
20
        if (evt.data == "DONE" && window.layoutTestController)
21
            layoutTestController.notifyDone();
22
    }
23
    
24
} catch (ex) {
25
    log("FAIL: unexpected exception " + ex);
26
    if (window.layoutTestController)
27
        layoutTestController.notifyDone();
28
}
29
</script>
30
</body>
- LayoutTests/fast/notifications/resources/worker-notifications.js +16 lines
Line 0 LayoutTests/fast/notifications/resources/worker-notifications.js_sec1
1
postMessage("Test started.");
2
3
// Try to get the notifications object from global contexts.
4
if (notifications != undefined) {
5
    postMessage("PASS: notifications object exists.");
6
    
7
    if (!notifications.createHTMLNotifications) {
8
        postMessage("PASS: notifications.createHTMLNotifications does not exist.");
9
    }
10
    
11
    if (!notifications.createNotifications) {
12
        postMessage("PASS: notifications.createNotifications does not exist.");
13
    }
14
    
15
    postMessage("DONE");
16
}

Return to Bug 25463