Changeset 50348 in webkit


Ignore:
Timestamp:
Oct 30, 2009 12:37:12 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-30 John Gregg <johnnyg@google.com>

Reviewed by David Levin.

Need to turn off notifications properly at runtime
https://bugs.webkit.org/show_bug.cgi?id=30409

Moving the notificationsEnabled bit from NotificationCenter
to the new V8 RuntimeEnabledFeatures object.

Just moving a bit around, so no new tests.

  • bindings/v8/RuntimeEnabledFeatures.cpp:
  • bindings/v8/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setNotificationsEnabled): (WebCore::RuntimeEnabledFeatures::notificationsEnabled):
  • bindings/v8/custom/V8DOMWindowCustom.cpp: (WebCore::ACCESSOR_RUNTIME_ENABLER):
  • bindings/v8/custom/V8WorkerContextCustom.cpp: (WebCore::ACCESSOR_RUNTIME_ENABLER):
  • notifications/NotificationCenter.cpp:
  • notifications/NotificationCenter.h:
Location:
trunk/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50347 r50348  
     12009-10-30  John Gregg  <johnnyg@google.com>
     2
     3        Reviewed by David Levin.
     4
     5        Need to turn off notifications properly at runtime
     6        https://bugs.webkit.org/show_bug.cgi?id=30409
     7
     8        Moving the notificationsEnabled bit from NotificationCenter
     9        to the new V8 RuntimeEnabledFeatures object.
     10
     11        Just moving a bit around, so no new tests.
     12
     13        * bindings/v8/RuntimeEnabledFeatures.cpp:
     14        * bindings/v8/RuntimeEnabledFeatures.h:
     15        (WebCore::RuntimeEnabledFeatures::setNotificationsEnabled):
     16        (WebCore::RuntimeEnabledFeatures::notificationsEnabled):
     17        * bindings/v8/custom/V8DOMWindowCustom.cpp:
     18        (WebCore::ACCESSOR_RUNTIME_ENABLER):
     19        * bindings/v8/custom/V8WorkerContextCustom.cpp:
     20        (WebCore::ACCESSOR_RUNTIME_ENABLER):
     21        * notifications/NotificationCenter.cpp:
     22        * notifications/NotificationCenter.h:
     23
    1242009-10-30  Dmitry Titov  <dimich@chromium.org>
    225
  • trunk/WebCore/bindings/v8/RuntimeEnabledFeatures.cpp

    r50158 r50348  
    3737bool RuntimeEnabledFeatures::isLocalStorageEnabled = true;
    3838bool RuntimeEnabledFeatures::isSessionStorageEnabled = true;
     39bool RuntimeEnabledFeatures::isNotificationsEnabled = false;
    3940
    4041} // namespace WebCore
  • trunk/WebCore/bindings/v8/RuntimeEnabledFeatures.h

    r50113 r50348  
    4646    static bool sessionStorageEnabled() { return isSessionStorageEnabled; }
    4747
     48    static void setNotificationsEnabled(bool isEnabled) { isNotificationsEnabled = isEnabled; }
     49    static bool notificationsEnabled() { return isNotificationsEnabled; }
     50
    4851private:
    4952    // Never instantiate.
     
    5356    static bool isLocalStorageEnabled;
    5457    static bool isSessionStorageEnabled;
     58    static bool isNotificationsEnabled;
    5559};
    5660
  • trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

    r50113 r50348  
    4747#include "HTMLCollection.h"
    4848#include "MediaPlayer.h"
    49 #include "NotificationCenter.h"
    5049#include "Page.h"
    5150#include "PlatformScreen.h"
     
    305304ACCESSOR_RUNTIME_ENABLER(DOMWindowWebkitNotifications)
    306305{
    307     return NotificationCenter::isAvailable();
     306    return RuntimeEnabledFeatures::notificationsEnabled();
    308307}
    309308#endif
  • trunk/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp

    r50327 r50348  
    3535#include "DOMTimer.h"
    3636#include "ExceptionCode.h"
    37 #include "NotificationCenter.h"
     37#include "RuntimeEnabledFeatures.h"
    3838#include "ScheduledAction.h"
    3939#include "V8Binding.h"
     
    5050ACCESSOR_RUNTIME_ENABLER(WorkerContextWebkitNotifications)
    5151{
    52     return NotificationCenter::isAvailable();
     52    return RuntimeEnabledFeatures::notificationsEnabled();
    5353}
    5454#endif
  • trunk/WebCore/notifications/NotificationCenter.cpp

    r49893 r50348  
    4141namespace WebCore {
    4242
    43 #if USE(V8)
    44 static bool notificationCenterAvailable = false;
    45 
    46 void NotificationCenter::setIsAvailable(bool available)
    47 {
    48     notificationCenterAvailable = available;
    49 }
    50 
    51 bool NotificationCenter::isAvailable()
    52 {
    53     return notificationCenterAvailable;
    54 }
    55 #endif
    56 
    5743NotificationCenter::NotificationCenter(ScriptExecutionContext* context, NotificationPresenter* presenter)
    5844    : ActiveDOMObject(context, this)
  • trunk/WebCore/notifications/NotificationCenter.h

    r49893 r50348  
    4848    class NotificationCenter : public RefCounted<NotificationCenter>, public ActiveDOMObject {
    4949    public:
    50 #if USE(V8)
    51         static void setIsAvailable(bool);
    52         static bool isAvailable();
    53 #endif
    5450        static PassRefPtr<NotificationCenter> create(ScriptExecutionContext* context, NotificationPresenter* presenter) { return adoptRef(new NotificationCenter(context, presenter)); }
    5551
  • trunk/WebCore/page/DOMWindow.cpp

    r49214 r50348  
    626626        return 0;
    627627
    628     if (!page->settings()->experimentalNotificationsEnabled())
    629         return 0;
    630 
    631628    NotificationPresenter* provider = page->chrome()->notificationPresenter();
    632629    if (provider)
Note: See TracChangeset for help on using the changeset viewer.