Changeset 111832 in webkit


Ignore:
Timestamp:
Mar 22, 2012 11:29:16 PM (12 years ago)
Author:
abarth@webkit.org
Message:

Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=82015

Reviewed by Kentaro Hara.

This patch moves DOMWindow.webkitNotifications from DOMWindow.idl to
DOMWindowNotificiations.idl in preparation for moving notificiations
into Modules.

A future patch will remove DOMWindow::resetNotificaitions in favor of
more general mechanisms.

  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • notifications/DOMWindowNotifications.cpp: Added.

(WebCore):
(WebCore::DOMWindowNotifications::DOMWindowNotifications):
(WebCore::DOMWindowNotifications::~DOMWindowNotifications):
(WebCore::DOMWindowNotifications::from):
(WebCore::DOMWindowNotifications::webkitNotifications):
(WebCore::DOMWindowNotifications::reset):
(WebCore::DOMWindowNotifications::supplementName):

  • notifications/DOMWindowNotifications.h: Added.

(WebCore):
(DOMWindowNotifications):

  • notifications/DOMWindowNotifications.idl: Added.
  • page/DOMWindow.cpp:

(WebCore::DOMWindow::~DOMWindow):
(WebCore):
(WebCore::DOMWindow::resetNotifications):

  • page/DOMWindow.h:

(WebCore):
(DOMWindow):

  • page/DOMWindow.idl:
Location:
trunk/Source/WebCore
Files:
3 added
12 edited

Legend:

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

    r111799 r111832  
    16261626IF (ENABLE_NOTIFICATIONS)
    16271627    LIST(APPEND WebCore_SOURCES
     1628        notifications/DOMWindowNotifications.cpp
    16281629        notifications/NotificationCenter.cpp
    16291630        notifications/NotificationController.cpp
     
    16321633
    16331634    LIST(APPEND WebCore_IDL_FILES
     1635        notifications/DOMWindowNotifications.idl
    16341636        notifications/Notification.idl
    16351637        notifications/NotificationCenter.idl
  • trunk/Source/WebCore/ChangeLog

    r111829 r111832  
     12012-03-22  Adam Barth  <abarth@webkit.org>
     2
     3        Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl (Part 1)
     4        https://bugs.webkit.org/show_bug.cgi?id=82015
     5
     6        Reviewed by Kentaro Hara.
     7
     8        This patch moves DOMWindow.webkitNotifications from DOMWindow.idl to
     9        DOMWindowNotificiations.idl in preparation for moving notificiations
     10        into Modules.
     11
     12        A future patch will remove DOMWindow::resetNotificaitions in favor of
     13        more general mechanisms.
     14
     15        * CMakeLists.txt:
     16        * DerivedSources.make:
     17        * DerivedSources.pri:
     18        * GNUmakefile.list.am:
     19        * Target.pri:
     20        * WebCore.gypi:
     21        * WebCore.vcproj/WebCore.vcproj:
     22        * WebCore.xcodeproj/project.pbxproj:
     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::reset):
     30        (WebCore::DOMWindowNotifications::supplementName):
     31        * notifications/DOMWindowNotifications.h: Added.
     32        (WebCore):
     33        (DOMWindowNotifications):
     34        * notifications/DOMWindowNotifications.idl: Added.
     35        * page/DOMWindow.cpp:
     36        (WebCore::DOMWindow::~DOMWindow):
     37        (WebCore):
     38        (WebCore::DOMWindow::resetNotifications):
     39        * page/DOMWindow.h:
     40        (WebCore):
     41        (DOMWindow):
     42        * page/DOMWindow.idl:
     43
    1442012-03-22  Li Yin  <li.yin@intel.com>
    245
  • trunk/Source/WebCore/DerivedSources.make

    r111474 r111832  
    384384    $(WebCore)/inspector/ScriptProfileNode.idl \
    385385    $(WebCore)/loader/appcache/DOMApplicationCache.idl \
     386    $(WebCore)/notifications/DOMWindowNotifications.idl \
    386387    $(WebCore)/notifications/Notification.idl \
    387388    $(WebCore)/notifications/NotificationCenter.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r111474 r111832  
    397397    $$PWD/inspector/ScriptProfileNode.idl \
    398398    $$PWD/loader/appcache/DOMApplicationCache.idl \
     399    $$PWD/notifications/DOMWindowNotifications.idl \
    399400    $$PWD/notifications/Notification.idl \
    400401    $$PWD/notifications/NotificationCenter.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r111733 r111832  
    28342834        Source/WebCore/mathml/MathMLTextElement.cpp \
    28352835        Source/WebCore/mathml/MathMLTextElement.h \
     2836        Source/WebCore/notifications/DOMWindowNotifications.cpp \
     2837        Source/WebCore/notifications/DOMWindowNotifications.h \
    28362838        Source/WebCore/notifications/NotificationCenter.cpp \
    28372839        Source/WebCore/notifications/NotificationCenter.h \
  • trunk/Source/WebCore/Target.pri

    r111780 r111832  
    981981    loader/TextResourceDecoder.cpp \
    982982    loader/ThreadableLoader.cpp \
     983    notifications/DOMWindowNotifications.cpp \
    983984    notifications/Notification.cpp \
    984985    notifications/NotificationCenter.cpp \
     
    20812082    mathml/MathMLMathElement.h \
    20822083    mathml/MathMLTextElement.h \
     2084    notifications/DOMWindowNotifications.h \
    20832085    notifications/Notification.h \
    20842086    notifications/NotificationCenter.h \
  • trunk/Source/WebCore/WebCore.gypi

    r111733 r111832  
    10961096            'inspector/ScriptProfileNode.idl',
    10971097            'loader/appcache/DOMApplicationCache.idl',
     1098            'notifications/DOMWindowNotifications.idl',
    10981099            'notifications/Notification.idl',
    10991100            'notifications/NotificationCenter.idl',
     
    28822883            'mathml/MathMLTextElement.cpp',
    28832884            'mathml/MathMLTextElement.h',
     2885            'notifications/DOMWindowNotifications.cpp',
     2886            'notifications/DOMWindowNotifications.h',
    28842887            'notifications/Notification.cpp',
    28852888            'notifications/Notification.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r111733 r111832  
    5392353923                        >
    5392453924                        <File
     53925                                RelativePath="..\notifications\DOMWindowNotifications.cpp"
     53926                                >
     53927                        </File>
     53928                        <File
     53929                                RelativePath="..\notifications\DOMWindowNotifications.h"
     53930                                >
     53931                        </File>
     53932                        <File
    5392553933                                RelativePath="..\notifications\Notification.cpp"
    5392653934                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r111827 r111832  
    35083508                97B1F02E13B025CA00F5103F /* SharedBufferChunkReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37569E0013AF172C00CDBA8E /* SharedBufferChunkReader.cpp */; };
    35093509                97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 37569E0213AF172C00CDBA8E /* SharedBufferChunkReader.h */; };
     3510                97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97B38E24151C4264004622E9 /* DOMWindowNotifications.h */; };
     3511                97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */; };
    35103512                97BC69DA1505F076001B74AC /* AbstractDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97BC69D61505F076001B74AC /* AbstractDatabase.cpp */; };
    35113513                97BC69DB1505F076001B74AC /* AbstractDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 97BC69D71505F076001B74AC /* AbstractDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1047310475                97AABD1114FA09D5007457AE /* WorkerThreadableWebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerThreadableWebSocketChannel.cpp; path = Modules/websockets/WorkerThreadableWebSocketChannel.cpp; sourceTree = "<group>"; };
    1047410476                97AABD1214FA09D5007457AE /* WorkerThreadableWebSocketChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerThreadableWebSocketChannel.h; path = Modules/websockets/WorkerThreadableWebSocketChannel.h; sourceTree = "<group>"; };
     10477                97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMWindowNotifications.cpp; path = notifications/DOMWindowNotifications.cpp; sourceTree = "<group>"; };
     10478                97B38E24151C4264004622E9 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMWindowNotifications.h; path = notifications/DOMWindowNotifications.h; sourceTree = "<group>"; };
     10479                97B38E25151C4264004622E9 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DOMWindowNotifications.idl; path = notifications/DOMWindowNotifications.idl; sourceTree = "<group>"; };
    1047510480                97BC69D61505F076001B74AC /* AbstractDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AbstractDatabase.cpp; path = Modules/webdatabase/AbstractDatabase.cpp; sourceTree = "<group>"; };
    1047610481                97BC69D71505F076001B74AC /* AbstractDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AbstractDatabase.h; path = Modules/webdatabase/AbstractDatabase.h; sourceTree = "<group>"; };
     
    1441914424                        isa = PBXGroup;
    1442014425                        children = (
     14426                                97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */,
     14427                                97B38E24151C4264004622E9 /* DOMWindowNotifications.h */,
     14428                                97B38E25151C4264004622E9 /* DOMWindowNotifications.idl */,
    1442114429                                33503CC61017A1B1003B47E1 /* Notification.cpp */,
    1442214430                                333F704F0FB49CA2008E12A6 /* Notification.h */,
     
    2245022458                                1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
    2245122459                                9712A5AE15004EDA0048AF10 /* DOMWindowIndexedDatabase.h in Headers */,
     22460                                97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
    2245222461                                97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
    2245322462                                97BC6A351505F081001B74AC /* DOMWindowSQLDatabase.h in Headers */,
     
    2560125610                                1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
    2560225611                                9712A5AD15004EDA0048AF10 /* DOMWindowIndexedDatabase.cpp in Sources */,
     25612                                97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */,
    2560325613                                97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */,
    2560425614                                97BC6A341505F081001B74AC /* DOMWindowSQLDatabase.cpp in Sources */,
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r111243 r111832  
    4646#include "DOMTokenList.h"
    4747#include "DOMURL.h"
     48#include "DOMWindowNotifications.h"
    4849#include "Database.h"
    4950#include "DatabaseCallback.h"
     
    7374#include "MessageEvent.h"
    7475#include "Navigator.h"
    75 #include "NotificationCenter.h"
    76 #include "NotificationController.h"
    7776#include "Page.h"
    7877#include "PageGroup.h"
     
    419418        ASSERT(!m_localStorage);
    420419        ASSERT(!m_applicationCache);
    421 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    422         ASSERT(!m_notifications);
    423 #endif
    424420#if ENABLE(BLOB)
    425421        ASSERT(!m_domURL);
     
    786782
    787783#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 
    810784void DOMWindow::resetNotifications()
    811785{
    812     if (!m_notifications)
    813         return;
    814     m_notifications->disconnectFrame();
    815     m_notifications = 0;
     786    DOMWindowNotifications::reset(this);
    816787}
    817788#endif
  • trunk/Source/WebCore/page/DOMWindow.h

    r111141 r111832  
    5757    class Navigator;
    5858    class Node;
    59     class NotificationCenter;
    6059    class Page;
    6160    class Performance;
     
    358357
    359358#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    360         NotificationCenter* webkitNotifications() const;
    361         // Renders webkitNotifications object safely inoperable, disconnects
    362         // if from embedder-provided NotificationClient.
    363359        void resetNotifications();
    364360#endif
     
    451447        mutable RefPtr<DOMApplicationCache> m_applicationCache;
    452448
    453 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    454         mutable RefPtr<NotificationCenter> m_notifications;
    455 #endif
    456 
    457449#if ENABLE(WEB_TIMING)
    458450        mutable RefPtr<Performance> m_performance;
  • trunk/Source/WebCore/page/DOMWindow.idl

    r111141 r111832  
    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
Note: See TracChangeset for help on using the changeset viewer.