Changeset 110994 in webkit


Ignore:
Timestamp:
Mar 16, 2012 5:50:01 AM (12 years ago)
Author:
haraken@chromium.org
Message:

Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl
https://bugs.webkit.org/show_bug.cgi?id=79636

Reviewed by Adam Barth.

For WebKit modularization, this patch moves Notifications-related APIs
from DOMWindow.idl to DOMWindowNotifications.idl.

Tests: fast/notifications/* (No change in test results)

  • CMakeLists.txt: Added DOMWindowNotifications.{h,cpp,idl}.
  • DerivedSources.make: Ditto.
  • DerivedSources.pri: Ditto.
  • GNUmakefile.list.am: Ditto.
  • Target.pri: Ditto.
  • WebCore.gypi: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.exp.in: Added mangled signatures of webkitNotifications().
  • notifications/DOMWindowNotifications.cpp: Added.

(WebCore):
(WebCore::DOMWindowNotifications::DOMWindowNotifications):
(WebCore::DOMWindowNotifications::~DOMWindowNotifications):
(WebCore::DOMWindowNotifications::from):
(WebCore::DOMWindowNotifications::webkitNotifications):
(WebCore::DOMWindowNotifications::ensureWebkitNotifications):
(WebCore::DOMWindowNotifications::disconnectFrame):

  • notifications/DOMWindowNotifications.h: Added.

(WebCore):
(DOMWindowNotifications):

  • notifications/DOMWindowNotifications.idl: Added.
  • page/DOMWindow.cpp: Removed ENABLE(NOTIFICATIONS).

(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::willDetachPage):
(WebCore::DOMWindow::clear):

  • page/DOMWindow.h: Ditto.

(WebCore):
(DOMWindow):

  • page/DOMWindow.idl: Ditto.
  • page/Frame.cpp: Ditto.

(WebCore::Frame::willDetachPage):
(WebCore::Frame::transferChildFrameToNewDocument):

Location:
trunk/Source/WebCore
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r110991 r110994  
    16231623IF (ENABLE_NOTIFICATIONS)
    16241624    LIST(APPEND WebCore_SOURCES
     1625        notifications/DOMWindowNotifications.cpp
    16251626        notifications/NotificationCenter.cpp
    16261627        notifications/NotificationController.cpp
     
    16291630
    16301631    LIST(APPEND WebCore_IDL_FILES
     1632        notifications/DOMWindowNotifications.idl
    16311633        notifications/Notification.idl
    16321634        notifications/NotificationCenter.idl
  • trunk/Source/WebCore/ChangeLog

    r110992 r110994  
     12012-03-16  Kentaro Hara  <haraken@chromium.org>
     2
     3        Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl
     4        https://bugs.webkit.org/show_bug.cgi?id=79636
     5
     6        Reviewed by Adam Barth.
     7
     8        For WebKit modularization, this patch moves Notifications-related APIs
     9        from DOMWindow.idl to DOMWindowNotifications.idl.
     10
     11        Tests: fast/notifications/* (No change in test results)
     12
     13        * CMakeLists.txt: Added DOMWindowNotifications.{h,cpp,idl}.
     14        * DerivedSources.make: Ditto.
     15        * DerivedSources.pri: Ditto.
     16        * GNUmakefile.list.am: Ditto.
     17        * Target.pri: Ditto.
     18        * WebCore.gypi: Ditto.
     19        * WebCore.vcproj/WebCore.vcproj: Ditto.
     20
     21        * WebCore.exp.in: Added mangled signatures of webkitNotifications().
     22
     23        * notifications/DOMWindowNotifications.cpp: Added.
     24        (WebCore):
     25        (WebCore::DOMWindowNotifications::DOMWindowNotifications):
     26        (WebCore::DOMWindowNotifications::~DOMWindowNotifications):
     27        (WebCore::DOMWindowNotifications::from):
     28        (WebCore::DOMWindowNotifications::webkitNotifications):
     29        (WebCore::DOMWindowNotifications::ensureWebkitNotifications):
     30        (WebCore::DOMWindowNotifications::disconnectFrame):
     31        * notifications/DOMWindowNotifications.h: Added.
     32        (WebCore):
     33        (DOMWindowNotifications):
     34        * notifications/DOMWindowNotifications.idl: Added.
     35
     36        * page/DOMWindow.cpp: Removed ENABLE(NOTIFICATIONS).
     37        (WebCore::DOMWindow::~DOMWindow):
     38        (WebCore::DOMWindow::willDetachPage):
     39        (WebCore::DOMWindow::clear):
     40        * page/DOMWindow.h: Ditto.
     41        (WebCore):
     42        (DOMWindow):
     43        * page/DOMWindow.idl: Ditto.
     44        * page/Frame.cpp: Ditto.
     45        (WebCore::Frame::willDetachPage):
     46        (WebCore::Frame::transferChildFrameToNewDocument):
     47
    1482012-03-16  Kentaro Hara  <haraken@chromium.org>
    249
  • trunk/Source/WebCore/DerivedSources.make

    r110957 r110994  
    357357    $(WebCore)/inspector/ScriptProfileNode.idl \
    358358    $(WebCore)/loader/appcache/DOMApplicationCache.idl \
     359    $(WebCore)/notifications/DOMWindowNotifications.idl \
    359360    $(WebCore)/notifications/Notification.idl \
    360361    $(WebCore)/notifications/NotificationCenter.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r110957 r110994  
    376376    $$PWD/inspector/ScriptProfileNode.idl \
    377377    $$PWD/loader/appcache/DOMApplicationCache.idl \
     378    $$PWD/notifications/DOMWindowNotifications.idl \
    378379    $$PWD/notifications/Notification.idl \
    379380    $$PWD/notifications/NotificationCenter.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r110957 r110994  
    28292829        Source/WebCore/mathml/MathMLTextElement.cpp \
    28302830        Source/WebCore/mathml/MathMLTextElement.h \
     2831        Source/WebCore/notifications/DOMWindowNotifications.cpp \
     2832        Source/WebCore/notifications/DOMWindowNotifications.h \
    28312833        Source/WebCore/notifications/NotificationCenter.cpp \
    28322834        Source/WebCore/notifications/NotificationCenter.h \
  • trunk/Source/WebCore/Target.pri

    r110957 r110994  
    980980    loader/TextResourceDecoder.cpp \
    981981    loader/ThreadableLoader.cpp \
     982    notifications/DOMWindowNotifications.cpp \
    982983    notifications/Notification.cpp \
    983984    notifications/NotificationCenter.cpp \
     
    20742075    mathml/MathMLMathElement.h \
    20752076    mathml/MathMLTextElement.h \
     2077    notifications/DOMWindowNotifications.h \
    20762078    notifications/Notification.h \
    20772079    notifications/NotificationCenter.h \
  • trunk/Source/WebCore/WebCore.gypi

    r110957 r110994  
    10671067            'inspector/ScriptProfileNode.idl',
    10681068            'loader/appcache/DOMApplicationCache.idl',
     1069            'notifications/DOMWindowNotifications.idl',
    10691070            'notifications/Notification.idl',
    10701071            'notifications/NotificationCenter.idl',
     
    28132814            'mathml/MathMLTextElement.cpp',
    28142815            'mathml/MathMLTextElement.h',
     2816            'notifications/DOMWindowNotifications.cpp',
     2817            'notifications/DOMWindowNotifications.h',
    28152818            'notifications/Notification.cpp',
    28162819            'notifications/Notification.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r110957 r110994  
    5360753607                        >
    5360853608                        <File
     53609                                RelativePath="..\notifications\DOMWindowNotifications.cpp"
     53610                                >
     53611                        </File>
     53612                        <File
     53613                                RelativePath="..\notifications\DOMWindowNotifications.h"
     53614                                >
     53615                        </File>
     53616                        <File
    5360953617                                RelativePath="..\notifications\Notification.cpp"
    5361053618                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r110903 r110994  
    41144114                A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; };
    41154115                A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; };
     4116                A886CF761512301700D279F4 /* DOMWindowNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */; };
     4117                A886CF771512301700D279F4 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = A886CF741512301700D279F4 /* DOMWindowNotifications.h */; };
    41164118                A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
    41174119                A88DD4870B4629A300C02990 /* PathTraversalState.h in Headers */ = {isa = PBXBuildFile; fileRef = A88DD4860B4629A300C02990 /* PathTraversalState.h */; };
     
    1090910911                A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSKeyboardEvent.h; sourceTree = "<group>"; };
    1091010912                A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyboardEvent.cpp; sourceTree = "<group>"; };
     10913                A86E87711512DCEA00AD14C1 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DOMWindowNotifications.idl; path = notifications/DOMWindowNotifications.idl; sourceTree = "<group>"; };
    1091110914                A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLPlugInElement.h; sourceTree = "<group>"; };
    1091210915                A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPlugInElement.cpp; sourceTree = "<group>"; };
     
    1097010973                A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; };
    1097110974                A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; };
     10975                A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMWindowNotifications.cpp; path = notifications/DOMWindowNotifications.cpp; sourceTree = "<group>"; };
     10976                A886CF741512301700D279F4 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMWindowNotifications.h; path = notifications/DOMWindowNotifications.h; sourceTree = "<group>"; };
    1097210977                A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; };
    1097310978                A88DD4880B4629B000C02990 /* PathTraversalState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathTraversalState.cpp; sourceTree = "<group>"; };
     
    1439214397                        isa = PBXGroup;
    1439314398                        children = (
     14399                                A86E87711512DCEA00AD14C1 /* DOMWindowNotifications.idl */,
     14400                                A886CF731512301700D279F4 /* DOMWindowNotifications.cpp */,
     14401                                A886CF741512301700D279F4 /* DOMWindowNotifications.h */,
    1439414402                                33503CC61017A1B1003B47E1 /* Notification.cpp */,
    1439514403                                333F704F0FB49CA2008E12A6 /* Notification.h */,
     
    2457624584                                450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
    2457724585                                C5B4C24D1509236C00A6EF37 /* WebCoreNSURLExtras.h in Headers */,
     24586                                A886CF771512301700D279F4 /* DOMWindowNotifications.h in Headers */,
    2457824587                        );
    2457924588                        runOnlyForDeploymentPostprocessing = 0;
     
    2755727566                                9B2B7AC11509850A008932CC /* MicroDataItemValue.cpp in Sources */,
    2755827567                                7157F062150B6564006EAABD /* SVGAnimatedTransformList.cpp in Sources */,
     27568                                A886CF761512301700D279F4 /* DOMWindowNotifications.cpp in Sources */,
    2755927569                        );
    2756027570                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r110981 r110994  
    7373#include "MessageEvent.h"
    7474#include "Navigator.h"
    75 #include "NotificationCenter.h"
    76 #include "NotificationController.h"
    7775#include "Page.h"
    7876#include "PageGroup.h"
     
    419417        ASSERT(!m_localStorage);
    420418        ASSERT(!m_applicationCache);
    421 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    422         ASSERT(!m_notifications);
    423 #endif
    424419#if ENABLE(BLOB)
    425420        ASSERT(!m_domURL);
     
    479474    InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
    480475
    481 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    482     // Clearing Notifications requests involves accessing the client so it must be done
    483     // before the frame is detached.
    484     resetNotifications();
    485 #endif
    486 
    487476    HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
    488477    for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
     
    528517    for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
    529518        (*it)->disconnectFrame();
    530 
    531 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    532     // FIXME: Notifications shouldn't have different disconnection logic than
    533     // the rest of the DOMWindowProperties.
    534     // There is currently no way to reconnect them in resumeFromPageCache() so
    535     // they will be broken after returning to a cached page.
    536     // This should be fixed as part of https://bugs.webkit.org/show_bug.cgi?id=79636
    537     resetNotifications();
    538 #endif
    539519}
    540520
     
    572552    m_localStorage = 0;
    573553    m_applicationCache = 0;
    574 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    575     // FIXME: Notifications shouldn't have different disconnection logic than
    576     // the rest of the DOMWindowProperties.
    577     resetNotifications();
    578 #endif
    579554#if ENABLE(BLOB)
    580555    m_domURL = 0;
     
    784759    return m_localStorage.get();
    785760}
    786 
    787 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    788 NotificationCenter* DOMWindow::webkitNotifications() const
    789 {
    790     if (!isCurrentlyDisplayedInFrame())
    791         return 0;
    792     if (m_notifications)
    793         return m_notifications.get();
    794 
    795     Document* document = this->document();
    796     if (!document)
    797         return 0;
    798    
    799     Page* page = document->page();
    800     if (!page)
    801         return 0;
    802 
    803     NotificationClient* provider = NotificationController::clientFrom(page);
    804     if (provider)
    805         m_notifications = NotificationCenter::create(document, provider);   
    806      
    807     return m_notifications.get();
    808 }
    809 
    810 void DOMWindow::resetNotifications()
    811 {
    812     if (!m_notifications)
    813         return;
    814     m_notifications->disconnectFrame();
    815     m_notifications = 0;
    816 }
    817 #endif
    818761
    819762void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
  • trunk/Source/WebCore/page/DOMWindow.h

    r110784 r110994  
    5757    class Navigator;
    5858    class Node;
    59     class NotificationCenter;
    6059    class Page;
    6160    class Performance;
     
    357356        Storage* localStorage(ExceptionCode&) const;
    358357
    359 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    360         NotificationCenter* webkitNotifications() const;
    361         // Renders webkitNotifications object safely inoperable, disconnects
    362         // if from embedder-provided NotificationClient.
    363         void resetNotifications();
    364 #endif
    365 
    366358#if ENABLE(QUOTA)
    367359        StorageInfo* webkitStorageInfo() const;
     
    451443        mutable RefPtr<DOMApplicationCache> m_applicationCache;
    452444
    453 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    454         mutable RefPtr<NotificationCenter> m_notifications;
    455 #endif
    456 
    457445#if ENABLE(WEB_TIMING)
    458446        mutable RefPtr<Performance> m_performance;
  • trunk/Source/WebCore/page/DOMWindow.idl

    r110784 r110994  
    170170        readonly attribute [V8EnabledAtRuntime] Storage localStorage
    171171            getter raises(DOMException);
    172 
    173 #if (defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS) || (defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS)
    174         readonly attribute [V8EnabledAtRuntime] NotificationCenter webkitNotifications;
    175 #endif
    176172
    177173#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
  • trunk/Source/WebCore/page/Frame.cpp

    r110784 r110994  
    688688        parent->loader()->checkLoadComplete();
    689689
    690 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    691     if (m_domWindow)
    692         m_domWindow->resetNotifications();
    693 #endif
    694 
    695690    HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
    696691    for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
     
    735730
    736731             m_page->decrementFrameCount();
    737         }
    738 
    739         if (m_domWindow) {
    740 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    741             m_domWindow->resetNotifications();
    742 #endif
    743732        }
    744733
Note: See TracChangeset for help on using the changeset viewer.