Changeset 105569 in webkit


Ignore:
Timestamp:
Jan 20, 2012 10:06:50 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Switch indexeddb to use supplemental IDL for DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=76723

Patch by Mark Pilgrim <pilgrim@chromium.org> on 2012-01-20
Reviewed by Adam Barth.

No new tests required, all existing tests pass.

  • Modules/indexeddb: Added.
  • Modules/indexeddb/DOMWindowIndexedDatabase.cpp: Added. webkitIndexedDB() method previously in DOMWindow.cpp

(WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
(WebCore::DOMWindowIndexedDatabase::~DOMWindowIndexedDatabase):
(WebCore::DOMWindowIndexedDatabase::webkitIndexedDB):

  • Modules/indexeddb/DOMWindowIndexedDatabase.h: Added.
  • Modules/indexeddb/DOMWindowIndexedDatabase.idl: Added. attributes previously in DOMWindow.idl
  • WebCore.gyp/WebCore.gyp: add Modules/indexeddb/ directory
  • WebCore.gypi: add Modules/indexeddb/*
  • page/DOMWindow.cpp: remove webkitIndexedDB() method, add accessor methods for m_idbFactory

(WebCore::DOMWindow::getIDBFactory):
(WebCore::DOMWindow::setIDBFactory):

  • page/DOMWindow.h:
  • page/DOMWindow.idl:
Location:
trunk/Source/WebCore
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r105568 r105569  
     12012-01-20  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        Switch indexeddb to use supplemental IDL for DOMWindow
     4        https://bugs.webkit.org/show_bug.cgi?id=76723
     5
     6        Reviewed by Adam Barth.
     7
     8        No new tests required, all existing tests pass.
     9
     10        * Modules/indexeddb: Added.
     11        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp: Added. webkitIndexedDB() method previously in DOMWindow.cpp
     12        (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
     13        (WebCore::DOMWindowIndexedDatabase::~DOMWindowIndexedDatabase):
     14        (WebCore::DOMWindowIndexedDatabase::webkitIndexedDB):
     15        * Modules/indexeddb/DOMWindowIndexedDatabase.h: Added.
     16        * Modules/indexeddb/DOMWindowIndexedDatabase.idl: Added. attributes previously in DOMWindow.idl
     17        * WebCore.gyp/WebCore.gyp: add Modules/indexeddb/ directory
     18        * WebCore.gypi: add Modules/indexeddb/*
     19        * page/DOMWindow.cpp: remove webkitIndexedDB() method, add accessor methods for m_idbFactory
     20        (WebCore::DOMWindow::getIDBFactory):
     21        (WebCore::DOMWindow::setIDBFactory):
     22        * page/DOMWindow.h:
     23        * page/DOMWindow.idl:
     24
    1252012-01-20  David Levin  <levin@chromium.org>
    226
  • trunk/Source/WebCore/WebCore.gyp/WebCore.gyp

    r105428 r105569  
    5454      '../Modules/gamepad',
    5555      '../Modules/intents',
     56      '../Modules/indexeddb',
    5657      '../accessibility',
    5758      '../accessibility/chromium',
  • trunk/Source/WebCore/WebCore.gypi

    r105514 r105569  
    11491149            'Modules/gamepad/GamepadList.idl',
    11501150            'Modules/gamepad/NavigatorGamepad.idl',
     1151            'Modules/indexeddb/DOMWindowIndexedDatabase.idl',
    11511152            'Modules/intents/DOMWindowIntents.idl',
    11521153            'Modules/intents/Intent.idl',
     
    17021703            'Modules/gamepad/NavigatorGamepad.cpp',
    17031704            'Modules/gamepad/NavigatorGamepad.h',
     1705            'Modules/indexeddb/DOMWindowIndexedDatabase.cpp',
     1706            'Modules/indexeddb/DOMWindowIndexedDatabase.h',
    17041707            'Modules/intents/Intent.cpp',
    17051708            'Modules/intents/Intent.h',
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r105554 r105569  
    751751
    752752#if ENABLE(INDEXED_DATABASE)
    753 IDBFactory* DOMWindow::webkitIndexedDB() const
    754 {
    755     Document* document = this->document();
    756     if (!document)
    757         return 0;
    758 
    759     Page* page = document->page();
    760     if (!page)
    761         return 0;
    762 
    763     if (!document->securityOrigin()->canAccessDatabase())
    764         return 0;
    765 
    766     if (!m_idbFactory && isCurrentlyDisplayedInFrame())
    767         m_idbFactory = IDBFactory::create(page->group().idbFactory());
    768     return m_idbFactory.get();
     753void DOMWindow::setIDBFactory(PassRefPtr<IDBFactory> idbFactory)
     754{
     755    m_idbFactory = idbFactory;
    769756}
    770757#endif
  • trunk/Source/WebCore/page/DOMWindow.h

    r105531 r105569  
    373373#endif
    374374
    375 #if ENABLE(INDEXED_DATABASE)
    376         IDBFactory* webkitIndexedDB() const;
    377 #endif
    378 
    379375#if ENABLE(NOTIFICATIONS)
    380376        NotificationCenter* webkitNotifications() const;
     
    416412        // by the document that is currently active in m_frame.
    417413        bool isCurrentlyDisplayedInFrame() const;
     414
     415#if ENABLE(INDEXED_DATABASE)
     416        IDBFactory* idbFactory() { return m_idbFactory.get(); }
     417        void setIDBFactory(PassRefPtr<IDBFactory>);
     418#endif
    418419
    419420    private:
  • trunk/Source/WebCore/page/DOMWindow.idl

    r105514 r105569  
    172172#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
    173173        readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications;
    174 #endif
    175 #if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE
    176         readonly attribute IDBFactory webkitIndexedDB;
    177 
    178         attribute IDBCursorConstructor webkitIDBCursor;
    179         attribute IDBDatabaseConstructor webkitIDBDatabase;
    180         attribute IDBDatabaseErrorConstructor webkitIDBDatabaseError;
    181         attribute IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
    182         attribute IDBFactoryConstructor webkitIDBFactory;
    183         attribute IDBIndexConstructor webkitIDBIndex;
    184         attribute IDBKeyRangeConstructor webkitIDBKeyRange;
    185         attribute IDBObjectStoreConstructor webkitIDBObjectStore;
    186         attribute IDBRequestConstructor webkitIDBRequest;
    187         attribute IDBTransactionConstructor webkitIDBTransaction;
    188174#endif
    189175#if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM
Note: See TracChangeset for help on using the changeset viewer.