[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
atwilson at chromium.org
atwilson at chromium.org
Thu Oct 29 20:49:22 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit c878489bf579a5e81946c6730edb8809ee21f0fa
Author: atwilson at chromium.org <atwilson at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 21 00:22:12 2009 +0000
Need to turn off notifications properly at runtime
https://bugs.webkit.org/show_bug.cgi?id=30409
Patch by John Gregg <johnnyg at google.com> on 2009-10-20
Reviewed by David Levin.
This code only affects chromium, and is all behind a compile time
flag current turned off, so no new tests.
* bindings/v8/custom/V8CustomBinding.h:
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::ACCESSOR_RUNTIME_ENABLER):
* bindings/v8/custom/V8WorkerContextCustom.cpp:
(WebCore::ACCESSOR_RUNTIME_ENABLER):
* notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::setIsAvailable):
(WebCore::NotificationCenter::isAvailable):
* notifications/NotificationCenter.h:
* page/DOMWindow.idl:
* workers/WorkerContext.idl:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3704b41..9ec1aa6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-20 John Gregg <johnnyg at google.com>
+
+ Reviewed by David Levin.
+
+ Need to turn off notifications properly at runtime
+ https://bugs.webkit.org/show_bug.cgi?id=30409
+
+ This code only affects chromium, and is all behind a compile time
+ flag current turned off, so no new tests.
+
+ * bindings/v8/custom/V8CustomBinding.h:
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::ACCESSOR_RUNTIME_ENABLER):
+ * bindings/v8/custom/V8WorkerContextCustom.cpp:
+ (WebCore::ACCESSOR_RUNTIME_ENABLER):
+ * notifications/NotificationCenter.cpp:
+ (WebCore::NotificationCenter::setIsAvailable):
+ (WebCore::NotificationCenter::isAvailable):
+ * notifications/NotificationCenter.h:
+ * page/DOMWindow.idl:
+ * workers/WorkerContext.idl:
+
2009-10-20 James Robinson <jamesr at chromium.org>
Reviewed by Adam Barth.
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index 32268c9..0f29e6d 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -616,6 +616,10 @@ namespace WebCore {
DECLARE_CALLBACK(WorkerContextClearInterval);
DECLARE_CALLBACK(WorkerContextAddEventListener);
DECLARE_CALLBACK(WorkerContextRemoveEventListener);
+
+#if ENABLE(NOTIFICATIONS)
+ DECLARE_ACCESSOR_RUNTIME_ENABLER(WorkerContextWebkitNotifications);
+#endif
#endif // ENABLE(WORKERS)
#if ENABLE(NOTIFICATIONS)
@@ -639,6 +643,10 @@ namespace WebCore {
DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowSharedWorker);
#endif
+#if ENABLE(NOTIFICATIONS)
+ DECLARE_ACCESSOR_RUNTIME_ENABLER(DOMWindowWebkitNotifications);
+#endif
+
#if ENABLE(WEB_SOCKETS)
DECLARE_PROPERTY_ACCESSOR(WebSocketOnopen);
DECLARE_PROPERTY_ACCESSOR(WebSocketOnmessage);
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 3d3d84c..2a4f77d 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -46,6 +46,7 @@
#include "FrameView.h"
#include "HTMLCollection.h"
#include "MediaPlayer.h"
+#include "NotificationCenter.h"
#include "Page.h"
#include "PlatformScreen.h"
#include "ScheduledAction.h"
@@ -279,6 +280,13 @@ ACCESSOR_RUNTIME_ENABLER(DOMWindowWebSocket)
}
#endif
+#if ENABLE(NOTIFICATIONS)
+ACCESSOR_RUNTIME_ENABLER(DOMWindowWebkitNotifications)
+{
+ return NotificationCenter::isAvailable();
+}
+#endif
+
ACCESSOR_GETTER(DOMWindowImage)
{
DOMWindow* window = V8DOMWrapper::convertToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
diff --git a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index 21b3c30..36c7001 100644
--- a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -34,6 +34,7 @@
#include "DOMTimer.h"
#include "ExceptionCode.h"
+#include "NotificationCenter.h"
#include "ScheduledAction.h"
#include "V8Binding.h"
#include "V8CustomBinding.h"
@@ -45,6 +46,13 @@
namespace WebCore {
+#if ENABLE(NOTIFICATIONS)
+ACCESSOR_RUNTIME_ENABLER(WorkerContextWebkitNotifications)
+{
+ return NotificationCenter::isAvailable();
+}
+#endif
+
ACCESSOR_GETTER(WorkerContextSelf)
{
INC_STATS(L"DOM.WorkerContext.self._get");
diff --git a/WebCore/notifications/NotificationCenter.cpp b/WebCore/notifications/NotificationCenter.cpp
index 94976a2..69b0075 100644
--- a/WebCore/notifications/NotificationCenter.cpp
+++ b/WebCore/notifications/NotificationCenter.cpp
@@ -40,6 +40,20 @@
namespace WebCore {
+#if USE(V8)
+static bool notificationCenterAvailable = false;
+
+void NotificationCenter::setIsAvailable(bool available)
+{
+ notificationCenterAvailable = available;
+}
+
+bool NotificationCenter::isAvailable()
+{
+ return notificationCenterAvailable;
+}
+#endif
+
NotificationCenter::NotificationCenter(ScriptExecutionContext* context, NotificationPresenter* presenter)
: ActiveDOMObject(context, this)
, m_scriptExecutionContext(context)
diff --git a/WebCore/notifications/NotificationCenter.h b/WebCore/notifications/NotificationCenter.h
index 596ab8b..1084442 100644
--- a/WebCore/notifications/NotificationCenter.h
+++ b/WebCore/notifications/NotificationCenter.h
@@ -47,8 +47,12 @@ namespace WebCore {
class NotificationCenter : public RefCounted<NotificationCenter>, public ActiveDOMObject {
public:
+#if USE(V8)
+ static void setIsAvailable(bool);
+ static bool isAvailable();
+#endif
static PassRefPtr<NotificationCenter> create(ScriptExecutionContext* context, NotificationPresenter* presenter) { return adoptRef(new NotificationCenter(context, presenter)); }
-
+
Notification* createHTMLNotification(const String& URI, ExceptionCode& ec)
{
return Notification::create(KURL(ParsedURLString, URI), context(), ec, presenter());
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 4587001..5606d91 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -168,7 +168,7 @@ module window {
readonly attribute Storage localStorage;
#endif
#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
- readonly attribute NotificationCenter webkitNotifications;
+ readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications;
#endif
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
index 17bee55..0a5817c 100644
--- a/WebCore/workers/WorkerContext.idl
+++ b/WebCore/workers/WorkerContext.idl
@@ -72,7 +72,7 @@ module threads {
#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
// Notification interface
- readonly attribute NotificationCenter webkitNotifications;
+ readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications;
#endif
// Constructors
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list