Changeset 60776 in webkit


Ignore:
Timestamp:
Jun 7, 2010 5:01:40 AM (14 years ago)
Author:
andreip@google.com
Message:

2010-06-07 Andrei Popescu <andreip@google.com>

Reviewed by Jeremy Orlow.

[indexedDB] It is impossible to create object stores
https://bugs.webkit.org/show_bug.cgi?id=40054

No new tests. Layout tests will be added separately.

  • Android.mk:
  • CMakeLists.txt:
  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/scripts/CodeGeneratorJS.pm:
  • bindings/scripts/CodeGeneratorV8.pm:
  • bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: (webkit_dom_test_obj_with_script_execution_context):
  • bindings/scripts/test/GObject/WebKitDOMTestObj.h:
  • bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
  • bindings/scripts/test/JS/JSTestObj.h:
  • bindings/scripts/test/ObjC/DOMTestObj.h:
  • bindings/scripts/test/ObjC/DOMTestObj.mm: (-[DOMTestObj withScriptExecutionContext]):
  • bindings/scripts/test/TestObj.idl:
  • bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjInternal::withScriptExecutionContextCallback): (WebCore::):
  • page/DOMWindow.cpp: (WebCore::DOMWindow::clear): (WebCore::DOMWindow::indexedDB):
  • storage/IDBCallbacks.h:
  • storage/IDBDatabase.h:
  • storage/IDBDatabaseImpl.cpp: (WebCore::IDBDatabaseImpl::createObjectStore):
  • storage/IDBDatabaseImpl.h:
  • storage/IDBDatabaseRequest.cpp: (WebCore::IDBDatabaseRequest::IDBDatabaseRequest): (WebCore::IDBDatabaseRequest::createObjectStore):
  • storage/IDBDatabaseRequest.h:
  • storage/IDBDatabaseRequest.idl:
  • storage/IDBObjectStore.cpp: Removed.
  • storage/IDBObjectStore.h: (WebCore::IDBObjectStore::~IDBObjectStore):
  • storage/IDBObjectStoreImpl.cpp: Added. (WebCore::IDBObjectStoreImpl::~IDBObjectStoreImpl): (WebCore::IDBObjectStoreImpl::IDBObjectStoreImpl): (WebCore::IDBObjectStoreImpl::indexNames): (WebCore::IDBObjectStoreImpl::createIndex): (WebCore::IDBObjectStoreImpl::index): (WebCore::IDBObjectStoreImpl::removeIndex):
  • storage/IDBObjectStoreImpl.h: Added. (WebCore::IDBObjectStoreImpl::create): (WebCore::IDBObjectStoreImpl::name): (WebCore::IDBObjectStoreImpl::keyPath):
  • storage/IDBObjectStoreRequest.cpp: (WebCore::IDBObjectStoreRequest::IDBObjectStoreRequest):
  • storage/IDBObjectStoreRequest.h: (WebCore::IDBObjectStoreRequest::create):
  • storage/IDBRequest.cpp: (WebCore::IDBRequest::onSuccess):
  • storage/IDBRequest.h:
  • storage/IndexedDatabaseRequest.cpp: (WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest): (WebCore::IndexedDatabaseRequest::open):
  • storage/IndexedDatabaseRequest.h: (WebCore::IndexedDatabaseRequest::create):
  • storage/IndexedDatabaseRequest.idl:

2010-06-07 Andrei Popescu <andreip@google.com>

Reviewed by Jeremy Orlow.

[indexedDB] It is impossible to create object stores
https://bugs.webkit.org/show_bug.cgi?id=40054

  • WebKit.gyp:
  • public/WebIDBCallbacks.h: (WebKit::WebIDBCallbacks::onSuccess):
  • public/WebIDBDatabase.h: (WebKit::WebIDBDatabase::createObjectStore):
  • public/WebIDBObjectStore.h: Added. (WebKit::WebIDBObjectStore::~WebIDBObjectStore): (WebKit::WebIDBObjectStore::name): (WebKit::WebIDBObjectStore::keyPath):
  • src/IDBCallbacksProxy.cpp: (WebCore::IDBCallbacksProxy::onSuccess):
  • src/IDBCallbacksProxy.h:
  • src/IDBDatabaseProxy.cpp: (WebCore::IDBDatabaseProxy::createObjectStore):
  • src/IDBDatabaseProxy.h:
  • src/IDBObjectStoreProxy.cpp: Added. (WebCore::IDBObjectStoreProxy::create): (WebCore::IDBObjectStoreProxy::IDBObjectStoreProxy): (WebCore::IDBObjectStoreProxy::~IDBObjectStoreProxy): (WebCore::IDBObjectStoreProxy::name): (WebCore::IDBObjectStoreProxy::keyPath): (WebCore::IDBObjectStoreProxy::indexNames): (WebCore::IDBObjectStoreProxy::createIndex): (WebCore::IDBObjectStoreProxy::index): (WebCore::IDBObjectStoreProxy::removeIndex):
  • src/IDBObjectStoreProxy.h: Added.
  • src/IndexedDatabaseProxy.cpp: (WebCore::IndexedDatabaseProxy::open):
  • src/WebIDBCallbacksImpl.cpp: (WebCore::WebIDBCallbacksImpl::onSuccess):
  • src/WebIDBCallbacksImpl.h:
  • src/WebIDBDatabaseImpl.cpp: (WebKit::WebIDBDatabaseImpl::createObjectStore):
  • src/WebIDBDatabaseImpl.h:
  • src/WebIDBObjectStoreImpl.cpp: Added. (WebKit::WebIDBObjectStoreImpl::WebIDBObjectStoreImpl): (WebKit::WebIDBObjectStoreImpl::~WebIDBObjectStoreImpl): (WebKit::WebIDBObjectStoreImpl::name): (WebKit::WebIDBObjectStoreImpl::keyPath):
  • src/WebIDBObjectStoreImpl.h: Added.
  • src/WebIndexedDatabaseImpl.cpp: (WebKit::WebIndexedDatabaseImpl::open):
Location:
trunk
Files:
48 edited
6 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/Android.mk

    r60624 r60776  
    717717        storage/IDBIndexImpl.cpp \
    718718        storage/IDBIndexRequest.cpp \
    719         storage/IDBObjectStore.cpp \
     719        storage/IDBObjectStoreImpl.cpp \
    720720        storage/IDBObjectStoreRequest.cpp \
    721721        storage/IDBRequest.cpp \
  • trunk/WebCore/CMakeLists.txt

    r60624 r60776  
    13711371    storage/IDBEvent.cpp
    13721372    storage/IDBRequest.cpp
    1373     storage/IDBObjectStore.cpp
     1373    storage/IDBObjectStoreImpl.cpp
    13741374    storage/IDBObjectStoreRequest.cpp
    13751375    storage/IDBSuccessEvent.cpp
  • trunk/WebCore/ChangeLog

    r60775 r60776  
     12010-06-07  Andrei Popescu  <andreip@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        [indexedDB] It is impossible to create object stores
     6        https://bugs.webkit.org/show_bug.cgi?id=40054
     7
     8        No new tests. Layout tests will be added separately.
     9
     10        * Android.mk:
     11        * CMakeLists.txt:
     12        * GNUmakefile.am:
     13        * WebCore.gypi:
     14        * WebCore.pro:
     15        * WebCore.vcproj/WebCore.vcproj:
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * bindings/scripts/CodeGeneratorJS.pm:
     18        * bindings/scripts/CodeGeneratorV8.pm:
     19        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
     20        (webkit_dom_test_obj_with_script_execution_context):
     21        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
     22        * bindings/scripts/test/JS/JSTestObj.cpp:
     23        (WebCore::):
     24        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
     25        * bindings/scripts/test/JS/JSTestObj.h:
     26        * bindings/scripts/test/ObjC/DOMTestObj.h:
     27        * bindings/scripts/test/ObjC/DOMTestObj.mm:
     28        (-[DOMTestObj withScriptExecutionContext]):
     29        * bindings/scripts/test/TestObj.idl:
     30        * bindings/scripts/test/V8/V8TestObj.cpp:
     31        (WebCore::TestObjInternal::withScriptExecutionContextCallback):
     32        (WebCore::):
     33        * page/DOMWindow.cpp:
     34        (WebCore::DOMWindow::clear):
     35        (WebCore::DOMWindow::indexedDB):
     36        * storage/IDBCallbacks.h:
     37        * storage/IDBDatabase.h:
     38        * storage/IDBDatabaseImpl.cpp:
     39        (WebCore::IDBDatabaseImpl::createObjectStore):
     40        * storage/IDBDatabaseImpl.h:
     41        * storage/IDBDatabaseRequest.cpp:
     42        (WebCore::IDBDatabaseRequest::IDBDatabaseRequest):
     43        (WebCore::IDBDatabaseRequest::createObjectStore):
     44        * storage/IDBDatabaseRequest.h:
     45        * storage/IDBDatabaseRequest.idl:
     46        * storage/IDBObjectStore.cpp: Removed.
     47        * storage/IDBObjectStore.h:
     48        (WebCore::IDBObjectStore::~IDBObjectStore):
     49        * storage/IDBObjectStoreImpl.cpp: Added.
     50        (WebCore::IDBObjectStoreImpl::~IDBObjectStoreImpl):
     51        (WebCore::IDBObjectStoreImpl::IDBObjectStoreImpl):
     52        (WebCore::IDBObjectStoreImpl::indexNames):
     53        (WebCore::IDBObjectStoreImpl::createIndex):
     54        (WebCore::IDBObjectStoreImpl::index):
     55        (WebCore::IDBObjectStoreImpl::removeIndex):
     56        * storage/IDBObjectStoreImpl.h: Added.
     57        (WebCore::IDBObjectStoreImpl::create):
     58        (WebCore::IDBObjectStoreImpl::name):
     59        (WebCore::IDBObjectStoreImpl::keyPath):
     60        * storage/IDBObjectStoreRequest.cpp:
     61        (WebCore::IDBObjectStoreRequest::IDBObjectStoreRequest):
     62        * storage/IDBObjectStoreRequest.h:
     63        (WebCore::IDBObjectStoreRequest::create):
     64        * storage/IDBRequest.cpp:
     65        (WebCore::IDBRequest::onSuccess):
     66        * storage/IDBRequest.h:
     67        * storage/IndexedDatabaseRequest.cpp:
     68        (WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest):
     69        (WebCore::IndexedDatabaseRequest::open):
     70        * storage/IndexedDatabaseRequest.h:
     71        (WebCore::IndexedDatabaseRequest::create):
     72        * storage/IndexedDatabaseRequest.idl:
     73
    1742010-06-07  Nikolas Zimmermann  <nzimmermann@rim.com>
    275
  • trunk/WebCore/GNUmakefile.am

    r60624 r60776  
    25142514        WebCore/storage/IDBIndexRequest.cpp \
    25152515        WebCore/storage/IDBIndexRequest.h \
    2516         WebCore/storage/IDBObjectStore.cpp \
    25172516        WebCore/storage/IDBObjectStore.h \
     2517        WebCore/storage/IDBObjectStoreImpl.cpp \
     2518        WebCore/storage/IDBObjectStoreImpl.h \
    25182519        WebCore/storage/IDBObjectStoreRequest.cpp \
    25192520        WebCore/storage/IDBObjectStoreRequest.h \
  • trunk/WebCore/WebCore.gypi

    r60681 r60776  
    33793379            'storage/IDBIndexRequest.cpp',
    33803380            'storage/IDBIndexRequest.h',
    3381             'storage/IDBObjectStore.cpp',
    33823381            'storage/IDBObjectStore.h',
     3382            'storage/IDBObjectStoreImpl.cpp',
     3383            'storage/IDBObjectStoreImpl.h',
    33833384            'storage/IDBObjectStoreRequest.cpp',
    33843385            'storage/IDBObjectStoreRequest.h',
  • trunk/WebCore/WebCore.pro

    r60677 r60776  
    23512351        storage/IDBIndexRequest.h \
    23522352        storage/IDBObjectStore.h \
     2353        storage/IDBObjectStoreImpl.h \
    23532354        storage/IDBObjectStoreRequest.h \
    23542355        storage/IDBRequest.h \
     
    23672368        storage/IDBIndexImpl.cpp \
    23682369        storage/IDBIndexRequest.cpp \
    2369         storage/IDBObjectStore.cpp \
     2370        storage/IDBObjectStoreImpl.cpp \
    23702371        storage/IDBObjectStoreRequest.cpp \
    23712372        storage/IDBRequest.cpp \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r60681 r60776  
    4425044250                        </File>
    4425144251                        <File
    44252                                 RelativePath="..\storage\IDBObjectStore.cpp"
    44253                                 >
    44254                         </File>
    44255                         <File
    4425644252                                RelativePath="..\storage\IDBObjectStore.h"
     44253                                >
     44254                        </File>
     44255                        <File
     44256                                RelativePath="..\storage\IDBObjectStoreImpl.cpp"
     44257                                >
     44258                        </File>
     44259                        <File
     44260                                RelativePath="..\storage\IDBObjectStoreImpl.h"
    4425744261                                >
    4425844262                        </File>
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r60762 r60776  
    42434243                B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D36019112F8B560048DEA8 /* DatabaseCallback.h */; };
    42444244                B627FB2D11AD743500E97B72 /* IDBDatabaseImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50AD2A911AC1631008CF2FB /* IDBDatabaseImpl.cpp */; };
    4245                 B6693EEB11AD63E6003F2770 /* IDBObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6693EE711AD63E6003F2770 /* IDBObjectStore.cpp */; };
    42464245                B6693EEC11AD63E6003F2770 /* IDBObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = B6693EE811AD63E6003F2770 /* IDBObjectStore.h */; };
    42474246                B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */; };
     
    42494248                B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6693EF011AD6486003F2770 /* JSIDBObjectStoreRequest.cpp */; };
    42504249                B6693EF311AD6486003F2770 /* JSIDBObjectStoreRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B6693EF111AD6486003F2770 /* JSIDBObjectStoreRequest.h */; };
     4250                B6B0540911B68F10002564C5 /* IDBObjectStoreImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6B0540711B68F10002564C5 /* IDBObjectStoreImpl.cpp */; };
     4251                B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B0540811B68F10002564C5 /* IDBObjectStoreImpl.h */; };
    42514252                B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B776D43A1104525D00BEB0EC /* PrintContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
    42524253                B734B181119B9911006587BD /* FontTranscoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B734B180119B9911006587BD /* FontTranscoder.cpp */; };
     
    97339734                B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionCoordinator.h; sourceTree = "<group>"; };
    97349735                B5D36019112F8B560048DEA8 /* DatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseCallback.h; sourceTree = "<group>"; };
    9735                 B6693EE711AD63E6003F2770 /* IDBObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStore.cpp; sourceTree = "<group>"; };
    97369736                B6693EE811AD63E6003F2770 /* IDBObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStore.h; sourceTree = "<group>"; };
    97379737                B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStoreRequest.cpp; sourceTree = "<group>"; };
     
    97409740                B6693EF011AD6486003F2770 /* JSIDBObjectStoreRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBObjectStoreRequest.cpp; sourceTree = "<group>"; };
    97419741                B6693EF111AD6486003F2770 /* JSIDBObjectStoreRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBObjectStoreRequest.h; sourceTree = "<group>"; };
     9742                B6B0540711B68F10002564C5 /* IDBObjectStoreImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStoreImpl.cpp; sourceTree = "<group>"; };
     9743                B6B0540811B68F10002564C5 /* IDBObjectStoreImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStoreImpl.h; sourceTree = "<group>"; };
    97429744                B734B180119B9911006587BD /* FontTranscoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontTranscoder.cpp; path = transcoder/FontTranscoder.cpp; sourceTree = "<group>"; };
    97439745                B734B182119B991D006587BD /* FontTranscoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontTranscoder.h; path = transcoder/FontTranscoder.h; sourceTree = "<group>"; };
     
    1102011022                        isa = PBXGroup;
    1102111023                        children = (
     11024                                B6B0540711B68F10002564C5 /* IDBObjectStoreImpl.cpp */,
     11025                                B6B0540811B68F10002564C5 /* IDBObjectStoreImpl.h */,
    1102211026                                B6693EEF11AD63F6003F2770 /* IDBObjectStoreRequest.idl */,
    11023                                 B6693EE711AD63E6003F2770 /* IDBObjectStore.cpp */,
    1102411027                                B6693EE811AD63E6003F2770 /* IDBObjectStore.h */,
    1102511028                                B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */,
     
    1941519418                                9FFE3EA611B5A4390037874E /* JSMemoryInfo.h in Headers */,
    1941619419                                86243D0111BC31F700CC006A /* JSArrayBufferViewHelper.h in Headers */,
     19420                                B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */,
    1941719421                        );
    1941819422                        runOnlyForDeploymentPostprocessing = 0;
     
    2170221706                                97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
    2170321707                                A456FA2611AD4A830020B420 /* LabelsNodeList.cpp in Sources */,
    21704                                 B6693EEB11AD63E6003F2770 /* IDBObjectStore.cpp in Sources */,
    2170521708                                B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */,
    2170621709                                B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */,
     
    2171421717                                9FFE3E7A11B59C5D0037874E /* MemoryInfo.cpp in Sources */,
    2171521718                                9FFE3EA511B5A4390037874E /* JSMemoryInfo.cpp in Sources */,
     21719                                B6B0540911B68F10002564C5 /* IDBObjectStoreImpl.cpp in Sources */,
    2171621720                        );
    2171721721                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r60762 r60776  
    18901890                        } elsif ($callWith eq "ScriptState") {
    18911891                            $callWithArg = "exec";
     1892                        } elsif ($callWith eq "ScriptExecutionContext") {
     1893                            push(@implContent, "    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
     1894                            push(@implContent, "    if (!scriptContext)\n");
     1895                            push(@implContent, "        return jsUndefined();\n");
     1896                            $callWithArg = "scriptContext";
    18921897                        }
    18931898                        $functionString .= ", " if $paramIndex;
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r60754 r60776  
    25542554            $callWithArg = "&state";
    25552555            $hasScriptState = 1;
     2556        } elsif ($callWith eq "ScriptExecutionContext") {
     2557            $result .= $indent . "ScriptExecutionContext* scriptContext = getScriptExecutionContext();\n";
     2558            $result .= $indent . "if (!scriptContext)\n";
     2559            $result .= $indent . "    return v8::Undefined();\n";
     2560            $callWithArg = "scriptContext";
    25562561        }
    25572562        $functionString .= ", " if $index;
  • trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp

    r60558 r60776  
    271271    WebKitDOMTestObj*  res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
    272272    return res;
     273}
     274
     275void
     276webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self)
     277{
     278    g_return_if_fail (self);
     279    WebCore::TestObj * item = WebKit::core(self);
     280    item->withScriptExecutionContext();
    273281}
    274282
  • trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h

    r60558 r60776  
    111111
    112112WEBKIT_API void
     113webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self);
     114
     115WEBKIT_API void
    113116webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt);
    114117
  • trunk/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r60775 r60776  
    122122#endif
    123123
    124 static const HashTableValue JSTestObjPrototypeTableValues[29] =
     124static const HashTableValue JSTestObjPrototypeTableValues[30] =
    125125{
    126126    { "voidMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t)0 THUNK_GENERATOR(0) },
     
    148148    { "withScriptStateVoidException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0 THUNK_GENERATOR(0) },
    149149    { "withScriptStateObjException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObjException), (intptr_t)0 THUNK_GENERATOR(0) },
     150    { "withScriptExecutionContext", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptExecutionContext), (intptr_t)0 THUNK_GENERATOR(0) },
    150151    { "methodWithOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithOptionalArg), (intptr_t)1 THUNK_GENERATOR(0) },
    151152    { "methodWithNonOptionalArgAndOptionalArg", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg), (intptr_t)2 THUNK_GENERATOR(0) },
     
    758759        return JSValue::encode(jsUndefined());
    759760    return JSValue::encode(result);
     761}
     762
     763
     764EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec)
     765{
     766    JSValue thisValue = exec->hostThisValue();
     767    if (!thisValue.inherits(&JSTestObj::s_info))
     768        return throwError(exec, TypeError);
     769    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
     770    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
     771    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
     772    if (!scriptContext)
     773        return jsUndefined();
     774
     775    imp->withScriptExecutionContext(scriptContext);
     776    return JSValue::encode(jsUndefined());
    760777}
    761778
  • trunk/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r60775 r60776  
    111111JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(JSC::ExecState*);
    112112JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObjException(JSC::ExecState*);
     113JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(JSC::ExecState*);
    113114JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(JSC::ExecState*);
    114115JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg(JSC::ExecState*);
    115116JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(JSC::ExecState*);
    116117JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(JSC::ExecState*);
     118
    117119// Attributes
    118120
  • trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h

    r59557 r60776  
    8181- (void)withScriptStateVoidException;
    8282- (DOMTestObj *)withScriptStateObjException;
     83- (void)withScriptExecutionContext;
    8384- (void)methodWithOptionalArg:(int)opt;
    8485- (void)methodWithNonOptionalArgAndOptionalArg:(int)nonOpt opt:(int)opt;
  • trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm

    r59866 r60776  
    371371}
    372372
     373- (void)withScriptExecutionContext
     374{
     375    WebCore::JSMainThreadNullState state;
     376    IMPL->withScriptExecutionContext();
     377}
     378
    373379- (void)methodWithOptionalArg:(int)opt
    374380{
  • trunk/WebCore/bindings/scripts/test/TestObj.idl

    r59557 r60776  
    8888        [CallWith=ScriptState] TestObj withScriptStateObjException()
    8989            raises(DOMException);
     90        [CallWith=ScriptExecutionContext] void withScriptExecutionContext();
    9091
    9192        // 'Optional' extended attribute
  • trunk/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r59557 r60776  
    505505    fail:
    506506    V8Proxy::setDOMException(ec);
     507    return v8::Handle<v8::Value>();
     508}
     509
     510static v8::Handle<v8::Value> withScriptExecutionContextCallback(const v8::Arguments& args)
     511{
     512    INC_STATS("DOM.TestObj.withScriptExecutionContext");
     513    TestObj* imp = V8TestObj::toNative(args.Holder());
     514    ScriptExecutionContext* scriptContext = getScriptExecutionContext();
     515    if (!scriptContext)
     516        return v8::Undefined();
     517    imp->withScriptExecutionContext(scriptContext);
    507518    return v8::Handle<v8::Value>();
    508519}
     
    656667    {"withScriptStateVoidException", TestObjInternal::withScriptStateVoidExceptionCallback},
    657668    {"withScriptStateObjException", TestObjInternal::withScriptStateObjExceptionCallback},
     669    {"withScriptExecutionContext", TestObjInternal::withScriptExecutionContextCallback},
    658670    {"methodWithOptionalArg", TestObjInternal::methodWithOptionalArgCallback},
    659671    {"methodWithNonOptionalArgAndOptionalArg", TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback},
  • trunk/WebCore/page/DOMWindow.cpp

    r60104 r60776  
    473473
    474474#if ENABLE(INDEXED_DATABASE)
    475     if (m_indexedDatabaseRequest)
    476         m_indexedDatabaseRequest->disconnectFrame();
    477475    m_indexedDatabaseRequest = 0;
    478476#endif
     
    674672    // FIXME: See if indexedDatabase access is allowed.
    675673
    676     m_indexedDatabaseRequest = IndexedDatabaseRequest::create(page->group().indexedDatabase(), m_frame);
     674    m_indexedDatabaseRequest = IndexedDatabaseRequest::create(page->group().indexedDatabase());
    677675    return m_indexedDatabaseRequest.get();
    678676}
  • trunk/WebCore/storage/IDBCallbacks.h

    r60357 r60776  
    3333#include "IDBDatabaseError.h"
    3434#include "IDBIndex.h"
     35#include "IDBObjectStore.h"
    3536#include "SerializedScriptValue.h"
    3637#include <wtf/RefCounted.h>
     
    4849    virtual void onSuccess(PassRefPtr<IDBDatabase>) = 0;
    4950    virtual void onSuccess(PassRefPtr<IDBIndex>) = 0;
     51    virtual void onSuccess(PassRefPtr<IDBObjectStore>) = 0;
    5052    virtual void onSuccess(PassRefPtr<SerializedScriptValue>) = 0;
    5153};
  • trunk/WebCore/storage/IDBDatabase.h

    r60357 r60776  
    3636
    3737class DOMStringList;
    38 
     38class Frame;
     39class IDBCallbacks;
    3940// This class is shared by IDBDatabaseRequest (async) and IDBDatabaseSync (sync).
    4041// This is implemented by IDBDatabaseImpl and optionally others (in order to proxy
     
    4950    virtual String version() = 0;
    5051    virtual PassRefPtr<DOMStringList> objectStores() = 0;
     52    virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>) = 0;
    5153};
    5254
  • trunk/WebCore/storage/IDBDatabaseImpl.cpp

    r60357 r60776  
    2828
    2929#include "DOMStringList.h"
     30#include "IDBDatabaseException.h"
     31#include "IDBObjectStoreImpl.h"
    3032
    3133#if ENABLE(INDEXED_DATABASE)
     
    5052}
    5153
     54void IDBDatabaseImpl::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks> callbacks)
     55{
     56    if (m_objectStores.contains(name)) {
     57        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, "ObjectStore name already exists."));
     58        return;
     59    }
     60
     61    RefPtr<IDBObjectStore> objectStore = IDBObjectStoreImpl::create(name, keyPath, autoIncrement);
     62    m_objectStores.set(name, objectStore);
     63    callbacks->onSuccess(objectStore.release());
     64}
     65
     66
    5267} // namespace WebCore
    5368
  • trunk/WebCore/storage/IDBDatabaseImpl.h

    r60357 r60776  
    2727#define IDBDatabaseImpl_h
    2828
     29#include "IDBCallbacks.h"
    2930#include "IDBDatabase.h"
    3031
     
    4647    virtual String version() { return m_version; }
    4748    virtual PassRefPtr<DOMStringList> objectStores();
     49    virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>);
    4850
    4951private:
     
    5355    String m_description;
    5456    String m_version;
     57
     58    typedef HashMap<String, RefPtr<IDBObjectStore> > ObjectStoreMap;
     59    ObjectStoreMap m_objectStores;
    5560};
    5661
  • trunk/WebCore/storage/IDBDatabaseRequest.cpp

    r60357 r60776  
    2727#include "IDBDatabaseRequest.h"
    2828
     29#include "IDBAny.h"
     30#include "IDBRequest.h"
    2931#include "IndexedDatabase.h"
     32#include "ScriptExecutionContext.h"
    3033
    3134#if ENABLE(INDEXED_DATABASE)
     
    3639    : m_idbDatabase(idbDatabase)
    3740{
     41    m_this = IDBAny::create();
     42    m_this->set(this);
    3843}
    3944
     
    4247}
    4348
     49PassRefPtr<IDBRequest> IDBDatabaseRequest::createObjectStore(ScriptExecutionContext* context, const String& name, const String& keyPath, bool autoIncrement)
     50{
     51    if (!context->isDocument()) {
     52        ASSERT_NOT_REACHED();
     53        return 0;
     54    }
     55
     56    RefPtr<IDBRequest> request = IDBRequest::create(context, m_this);
     57    m_idbDatabase->createObjectStore(name, keyPath, autoIncrement, request);
     58    return request;
     59}
     60
    4461} // namespace WebCore
    4562
  • trunk/WebCore/storage/IDBDatabaseRequest.h

    r60357 r60776  
    3737namespace WebCore {
    3838
     39class IDBAny;
     40class IDBRequest;
     41class ScriptExecutionContext;
     42
    3943class IDBDatabaseRequest : public RefCounted<IDBDatabaseRequest> {
    4044public:
     
    5155    PassRefPtr<DOMStringList> objectStores() const { return m_idbDatabase->objectStores(); }
    5256
     57    PassRefPtr<IDBRequest> createObjectStore(ScriptExecutionContext*, const String& name, const String& keyPath = "", bool autoIncrement = false);
     58
    5359private:
    5460    IDBDatabaseRequest(PassRefPtr<IDBDatabase>);
    5561
    5662    RefPtr<IDBDatabase> m_idbDatabase;
     63    RefPtr<IDBAny> m_this;
    5764};
    5865
  • trunk/WebCore/storage/IDBDatabaseRequest.idl

    r60357 r60776  
    3535        readonly attribute DOMString version;
    3636        readonly attribute DOMStringList objectStores;
     37
     38        [CallWith=ScriptExecutionContext] IDBRequest createObjectStore(in DOMString name, in [Optional] DOMString path, in [Optional] boolean autoIncrement);
    3739    };
    3840
  • trunk/WebCore/storage/IDBObjectStore.h

    r60357 r60776  
    3737
    3838class DOMStringList;
     39class IDBCallbacks;
    3940class IDBIndex;
    40 class IDBCallbacks;
    4141
    42 // FIXME: This needs to be split into an interface and Impl classes.
    4342class IDBObjectStore : public ThreadSafeShared<IDBObjectStore> {
    4443public:
    45     static PassRefPtr<IDBObjectStore> create()
    46     {
    47         return adoptRef(new IDBObjectStore());
    48     }
    49     virtual ~IDBObjectStore();
     44    virtual ~IDBObjectStore() { }
    5045
    51     String name() const { return m_name; }
    52     String keyPath() const { return m_keyPath; }
    53     PassRefPtr<DOMStringList> indexNames() const;
    54 
    55     void createIndex(const String& name, const String& keyPath, bool unique, PassRefPtr<IDBCallbacks>);
    56     PassRefPtr<IDBIndex> index(const String& name);
    57     void removeIndex(const String& name, PassRefPtr<IDBCallbacks>);
    58 
    59 private:
    60     IDBObjectStore();
    61 
    62     String m_name;
    63     String m_keyPath;
    64     typedef HashMap<String, RefPtr<IDBIndex> > IndexMap;
    65     IndexMap m_indexes;
     46    virtual String name() const = 0;
     47    virtual String keyPath() const = 0;
     48    virtual PassRefPtr<DOMStringList> indexNames() const = 0;
     49    virtual void createIndex(const String& name, const String& keyPath, bool unique, PassRefPtr<IDBCallbacks>) = 0;
     50    virtual PassRefPtr<IDBIndex> index(const String& name) = 0;
     51    virtual void removeIndex(const String& name, PassRefPtr<IDBCallbacks>) = 0;
    6652};
    6753
  • trunk/WebCore/storage/IDBObjectStoreImpl.cpp

    • Property svn:executable set to *
    r60775 r60776  
    2525
    2626#include "config.h"
    27 #include "IDBObjectStore.h"
     27#include "IDBObjectStoreImpl.h"
    2828
    2929#include "DOMStringList.h"
     
    3636namespace WebCore {
    3737
    38 IDBObjectStore::IDBObjectStore()
     38IDBObjectStoreImpl::~IDBObjectStoreImpl()
    3939{
    4040}
    4141
    42 IDBObjectStore::~IDBObjectStore()
     42IDBObjectStoreImpl::IDBObjectStoreImpl(const String& name, const String& keyPath, bool autoIncrement)
     43    : m_name(name)
     44    , m_keyPath(keyPath)
     45    , m_autoIncrement(autoIncrement)
    4346{
    4447}
    4548
    46 PassRefPtr<DOMStringList> IDBObjectStore::indexNames() const
     49PassRefPtr<DOMStringList> IDBObjectStoreImpl::indexNames() const
    4750{
    4851    RefPtr<DOMStringList> indexNames = DOMStringList::create();
     
    5255}
    5356
    54 void IDBObjectStore::createIndex(const String& name, const String& keyPath, bool unique, PassRefPtr<IDBCallbacks> callbacks)
     57void IDBObjectStoreImpl::createIndex(const String& name, const String& keyPath, bool unique, PassRefPtr<IDBCallbacks> callbacks)
    5558{
    5659    if (m_indexes.contains(name)) {
     
    6568}
    6669
    67 PassRefPtr<IDBIndex> IDBObjectStore::index(const String& name)
     70PassRefPtr<IDBIndex> IDBObjectStoreImpl::index(const String& name)
    6871{
    6972    return m_indexes.get(name);
    7073}
    7174
    72 void IDBObjectStore::removeIndex(const String& name, PassRefPtr<IDBCallbacks> callbacks)
     75void IDBObjectStoreImpl::removeIndex(const String& name, PassRefPtr<IDBCallbacks> callbacks)
    7376{
    7477    if (!m_indexes.contains(name)) {
     
    8184}
    8285
     86
    8387} // namespace WebCore
    8488
    85 #endif // ENABLE(INDEXED_DATABASE)
    86 
     89#endif
  • trunk/WebCore/storage/IDBObjectStoreImpl.h

    • Property svn:executable set to *
    r60775 r60776  
    2424 */
    2525
    26 #ifndef IDBObjectStore_h
    27 #define IDBObjectStore_h
     26#ifndef IDBObjectStoreImpl_h
     27#define IDBObjectStoreImpl_h
    2828
     29#include "IDBObjectStore.h"
    2930#include "PlatformString.h"
    30 #include "StringHash.h"
    31 #include <wtf/HashMap.h>
    3231#include <wtf/Threading.h>
    3332
     
    3635namespace WebCore {
    3736
    38 class DOMStringList;
    39 class IDBIndex;
    40 class IDBCallbacks;
    41 
    42 // FIXME: This needs to be split into an interface and Impl classes.
    43 class IDBObjectStore : public ThreadSafeShared<IDBObjectStore> {
     37class IDBObjectStoreImpl : public IDBObjectStore {
    4438public:
    45     static PassRefPtr<IDBObjectStore> create()
     39    static PassRefPtr<IDBObjectStore> create(const String& name, const String& keyPath, bool autoIncrement)
    4640    {
    47         return adoptRef(new IDBObjectStore());
     41        return adoptRef(new IDBObjectStoreImpl(name, keyPath, autoIncrement));
    4842    }
    49     virtual ~IDBObjectStore();
     43    virtual ~IDBObjectStoreImpl();
    5044
    5145    String name() const { return m_name; }
     
    5852
    5953private:
    60     IDBObjectStore();
     54    IDBObjectStoreImpl(const String& name, const String& keyPath, bool autoIncrement);
    6155
    6256    String m_name;
    6357    String m_keyPath;
     58    bool m_autoIncrement;
     59
    6460    typedef HashMap<String, RefPtr<IDBIndex> > IndexMap;
    6561    IndexMap m_indexes;
     
    7066#endif
    7167
    72 #endif // IDBObjectStore_h
    73 
     68#endif // IDBObjectStoreImpl_h
  • trunk/WebCore/storage/IDBObjectStoreRequest.cpp

    r60357 r60776  
    3030#include "IDBAny.h"
    3131#include "IDBIndexRequest.h"
    32 #include "ScriptExecutionContext.h"
    3332#include "SerializedScriptValue.h"
    3433#include <wtf/UnusedParam.h>
     
    3837namespace WebCore {
    3938
    40 IDBObjectStoreRequest::IDBObjectStoreRequest(ScriptExecutionContext* context, PassRefPtr<IDBObjectStore> idbObjectStore)
     39IDBObjectStoreRequest::IDBObjectStoreRequest(PassRefPtr<IDBObjectStore> idbObjectStore)
    4140    : m_objectStore(idbObjectStore)
    42     , m_scriptExecutionContext(context)
    4341{
    4442    m_this = IDBAny::create();
  • trunk/WebCore/storage/IDBObjectStoreRequest.h

    r60357 r60776  
    4141class IDBAny;
    4242class IDBIndexRequest;
    43 class ScriptExecutionContext;
    4443class SerializedScriptValue;
    4544
    4645class IDBObjectStoreRequest : public RefCounted<IDBObjectStoreRequest> {
    4746public:
    48     static PassRefPtr<IDBObjectStoreRequest> create(ScriptExecutionContext* context, PassRefPtr<IDBObjectStore> idbObjectStore)
     47    static PassRefPtr<IDBObjectStoreRequest> create(PassRefPtr<IDBObjectStore> idbObjectStore)
    4948    {
    50         return adoptRef(new IDBObjectStoreRequest(context, idbObjectStore));
     49        return adoptRef(new IDBObjectStoreRequest(idbObjectStore));
    5150    }
    5251    ~IDBObjectStoreRequest() { }
     
    6766
    6867private:
    69     IDBObjectStoreRequest(ScriptExecutionContext*, PassRefPtr<IDBObjectStore>);
     68    IDBObjectStoreRequest(PassRefPtr<IDBObjectStore>);
    7069
    7170    RefPtr<IDBObjectStore> m_objectStore;
    72     RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
    7371    RefPtr<IDBAny> m_this;
    7472};
  • trunk/WebCore/storage/IDBRequest.cpp

    r60357 r60776  
    3939#include "IDBIndexRequest.h"
    4040#include "IDBErrorEvent.h"
     41#include "IDBObjectStoreRequest.h"
    4142#include "IDBSuccessEvent.h"
    4243#include "ScriptExecutionContext.h"
     
    8384    onEventCommon();
    8485    m_result->set(IDBIndexRequest::create(idbIndex));
     86}
     87
     88void IDBRequest::onSuccess(PassRefPtr<IDBObjectStore> idbObjectStore)
     89{
     90    onEventCommon();
     91    m_result->set(IDBObjectStoreRequest::create(idbObjectStore));
    8592}
    8693
  • trunk/WebCore/storage/IDBRequest.h

    r60357 r60776  
    6767    virtual void onSuccess(PassRefPtr<IDBDatabase>);
    6868    virtual void onSuccess(PassRefPtr<IDBIndex>);
     69    virtual void onSuccess(PassRefPtr<IDBObjectStore>);
    6970    virtual void onSuccess(PassRefPtr<SerializedScriptValue>);
    70     // FIXME: Have one onSuccess function for each possible result type.
    7171
    7272    // EventTarget
  • trunk/WebCore/storage/IndexedDatabaseRequest.cpp

    r60484 r60776  
    4141namespace WebCore {
    4242
    43 IndexedDatabaseRequest::IndexedDatabaseRequest(IndexedDatabase* indexedDatabase, Frame* frame)
     43IndexedDatabaseRequest::IndexedDatabaseRequest(IndexedDatabase* indexedDatabase)
    4444    : m_indexedDatabase(indexedDatabase)
    45     , m_frame(frame)
    4645{
    4746    m_this = IDBAny::create();
     
    5352}
    5453
    55 PassRefPtr<IDBRequest> IndexedDatabaseRequest::open(const String& name, const String& description)
     54PassRefPtr<IDBRequest> IndexedDatabaseRequest::open(ScriptExecutionContext* context, const String& name, const String& description)
    5655{
    57     RefPtr<IDBRequest> request = IDBRequest::create(m_frame->document(), m_this);
    58     m_indexedDatabase->open(name, description, request, m_frame->document()->securityOrigin(), m_frame);
     56    if (!context->isDocument()) {
     57        // FIXME: make this work with workers.
     58        return 0;
     59    }
     60
     61    Document* document = static_cast<Document*>(context);
     62    if (!document->frame())
     63        return 0;
     64
     65    RefPtr<IDBRequest> request = IDBRequest::create(document, m_this);
     66    m_indexedDatabase->open(name, description, request, document->securityOrigin(), document->frame());
    5967    return request;
    6068}
  • trunk/WebCore/storage/IndexedDatabaseRequest.h

    r60484 r60776  
    4040namespace WebCore {
    4141
    42 class Frame;
    4342class IDBAny;
    4443class IndexedDatabase;
     
    4645class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> {
    4746public:
    48     static PassRefPtr<IndexedDatabaseRequest> create(IndexedDatabase* indexedDatabase, Frame* frame)
     47    static PassRefPtr<IndexedDatabaseRequest> create(IndexedDatabase* indexedDatabase)
    4948    {
    50         return adoptRef(new IndexedDatabaseRequest(indexedDatabase, frame));
     49        return adoptRef(new IndexedDatabaseRequest(indexedDatabase));
    5150    }
    5251    ~IndexedDatabaseRequest();
    5352
    54     PassRefPtr<IDBRequest> open(const String& name, const String& description);
    55 
    56     void disconnectFrame() { m_frame = 0; }
     53    PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description);
    5754
    5855private:
    59     IndexedDatabaseRequest(IndexedDatabase*, Frame*);
     56    IndexedDatabaseRequest(IndexedDatabase*);
    6057
    6158    RefPtr<IndexedDatabase> m_indexedDatabase;
    6259    RefPtr<IDBAny> m_this;
    63     Frame* m_frame;
    6460};
    6561
  • trunk/WebCore/storage/IndexedDatabaseRequest.idl

    r60484 r60776  
    2929        Conditional=INDEXED_DATABASE
    3030    ] IndexedDatabaseRequest {
    31         IDBRequest open(in DOMString name, in DOMString description);
     31        [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description);
    3232    };
    3333
  • trunk/WebKit/chromium/ChangeLog

    r60771 r60776  
     12010-06-07  Andrei Popescu  <andreip@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        [indexedDB] It is impossible to create object stores
     6        https://bugs.webkit.org/show_bug.cgi?id=40054
     7
     8        * WebKit.gyp:
     9        * public/WebIDBCallbacks.h:
     10        (WebKit::WebIDBCallbacks::onSuccess):
     11        * public/WebIDBDatabase.h:
     12        (WebKit::WebIDBDatabase::createObjectStore):
     13        * public/WebIDBObjectStore.h: Added.
     14        (WebKit::WebIDBObjectStore::~WebIDBObjectStore):
     15        (WebKit::WebIDBObjectStore::name):
     16        (WebKit::WebIDBObjectStore::keyPath):
     17        * src/IDBCallbacksProxy.cpp:
     18        (WebCore::IDBCallbacksProxy::onSuccess):
     19        * src/IDBCallbacksProxy.h:
     20        * src/IDBDatabaseProxy.cpp:
     21        (WebCore::IDBDatabaseProxy::createObjectStore):
     22        * src/IDBDatabaseProxy.h:
     23        * src/IDBObjectStoreProxy.cpp: Added.
     24        (WebCore::IDBObjectStoreProxy::create):
     25        (WebCore::IDBObjectStoreProxy::IDBObjectStoreProxy):
     26        (WebCore::IDBObjectStoreProxy::~IDBObjectStoreProxy):
     27        (WebCore::IDBObjectStoreProxy::name):
     28        (WebCore::IDBObjectStoreProxy::keyPath):
     29        (WebCore::IDBObjectStoreProxy::indexNames):
     30        (WebCore::IDBObjectStoreProxy::createIndex):
     31        (WebCore::IDBObjectStoreProxy::index):
     32        (WebCore::IDBObjectStoreProxy::removeIndex):
     33        * src/IDBObjectStoreProxy.h: Added.
     34        * src/IndexedDatabaseProxy.cpp:
     35        (WebCore::IndexedDatabaseProxy::open):
     36        * src/WebIDBCallbacksImpl.cpp:
     37        (WebCore::WebIDBCallbacksImpl::onSuccess):
     38        * src/WebIDBCallbacksImpl.h:
     39        * src/WebIDBDatabaseImpl.cpp:
     40        (WebKit::WebIDBDatabaseImpl::createObjectStore):
     41        * src/WebIDBDatabaseImpl.h:
     42        * src/WebIDBObjectStoreImpl.cpp: Added.
     43        (WebKit::WebIDBObjectStoreImpl::WebIDBObjectStoreImpl):
     44        (WebKit::WebIDBObjectStoreImpl::~WebIDBObjectStoreImpl):
     45        (WebKit::WebIDBObjectStoreImpl::name):
     46        (WebKit::WebIDBObjectStoreImpl::keyPath):
     47        * src/WebIDBObjectStoreImpl.h: Added.
     48        * src/WebIndexedDatabaseImpl.cpp:
     49        (WebKit::WebIndexedDatabaseImpl::open):
     50
    1512010-06-07  Yury Semikhatsky  <yurys@chromium.org>
    252
  • trunk/WebKit/chromium/WebKit.gyp

    r60610 r60776  
    141141                'public/WebIDBDatabaseError.h',
    142142                'public/WebIDBIndex.h',
     143                'public/WebIDBObjectStore.h',
    143144                'public/WebIndexedDatabase.h',
    144145                'public/WebInputElement.h',
     
    270271                'src/IDBIndexProxy.cpp',
    271272                'src/IDBIndexProxy.h',
     273                'src/IDBObjectStoreProxy.cpp',
     274                'src/IDBObjectStoreProxy.h',
    272275                'src/IndexedDatabaseProxy.cpp',
    273276                'src/IndexedDatabaseProxy.h',
     
    359362                'src/WebIDBIndexImpl.cpp',
    360363                'src/WebIDBIndexImpl.h',
     364                'src/WebIDBObjectStoreImpl.cpp',
     365                'src/WebIDBObjectStoreImpl.h',
    361366                'src/WebImageCG.cpp',
    362367                'src/WebImageDecoder.cpp',
  • trunk/WebKit/chromium/public/WebIDBCallbacks.h

    r60357 r60776  
    3434class WebIDBDatabaseError;
    3535class WebIDBIndex;
     36class WebIDBObjectStore;
    3637class WebSerializedScriptValue;
    3738
     
    4647    virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); }
    4748    virtual void onSuccess(WebIDBIndex*) { WEBKIT_ASSERT_NOT_REACHED(); }
     49    virtual void onSuccess(WebIDBObjectStore*) { WEBKIT_ASSERT_NOT_REACHED(); }
    4850    virtual void onSuccess(const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); }
    4951};
  • trunk/WebKit/chromium/public/WebIDBDatabase.h

    r60484 r60776  
    3232namespace WebKit {
    3333
     34class WebFrame;
     35class WebIDBCallbacks;
     36
    3437// See comment in WebIndexedDatabase for a high level overview of these classes.
    3538class WebIDBDatabase {
     
    5760        return WebDOMStringList();
    5861    }
     62    virtual void createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks*)
     63    {
     64        WEBKIT_ASSERT_NOT_REACHED();
     65    }
    5966};
    6067
  • trunk/WebKit/chromium/public/WebIDBObjectStore.h

    • Property svn:executable set to *
    r60775 r60776  
    2424 */
    2525
    26 #ifndef WebIDBDatabase_h
    27 #define WebIDBDatabase_h
     26#ifndef WebIDBObjectStore_h
     27#define WebIDBObjectStore_h
    2828
    2929#include "WebCommon.h"
    30 #include "WebDOMStringList.h"
     30#include "WebIDBCallbacks.h"
     31#include "WebString.h"
    3132
    3233namespace WebKit {
    3334
    34 // See comment in WebIndexedDatabase for a high level overview of these classes.
    35 class WebIDBDatabase {
     35// See comment in WebIndexedDatabase for a high level overview these classes.
     36class WebIDBObjectStore {
    3637public:
    37     virtual ~WebIDBDatabase() { }
     38    virtual ~WebIDBObjectStore() { }
    3839
    39     virtual WebString name()
     40    virtual WebString name() const
    4041    {
    4142        WEBKIT_ASSERT_NOT_REACHED();
    4243        return WebString();
    4344    }
    44     virtual WebString description()
     45    virtual WebString keyPath() const
    4546    {
    4647        WEBKIT_ASSERT_NOT_REACHED();
    4748        return WebString();
    4849    }
    49     virtual WebString version()
    50     {
    51         WEBKIT_ASSERT_NOT_REACHED();
    52         return WebString();
    53     }
    54     virtual WebDOMStringList objectStores()
    55     {
    56         WEBKIT_ASSERT_NOT_REACHED();
    57         return WebDOMStringList();
    58     }
     50    // FIXME: finish.
    5951};
    6052
    6153} // namespace WebKit
    6254
    63 #endif // WebIDBDatabase_h
     55#endif // WebIDBObjectStore_h
  • trunk/WebKit/chromium/src/IDBCallbacksProxy.cpp

    r60357 r60776  
    3636#include "WebIDBDatabaseError.h"
    3737#include "WebIDBIndexImpl.h"
     38#include "WebIDBObjectStoreImpl.h"
    3839#include "WebSerializedScriptValue.h"
    3940
     
    8081}
    8182
     83void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBObjectStore> idbObjectStore)
     84{
     85    m_callbacks->onSuccess(new WebKit::WebIDBObjectStoreImpl(idbObjectStore));
     86    m_callbacks.clear();
     87}
     88
    8289void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue)
    8390{
  • trunk/WebKit/chromium/src/IDBCallbacksProxy.h

    r60357 r60776  
    4444class IDBDatabaseError;
    4545class IDBDatabase;
     46class IDBObjectStore;
    4647class SerializedScriptValue;
    4748
     
    5556    virtual void onSuccess(PassRefPtr<IDBDatabase>);
    5657    virtual void onSuccess(PassRefPtr<IDBIndex>);
     58    virtual void onSuccess(PassRefPtr<IDBObjectStore>);
    5759    virtual void onSuccess(PassRefPtr<SerializedScriptValue>);
    5860
  • trunk/WebKit/chromium/src/IDBDatabaseProxy.cpp

    r60357 r60776  
    2828
    2929#include "DOMStringList.h"
     30#include "IDBCallbacks.h"
     31#include "WebFrameImpl.h"
     32#include "WebIDBCallbacksImpl.h"
    3033#include "WebIDBDatabase.h"
    3134#include "WebIDBDatabaseError.h"
     
    6972}
    7073
     74void IDBDatabaseProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks> callbacks)
     75{
     76    m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, new WebIDBCallbacksImpl(callbacks));
     77}
     78
    7179} // namespace WebCore
    7280
  • trunk/WebKit/chromium/src/IDBDatabaseProxy.h

    r60357 r60776  
    4747    virtual String version();
    4848    virtual PassRefPtr<DOMStringList> objectStores();
    49 
     49    virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>);
    5050    // FIXME: Add other methods.
    5151
  • trunk/WebKit/chromium/src/IDBObjectStoreProxy.cpp

    • Property svn:executable set to *
    r60775 r60776  
    2525
    2626#include "config.h"
     27#include "IDBObjectStoreProxy.h"
     28
     29#include "DOMStringList.h"
     30#include "IDBCallbacks.h"
    2731#include "WebIDBCallbacksImpl.h"
    28 
    29 #include "IDBCallbacks.h"
    30 #include "IDBDatabaseError.h"
    31 #include "IDBDatabaseProxy.h"
    32 #include "IDBIndexProxy.h"
    33 #include "WebIDBCallbacks.h"
    34 #include "WebIDBDatabase.h"
    35 #include "WebIDBDatabaseError.h"
    36 #include "WebIDBIndex.h"
    37 #include "WebSerializedScriptValue.h"
     32#include "WebIDBObjectStore.h"
     33#include <wtf/UnusedParam.h>
    3834
    3935#if ENABLE(INDEXED_DATABASE)
     
    4137namespace WebCore {
    4238
    43 WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks)
    44     : m_callbacks(callbacks)
     39PassRefPtr<IDBObjectStore> IDBObjectStoreProxy::create(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore)
     40{
     41    return adoptRef(new IDBObjectStoreProxy(objectStore));
     42}
     43
     44IDBObjectStoreProxy::IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore)
     45    : m_webIDBObjectStore(objectStore)
    4546{
    4647}
    4748
    48 WebIDBCallbacksImpl::~WebIDBCallbacksImpl()
     49IDBObjectStoreProxy::~IDBObjectStoreProxy()
    4950{
    5051}
    5152
    52 void WebIDBCallbacksImpl::onError(const WebKit::WebIDBDatabaseError& error)
     53String IDBObjectStoreProxy::name() const
    5354{
    54     m_callbacks->onError(error);
    55     m_callbacks.clear();
     55    return m_webIDBObjectStore->name();
    5656}
    5757
    58 void WebIDBCallbacksImpl::onSuccess()
     58String IDBObjectStoreProxy::keyPath() const
    5959{
    60     m_callbacks->onSuccess();
    61     m_callbacks.clear();
     60    return m_webIDBObjectStore->keyPath();
    6261}
    6362
    64 void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBDatabase* webKitInstance)
     63PassRefPtr<DOMStringList> IDBObjectStoreProxy::indexNames() const
    6564{
    66     m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance));
    67     m_callbacks.clear();
     65    // FIXME: implement.
     66    ASSERT_NOT_REACHED();
     67    return 0;
    6868}
    6969
    70 void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBIndex* webKitInstance)
     70void IDBObjectStoreProxy::createIndex(const String& name, const String& keyPath, bool unique, PassRefPtr<IDBCallbacks>)
    7171{
    72     m_callbacks->onSuccess(IDBIndexProxy::create(webKitInstance));
    73     m_callbacks.clear();
     72    // FIXME: implement.
     73    UNUSED_PARAM(name);
     74    UNUSED_PARAM(keyPath);
     75    UNUSED_PARAM(unique);
     76    ASSERT_NOT_REACHED();
    7477}
    7578
    76 void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue)
     79PassRefPtr<IDBIndex> IDBObjectStoreProxy::index(const String& name)
    7780{
    78     m_callbacks->onSuccess(serializedScriptValue);
    79     m_callbacks.clear();
     81    // FIXME: implement.
     82    UNUSED_PARAM(name);
     83    ASSERT_NOT_REACHED();
     84    return 0;
     85}
     86
     87void IDBObjectStoreProxy::removeIndex(const String& name, PassRefPtr<IDBCallbacks>)
     88{
     89    // FIXME: implement.
     90    UNUSED_PARAM(name);
     91    ASSERT_NOT_REACHED();
    8092}
    8193
  • trunk/WebKit/chromium/src/IDBObjectStoreProxy.h

    • Property svn:executable set to *
    r60775 r60776  
    2424 */
    2525
    26 #ifndef IDBDatabaseProxy_h
    27 #define IDBDatabaseProxy_h
     26#ifndef IDBObjectStoreProxy_h
     27#define IDBObjectStoreProxy_h
    2828
    29 #include "IDBDatabase.h"
     29#include "IDBObjectStore.h"
    3030#include <wtf/OwnPtr.h>
    3131#include <wtf/PassOwnPtr.h>
     
    3434#if ENABLE(INDEXED_DATABASE)
    3535
    36 namespace WebKit { class WebIDBDatabase; }
     36namespace WebKit { class WebIDBObjectStore; }
    3737
    3838namespace WebCore {
    3939
    40 class IDBDatabaseProxy : public IDBDatabase {
     40class DOMStringList;
     41class IDBIndex;
     42
     43class IDBObjectStoreProxy : public IDBObjectStore {
    4144public:
    42     static PassRefPtr<IDBDatabase> create(PassOwnPtr<WebKit::WebIDBDatabase>);
    43     virtual ~IDBDatabaseProxy();
     45    static PassRefPtr<IDBObjectStore> create(PassOwnPtr<WebKit::WebIDBObjectStore>);
     46    virtual ~IDBObjectStoreProxy();
    4447
    45     virtual String name();
    46     virtual String description();
    47     virtual String version();
    48     virtual PassRefPtr<DOMStringList> objectStores();
    49 
    50     // FIXME: Add other methods.
     48    virtual String name() const;
     49    virtual String keyPath() const;
     50    virtual PassRefPtr<DOMStringList> indexNames() const;
     51    virtual void createIndex(const String& name, const String& keyPath, bool unique, PassRefPtr<IDBCallbacks>);
     52    virtual PassRefPtr<IDBIndex> index(const String& name);
     53    virtual void removeIndex(const String& name, PassRefPtr<IDBCallbacks>);
    5154
    5255private:
    53     IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase>);
     56    IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore>);
    5457
    55     OwnPtr<WebKit::WebIDBDatabase> m_webIDBDatabase;
     58    OwnPtr<WebKit::WebIDBObjectStore> m_webIDBObjectStore;
    5659};
    5760
     
    6063#endif
    6164
    62 #endif // IDBDatabaseProxy_h
     65#endif // IDBObjectStoreProxy_h
     66
  • trunk/WebKit/chromium/src/IndexedDatabaseProxy.cpp

    r60484 r60776  
    6060void IndexedDatabaseProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame)
    6161{
    62     if (!frame || !frame->document())
    63         return;
    6462    WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
    6563    m_webIndexedDatabase->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame);
  • trunk/WebKit/chromium/src/WebIDBCallbacksImpl.cpp

    r60357 r60776  
    3131#include "IDBDatabaseProxy.h"
    3232#include "IDBIndexProxy.h"
     33#include "IDBObjectStoreProxy.h"
    3334#include "WebIDBCallbacks.h"
    3435#include "WebIDBDatabase.h"
    3536#include "WebIDBDatabaseError.h"
    3637#include "WebIDBIndex.h"
     38#include "WebIDBObjectStore.h"
    3739#include "WebSerializedScriptValue.h"
    3840
     
    7476}
    7577
     78void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBObjectStore* webKitInstance)
     79{
     80    m_callbacks->onSuccess(IDBObjectStoreProxy::create(webKitInstance));
     81    m_callbacks.clear();
     82}
     83
    7684void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue)
    7785{
  • trunk/WebKit/chromium/src/WebIDBCallbacksImpl.h

    r60357 r60776  
    4646    virtual void onSuccess(WebKit::WebIDBDatabase*);
    4747    virtual void onSuccess(WebKit::WebIDBIndex*);
     48    virtual void onSuccess(WebKit::WebIDBObjectStore*);
    4849    virtual void onSuccess(const WebKit::WebSerializedScriptValue&);
    4950
  • trunk/WebKit/chromium/src/WebIDBDatabaseImpl.cpp

    r60357 r60776  
    2828
    2929#include "DOMStringList.h"
     30#include "IDBCallbacksProxy.h"
    3031#include "IDBDatabase.h"
     32#include "WebIDBCallbacks.h"
    3133
    3234#if ENABLE(INDEXED_DATABASE)
     
    6567}
    6668
     69void WebIDBDatabaseImpl::createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks* callbacks)
     70{
     71    m_idbDatabase->createObjectStore(name, keyPath, autoIncrement, IDBCallbacksProxy::create(callbacks));
     72}
     73
    6774} // namespace WebCore
    6875
  • trunk/WebKit/chromium/src/WebIDBDatabaseImpl.h

    r60357 r60776  
    4646    virtual WebString version();
    4747    virtual WebDOMStringList objectStores();
     48    virtual void createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks* callbacks);
    4849
    4950private:
  • trunk/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp

    • Property svn:executable set to *
    r60775 r60776  
    2525
    2626#include "config.h"
    27 #include "IDBDatabaseImpl.h"
     27#include "WebIDBObjectStoreImpl.h"
    2828
    29 #include "DOMStringList.h"
     29#include "IDBCallbacksProxy.h"
     30#include "IDBObjectStore.h"
    3031
    3132#if ENABLE(INDEXED_DATABASE)
    3233
    33 namespace WebCore {
     34using namespace WebCore;
    3435
    35 IDBDatabaseImpl::IDBDatabaseImpl(const String& name, const String& description, const String& version)
    36     : m_name(name)
    37     , m_description(description)
    38     , m_version(version)
     36namespace WebKit {
     37
     38WebIDBObjectStoreImpl::WebIDBObjectStoreImpl(PassRefPtr<IDBObjectStore> idbObjectStore)
     39    : m_idbObjectStore(idbObjectStore)
    3940{
    4041}
    4142
    42 IDBDatabaseImpl::~IDBDatabaseImpl()
     43WebIDBObjectStoreImpl::~WebIDBObjectStoreImpl()
    4344{
    4445}
    4546
    46 PassRefPtr<DOMStringList> IDBDatabaseImpl::objectStores()
     47WebString WebIDBObjectStoreImpl::name() const
    4748{
    48     // FIXME: This should return the actual list.
    49     return DOMStringList::create();
     49    return m_idbObjectStore->name();
     50}
     51
     52WebString WebIDBObjectStoreImpl::keyPath() const
     53{
     54    return m_idbObjectStore->keyPath();
    5055}
    5156
  • trunk/WebKit/chromium/src/WebIDBObjectStoreImpl.h

    • Property svn:executable set to *
    r60775 r60776  
    2424 */
    2525
    26 #ifndef WebIDBDatabaseImpl_h
    27 #define WebIDBDatabaseImpl_h
     26#ifndef WebIDBObjectStoreImpl_h
     27#define WebIDBObjectStoreImpl_h
    2828
    2929#include "WebCommon.h"
    30 #include "WebIDBDatabase.h"
     30#include "WebIDBObjectStore.h"
    3131#include <wtf/PassRefPtr.h>
    3232#include <wtf/RefPtr.h>
    3333
    34 namespace WebCore { class IDBDatabase; }
     34namespace WebCore { class IDBObjectStore; }
    3535
    3636namespace WebKit {
    3737
    38 // See comment in WebIndexedDatabase for a high level overview these classes.
    39 class WebIDBDatabaseImpl : public WebIDBDatabase {
     38// See comment in WebIndexedObjectStore for a high level overview these classes.
     39class WebIDBObjectStoreImpl : public WebIDBObjectStore {
    4040public:
    41     WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabase> idbDatabase);
    42     virtual ~WebIDBDatabaseImpl();
     41    WebIDBObjectStoreImpl(WTF::PassRefPtr<WebCore::IDBObjectStore> idbObjectStore);
     42    virtual ~WebIDBObjectStoreImpl();
    4343
    44     virtual WebString name();
    45     virtual WebString description();
    46     virtual WebString version();
    47     virtual WebDOMStringList objectStores();
     44    virtual WebString name() const;
     45    virtual WebString keyPath() const;
     46    // FIXME: add index methods.
    4847
    49 private:
    50     WTF::RefPtr<WebCore::IDBDatabase> m_idbDatabase;
     48 private:
     49    WTF::RefPtr<WebCore::IDBObjectStore> m_idbObjectStore;
    5150};
    5251
    5352} // namespace WebKit
    5453
    55 #endif // WebIDBDatabaseImpl_h
     54#endif // WebIDBObjectStoreImpl_h
  • trunk/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp

    r60484 r60776  
    6060void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*)
    6161{
    62     m_indexedDatabase->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0);   
     62    m_indexedDatabase->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0);
    6363}
    6464
Note: See TracChangeset for help on using the changeset viewer.