Changeset 109556 in webkit


Ignore:
Timestamp:
Mar 2, 2012 4:45:46 AM (12 years ago)
Author:
abarth@webkit.org
Message:

WorkerContext shouldn't know about IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=80094

Reviewed by Kentaro Hara.

There are still a couple IndexedDB stragglers we should clean up in
WebCore proper. This patch moves some IndexedDB logic from
WorkerContext into the indexeddb module.

In the process of writing this patch, I noticed that some IndexedDB
files were missing from various build systems, so I added them. I
suspect that means IndexedDB is only enabled by default on Chromium.

  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • Modules/indexeddb/WorkerContextIndexedDatabase.cpp: Added.

(WebCore):
(WebCore::WorkerContextIndexedDatabase::WorkerContextIndexedDatabase):
(WebCore::WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase):
(WebCore::WorkerContextIndexedDatabase::from):
(WebCore::WorkerContextIndexedDatabase::webkitIndexedDB):

  • Modules/indexeddb/WorkerContextIndexedDatabase.h: Added.

(WebCore):
(WorkerContextIndexedDatabase):

  • Modules/indexeddb/WorkerContextIndexedDatabase.idl: Added.
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • workers/WorkerContext.cpp:

(WebCore):

  • workers/WorkerContext.h:

(WebCore):
(WorkerContext):

  • workers/WorkerContext.idl:
Location:
trunk/Source/WebCore
Files:
3 added
12 edited

Legend:

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

    r109538 r109556  
    416416    Modules/geolocation/NavigatorGeolocation.cpp
    417417
     418    Modules/indexeddb/DOMWindowIndexedDatabase.cpp
    418419    Modules/indexeddb/IDBAny.cpp
    419420    Modules/indexeddb/IDBDatabase.cpp
     
    433434    Modules/indexeddb/IDBFactoryBackendInterface.cpp
    434435    Modules/indexeddb/IDBFactoryBackendImpl.cpp
     436    Modules/indexeddb/PageGroupIndexedDatabase.cpp
     437    Modules/indexeddb/WorkerContextIndexedDatabase.cpp
    435438
    436439    accessibility/AXObjectCache.cpp
     
    15401543IF (ENABLE_INDEXED_DATABASE)
    15411544    LIST(APPEND WebCore_IDL_FILES
     1545        Modules/indexeddb/DOMWindowIndexedDatabase.idl
    15421546        Modules/indexeddb/IDBAny.idl
    15431547        Modules/indexeddb/IDBCursor.idl
     
    15521556        Modules/indexeddb/IDBRequest.idl
    15531557        Modules/indexeddb/IDBTransaction.idl
     1558        Modules/indexeddb/WorkerContextIndexedDatabase.idl
    15541559    )
    15551560ENDIF ()
  • trunk/Source/WebCore/ChangeLog

    r109552 r109556  
     12012-03-02  Adam Barth  <abarth@webkit.org>
     2
     3        WorkerContext shouldn't know about IndexedDB
     4        https://bugs.webkit.org/show_bug.cgi?id=80094
     5
     6        Reviewed by Kentaro Hara.
     7
     8        There are still a couple IndexedDB stragglers we should clean up in
     9        WebCore proper.  This patch moves some IndexedDB logic from
     10        WorkerContext into the indexeddb module.
     11
     12        In the process of writing this patch, I noticed that some IndexedDB
     13        files were missing from various build systems, so I added them.  I
     14        suspect that means IndexedDB is only enabled by default on Chromium.
     15
     16        * CMakeLists.txt:
     17        * DerivedSources.make:
     18        * DerivedSources.pri:
     19        * GNUmakefile.list.am:
     20        * Modules/indexeddb/WorkerContextIndexedDatabase.cpp: Added.
     21        (WebCore):
     22        (WebCore::WorkerContextIndexedDatabase::WorkerContextIndexedDatabase):
     23        (WebCore::WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase):
     24        (WebCore::WorkerContextIndexedDatabase::from):
     25        (WebCore::WorkerContextIndexedDatabase::webkitIndexedDB):
     26        * Modules/indexeddb/WorkerContextIndexedDatabase.h: Added.
     27        (WebCore):
     28        (WorkerContextIndexedDatabase):
     29        * Modules/indexeddb/WorkerContextIndexedDatabase.idl: Added.
     30        * Target.pri:
     31        * WebCore.gypi:
     32        * WebCore.vcproj/WebCore.vcproj:
     33        * WebCore.xcodeproj/project.pbxproj:
     34        * workers/WorkerContext.cpp:
     35        (WebCore):
     36        * workers/WorkerContext.h:
     37        (WebCore):
     38        (WorkerContext):
     39        * workers/WorkerContext.idl:
     40
    1412012-03-02  Simon Hausmann  <simon.hausmann@nokia.com>
    242
  • trunk/Source/WebCore/DerivedSources.make

    r109493 r109556  
    6363    $(WebCore)/Modules/geolocation/PositionError.idl \
    6464    $(WebCore)/Modules/geolocation/PositionErrorCallback.idl \
     65    $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
    6566    $(WebCore)/Modules/indexeddb/IDBAny.idl \
    6667    $(WebCore)/Modules/indexeddb/IDBCursor.idl \
     
    7576    $(WebCore)/Modules/indexeddb/IDBRequest.idl \
    7677    $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
     78    $(WebCore)/Modules/indexeddb/WorkerContextIndexedDatabase.idl \
    7779    $(WebCore)/Modules/websockets/CloseEvent.idl \
    7880    $(WebCore)/Modules/websockets/DOMWindowWebSocket.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r109493 r109556  
    9393    $$PWD/Modules/geolocation/PositionError.idl \
    9494    $$PWD/Modules/geolocation/PositionErrorCallback.idl \
     95    $$PWD/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
    9596    $$PWD/Modules/indexeddb/IDBAny.idl \
    9697    $$PWD/Modules/indexeddb/IDBCursor.idl \
     
    105106    $$PWD/Modules/indexeddb/IDBRequest.idl \
    106107    $$PWD/Modules/indexeddb/IDBTransaction.idl \
     108    $$PWD/Modules/indexeddb/WorkerContextIndexedDatabase.idl \
    107109    $$PWD/Modules/websockets/CloseEvent.idl \
    108110    $$PWD/Modules/websockets/DOMWindowWebSocket.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r109538 r109556  
    971971        Source/WebCore/Modules/geolocation/PositionErrorCallback.h \
    972972        Source/WebCore/Modules/geolocation/PositionOptions.h \
     973        Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp \
     974        Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h \
    973975        Source/WebCore/Modules/indexeddb/IDBAny.cpp \
    974976        Source/WebCore/Modules/indexeddb/IDBAny.h \
     
    10271029        Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h \
    10281030        Source/WebCore/Modules/indexeddb/IDBVersionChangeRequest.h \
     1031        Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp \
     1032        Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h \
     1033        Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp \
     1034        Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h \
    10291035        Source/WebCore/Modules/mediastream/LocalMediaStream.cpp \
    10301036        Source/WebCore/Modules/mediastream/LocalMediaStream.h \
     
    47914797
    47924798dom_binding_idls += \
     4799        $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
    47934800        $(WebCore)/Modules/indexeddb/IDBAny.idl \
    47944801        $(WebCore)/Modules/indexeddb/IDBDatabase.idl \
     
    48004807        $(WebCore)/Modules/indexeddb/IDBObjectStore.idl \
    48014808        $(WebCore)/Modules/indexeddb/IDBRequest.idl \
    4802         $(WebCore)/Modules/indexeddb/IDBTransaction.idl
     4809        $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
     4810        $(WebCore)/Modules/indexeddb/WorkerContextIndexedDatabase.idl
    48034811endif # END ENABLE_INDEXED_DATABASE
    48044812
  • trunk/Source/WebCore/Target.pri

    r109552 r109556  
    30153015
    30163016    SOURCES += \
     3017        Modules/indexeddb/DOMWindowIndexedDatabase.cpp \
    30173018        Modules/indexeddb/IDBAny.cpp \
    30183019        Modules/indexeddb/IDBCursor.cpp \
     
    30323033        Modules/indexeddb/IDBObjectStoreBackendImpl.cpp \
    30333034        Modules/indexeddb/IDBRequest.cpp \
    3034         Modules/indexeddb/IDBTransaction.cpp
     3035        Modules/indexeddb/IDBTransaction.cpp \
     3036        Modules/indexeddb/PageGroupIndexedDatabase.cpp \
     3037        Modules/indexeddb/WorkerContextIndexedDatabase.cpp
    30353038}
    30363039
  • trunk/Source/WebCore/WebCore.gypi

    r109538 r109556  
    746746            'Modules/indexeddb/IDBVersionChangeEvent.idl',
    747747            'Modules/indexeddb/IDBVersionChangeRequest.idl',
     748            'Modules/indexeddb/WorkerContextIndexedDatabase.idl',
    748749            'Modules/intents/DOMWindowIntents.idl',
    749750            'Modules/intents/Intent.idl',
     
    13691370            'Modules/indexeddb/PageGroupIndexedDatabase.cpp',
    13701371            'Modules/indexeddb/PageGroupIndexedDatabase.h',
     1372            'Modules/indexeddb/WorkerContextIndexedDatabase.cpp',
     1373            'Modules/indexeddb/WorkerContextIndexedDatabase.h',
    13711374            'Modules/intents/Intent.cpp',
    13721375            'Modules/intents/Intent.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r109538 r109556  
    2411424114                                >
    2411524115                                <File
     24116                                        RelativePath="..\Modules\indexeddb\DOMWindowIndexedDatabase.cpp"
     24117                                        >
     24118                                </File>
     24119                                <File
     24120                                        RelativePath="..\Modules\indexeddb\DOMWindowIndexedDatabase.h"
     24121                                        >
     24122                                </File>
     24123                                <File
    2411624124                                        RelativePath="..\Modules\indexeddb\IDBAny.cpp"
    2411724125                                        >
     
    2426724275                                <File
    2426824276                                        RelativePath="..\Modules\indexeddb\IDBTransaction.h"
     24277                                        >
     24278                                </File>
     24279                                <File
     24280                                        RelativePath="..\Modules\indexeddb\PageGroupIndexedDatabase.cpp"
     24281                                        >
     24282                                </File>
     24283                                <File
     24284                                        RelativePath="..\Modules\indexeddb\PageGroupIndexedDatabase.h"
     24285                                        >
     24286                                </File>
     24287                                <File
     24288                                        RelativePath="..\Modules\indexeddb\WorkerContextIndexedDatabase.cpp"
     24289                                        >
     24290                                </File>
     24291                                <File
     24292                                        RelativePath="..\Modules\indexeddb\WorkerContextIndexedDatabase.h"
    2426924293                                        >
    2427024294                                </File>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r109538 r109556  
    33763376                9712A60415004EDA0048AF10 /* PageGroupIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A5AB15004EDA0048AF10 /* PageGroupIndexedDatabase.cpp */; };
    33773377                9712A60515004EDA0048AF10 /* PageGroupIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A5AC15004EDA0048AF10 /* PageGroupIndexedDatabase.h */; };
     3378                9712A611150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9712A60E150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp */; };
     3379                9712A612150090CE0048AF10 /* WorkerContextIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9712A60F150090CE0048AF10 /* WorkerContextIndexedDatabase.h */; };
    33783380                97205AAF123928CA00B17380 /* FTPDirectoryDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */; };
    33793381                97205AB0123928CA00B17380 /* FTPDirectoryDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */; };
     
    1029510297                9712A5AB15004EDA0048AF10 /* PageGroupIndexedDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PageGroupIndexedDatabase.cpp; path = Modules/indexeddb/PageGroupIndexedDatabase.cpp; sourceTree = "<group>"; };
    1029610298                9712A5AC15004EDA0048AF10 /* PageGroupIndexedDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PageGroupIndexedDatabase.h; path = Modules/indexeddb/PageGroupIndexedDatabase.h; sourceTree = "<group>"; };
     10299                9712A60E150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerContextIndexedDatabase.cpp; path = Modules/indexeddb/WorkerContextIndexedDatabase.cpp; sourceTree = "<group>"; };
     10300                9712A60F150090CE0048AF10 /* WorkerContextIndexedDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerContextIndexedDatabase.h; path = Modules/indexeddb/WorkerContextIndexedDatabase.h; sourceTree = "<group>"; };
     10301                9712A610150090CE0048AF10 /* WorkerContextIndexedDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WorkerContextIndexedDatabase.idl; path = Modules/indexeddb/WorkerContextIndexedDatabase.idl; sourceTree = "<group>"; };
    1029710302                97205AAD123928CA00B17380 /* FTPDirectoryDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FTPDirectoryDocument.cpp; sourceTree = "<group>"; };
    1029810303                97205AAE123928CA00B17380 /* FTPDirectoryDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTPDirectoryDocument.h; sourceTree = "<group>"; };
     
    1720617211                                9712A5AB15004EDA0048AF10 /* PageGroupIndexedDatabase.cpp */,
    1720717212                                9712A5AC15004EDA0048AF10 /* PageGroupIndexedDatabase.h */,
     17213                                9712A60E150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp */,
     17214                                9712A60F150090CE0048AF10 /* WorkerContextIndexedDatabase.h */,
     17215                                9712A610150090CE0048AF10 /* WorkerContextIndexedDatabase.idl */,
    1720817216                        );
    1720917217                        name = indexeddb;
     
    2444324451                                F3820897147D35F90010BC06 /* WorkerConsoleAgent.h in Headers */,
    2444424452                                2E4346490F546A8200B0F1BA /* WorkerContext.h in Headers */,
     24453                                9712A612150090CE0048AF10 /* WorkerContextIndexedDatabase.h in Headers */,
    2444524454                                2E43464B0F546A8200B0F1BA /* WorkerContextProxy.h in Headers */,
    2444624455                                F34742E11343631F00531BC2 /* WorkerDebuggerAgent.h in Headers */,
     
    2741827427                                F3820896147D35F90010BC06 /* WorkerConsoleAgent.cpp in Sources */,
    2741927428                                2E4346480F546A8200B0F1BA /* WorkerContext.cpp in Sources */,
     27429                                9712A611150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp in Sources */,
    2742027430                                F34742E01343631F00531BC2 /* WorkerDebuggerAgent.cpp in Sources */,
    2742127431                                A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */,
  • trunk/Source/WebCore/workers/WorkerContext.cpp

    r109133 r109556  
    7070
    7171#include "ExceptionCode.h"
    72 #include "IDBFactory.h"
    7372
    7473namespace WebCore {
     
    408407}
    409408
    410 #if ENABLE(INDEXED_DATABASE)
    411 IDBFactory* WorkerContext::webkitIndexedDB() const
    412 {
    413     if (!securityOrigin()->canAccessDatabase())
    414         return 0;
    415     if (!m_idbFactoryBackendInterface)
    416         m_idbFactoryBackendInterface = IDBFactoryBackendInterface::create();
    417     if (!m_idbFactory)
    418         m_idbFactory = IDBFactory::create(m_idbFactoryBackendInterface.get());
    419     return m_idbFactory.get();
    420 }
    421 #endif
    422 
    423409WorkerEventQueue* WorkerContext::eventQueue() const
    424410{
  • trunk/Source/WebCore/workers/WorkerContext.h

    r109133 r109556  
    5252    class DatabaseCallback;
    5353    class DatabaseSync;
    54     class IDBFactory;
    5554    class NotificationCenter;
    5655    class ScheduledAction;
     
    155154        void unregisterObserver(Observer*);
    156155        void notifyObserversOfStop();
    157 #if ENABLE(INDEXED_DATABASE)
    158         IDBFactory* webkitIndexedDB() const;
    159 #endif
    160156
    161157    protected:
     
    205201
    206202        OwnPtr<WorkerEventQueue> m_eventQueue;
    207 
    208 #if ENABLE(INDEXED_DATABASE)
    209         mutable RefPtr<IDBFactory> m_idbFactory;
    210         mutable RefPtr<IDBFactoryBackendInterface> m_idbFactoryBackendInterface;
    211 #endif
    212 
    213203    };
    214204
  • trunk/Source/WebCore/workers/WorkerContext.idl

    r109133 r109556  
    116116        attribute Float64ArrayConstructor Float64Array; // Usable with new operator
    117117        attribute DataViewConstructor DataView; // Usable with new operator
    118 #if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE
    119         readonly attribute [V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
    120 
    121         attribute [V8EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor;
    122         attribute [V8EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase;
    123         attribute [V8EnabledAtRuntime] IDBDatabaseErrorConstructor webkitIDBDatabaseError;
    124         attribute [V8EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
    125         attribute [V8EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory;
    126         attribute [V8EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex;
    127         attribute [V8EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange;
    128         attribute [V8EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore;
    129         attribute [V8EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest;
    130         attribute [V8EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction;
    131 #endif
    132118    };
    133119
Note: See TracChangeset for help on using the changeset viewer.