2010-05-26 Andrei Popescu <andreip@google.com>
Reviewed by Jeremy Orlow.
Indexed Database component is missing IDBObjectStoreRequest interface
https://bugs.webkit.org/show_bug.cgi?id=39490
Adding IDL and stub implementation for IDBObjectStoreRequest.
No new tests, indexed database isn't yet testable.
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pri:
* WebCore.pro:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSIDBObjectStoreRequestCustom.cpp: Added.
(WebCore::JSIDBObjectStoreRequest::remove):
(WebCore::JSIDBObjectStoreRequest::addOrModify):
(WebCore::JSIDBObjectStoreRequest::modify):
(WebCore::JSIDBObjectStoreRequest::add):
(WebCore::JSIDBObjectStoreRequest::get):
* bindings/v8/custom/V8IDBObjectStoreRequestCustom.cpp: Added.
(WebCore::V8IDBObjectStoreRequest::removeCallback):
(WebCore::V8IDBObjectStoreRequest::addOrModifyCallback):
(WebCore::V8IDBObjectStoreRequest::modifyCallback):
(WebCore::V8IDBObjectStoreRequest::addCallback):
(WebCore::V8IDBObjectStoreRequest::getCallback):
* storage/IDBObjectStore.cpp: Added.
* storage/IDBObjectStore.h: Added.
(WebCore::IDBObjectStore::~IDBObjectStore):
* storage/IDBObjectStoreRequest.cpp: Added.
(WebCore::IDBObjectStoreRequest::name):
(WebCore::IDBObjectStoreRequest::keyPath):
(WebCore::IDBObjectStoreRequest::IDBObjectStoreRequest):
* storage/IDBObjectStoreRequest.h: Added.
(WebCore::IDBObjectStoreRequest::create):
(WebCore::IDBObjectStoreRequest::~IDBObjectStoreRequest):
* storage/IDBObjectStoreRequest.idl: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60240 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 1a33902..b890c3a 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -327,6 +327,7 @@
storage/IDBDatabaseRequest.idl
storage/IDBErrorEvent.idl
storage/IDBEvent.idl
+ storage/IDBObjectStoreRequest.idl
storage/IDBRequest.idl
storage/IDBSuccessEvent.idl
storage/IndexedDatabaseRequest.idl
@@ -1366,6 +1367,8 @@
storage/IDBErrorEvent.cpp
storage/IDBEvent.cpp
storage/IDBRequest.cpp
+ storage/IDBObjectStore.cpp
+ storage/IDBObjectStoreRequest.cpp
storage/IDBSuccessEvent.cpp
storage/IndexedDatabase.cpp
storage/IndexedDatabaseImpl.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1c684e7..27ff2de 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,45 @@
+2010-05-26 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Indexed Database component is missing IDBObjectStoreRequest interface
+ https://bugs.webkit.org/show_bug.cgi?id=39490
+
+ Adding IDL and stub implementation for IDBObjectStoreRequest.
+
+ No new tests, indexed database isn't yet testable.
+
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSIDBObjectStoreRequestCustom.cpp: Added.
+ (WebCore::JSIDBObjectStoreRequest::remove):
+ (WebCore::JSIDBObjectStoreRequest::addOrModify):
+ (WebCore::JSIDBObjectStoreRequest::modify):
+ (WebCore::JSIDBObjectStoreRequest::add):
+ (WebCore::JSIDBObjectStoreRequest::get):
+ * bindings/v8/custom/V8IDBObjectStoreRequestCustom.cpp: Added.
+ (WebCore::V8IDBObjectStoreRequest::removeCallback):
+ (WebCore::V8IDBObjectStoreRequest::addOrModifyCallback):
+ (WebCore::V8IDBObjectStoreRequest::modifyCallback):
+ (WebCore::V8IDBObjectStoreRequest::addCallback):
+ (WebCore::V8IDBObjectStoreRequest::getCallback):
+ * storage/IDBObjectStore.cpp: Added.
+ * storage/IDBObjectStore.h: Added.
+ (WebCore::IDBObjectStore::~IDBObjectStore):
+ * storage/IDBObjectStoreRequest.cpp: Added.
+ (WebCore::IDBObjectStoreRequest::name):
+ (WebCore::IDBObjectStoreRequest::keyPath):
+ (WebCore::IDBObjectStoreRequest::IDBObjectStoreRequest):
+ * storage/IDBObjectStoreRequest.h: Added.
+ (WebCore::IDBObjectStoreRequest::create):
+ (WebCore::IDBObjectStoreRequest::~IDBObjectStoreRequest):
+ * storage/IDBObjectStoreRequest.idl: Added.
+
2010-05-26 Xan Lopez <xlopez@igalia.com>
Unreviewed GTK+ build fix.
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 3372972..e5d60ec 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -174,6 +174,7 @@
#include "JSIDBDatabaseRequest.cpp"
#include "JSIDBErrorEvent.cpp"
#include "JSIDBEvent.cpp"
+#include "JSIDBObjectStoreRequest.cpp"
#include "JSIDBRequest.cpp"
#include "JSIDBSuccessEvent.cpp"
#include "JSImageData.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index e2a1ad7..bd06130 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -217,6 +217,7 @@
IDBDatabaseRequest \
IDBErrorEvent \
IDBEvent \
+ IDBObjectStoreRequest \
IDBRequest \
IDBSuccessEvent \
ImageData \
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 4036a71..1bb671c 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2468,6 +2468,7 @@
WebCore/storage/IDBDatabaseRequest.idl \
WebCore/storage/IDBErrorEvent.idl \
WebCore/storage/IDBEvent.idl \
+ WebCore/storage/IDBObjectStoreRequest.idl \
WebCore/storage/IDBRequest.idl \
WebCore/storage/IDBSuccessEvent.idl \
WebCore/storage/IndexedDatabaseRequest.idl
@@ -2492,6 +2493,10 @@
WebCore/storage/IDBErrorEvent.h \
WebCore/storage/IDBEvent.cpp \
WebCore/storage/IDBEvent.h \
+ WebCore/storage/IDBObjectStore.cpp \
+ WebCore/storage/IDBObjectStore.h \
+ WebCore/storage/IDBObjectStoreRequest.cpp \
+ WebCore/storage/IDBObjectStoreRequest.h \
WebCore/storage/IDBRequest.cpp \
WebCore/storage/IDBRequest.h \
WebCore/storage/IDBSuccessEvent.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index cef2ba4..1401433 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -230,6 +230,7 @@
'storage/IDBDatabaseRequest.idl',
'storage/IDBErrorEvent.idl',
'storage/IDBEvent.idl',
+ 'storage/IDBObjectStoreRequest.idl',
'storage/IDBRequest.idl',
'storage/IDBSuccessEvent.idl',
'storage/IndexedDatabaseRequest.idl',
@@ -3363,6 +3364,10 @@
'storage/IDBEvent.h',
'storage/IDBErrorEvent.cpp',
'storage/IDBErrorEvent.h',
+ 'storage/IDBObjectStore.cpp',
+ 'storage/IDBObjectStore.h',
+ 'storage/IDBObjectStoreRequest.cpp',
+ 'storage/IDBObjectStoreRequest.h',
'storage/IDBRequest.cpp',
'storage/IDBRequest.h',
'storage/IDBSuccessEvent.cpp',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index b824f61..6184e54 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -450,6 +450,7 @@
storage/IDBDatabaseRequest.idl \
storage/IDBErrorEvent.idl \
storage/IDBEvent.idl \
+ storage/IDBObjectStoreRequest.idl \
storage/IDBRequest.idl \
storage/IDBSuccessEvent.idl \
storage/IndexedDatabaseRequest.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 64f7a20..62785f4 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2340,6 +2340,8 @@
storage/IDBDatabaseRequest.h \
storage/IDBErrorEvent.h \
storage/IDBEvent.h \
+ storage/IDBObjectStore.h \
+ storage/IDBObjectStoreRequest.h \
storage/IDBRequest.h \
storage/IDBSuccessEvent.h \
storage/IndexedDatabase.h \
@@ -2353,6 +2355,8 @@
storage/IDBDatabaseRequest.cpp \
storage/IDBErrorEvent.cpp \
storage/IDBEvent.cpp \
+ storage/IDBObjectStore.cpp \
+ storage/IDBObjectStoreRequest.cpp \
storage/IDBRequest.cpp \
storage/IDBSuccessEvent.cpp \
storage/IndexedDatabase.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 0c2573a..f0734a8 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -38564,6 +38564,62 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.cpp"
>
<FileConfiguration
@@ -43997,6 +44053,54 @@
>
</File>
<File
+ RelativePath="..\storage\IDBAny.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBDatabase.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBDatabaseRequest.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBEvent.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBErrorEvent.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBObjectStore.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBObjectStoreRequest.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBRequest.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IDBSuccessEvent.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IndexedDatabase.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IndexedDatabaseImpl.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\IndexedDatabaseRequest.cpp"
+ >
+ </File>
+ <File
RelativePath="..\storage\LocalStorageTask.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 1cca5f6..8b889b9 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4231,6 +4231,13 @@
B5C1123B102B6C4600096578 /* SQLTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5C11239102B6C4600096578 /* SQLTransactionCoordinator.cpp */; };
B5C1123C102B6C4600096578 /* SQLTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */; };
B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D36019112F8B560048DEA8 /* DatabaseCallback.h */; };
+ B627FB2D11AD743500E97B72 /* IDBDatabaseImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50AD2A911AC1631008CF2FB /* IDBDatabaseImpl.cpp */; };
+ B6693EEB11AD63E6003F2770 /* IDBObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6693EE711AD63E6003F2770 /* IDBObjectStore.cpp */; };
+ B6693EEC11AD63E6003F2770 /* IDBObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = B6693EE811AD63E6003F2770 /* IDBObjectStore.h */; };
+ B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */; };
+ B6693EEE11AD63E6003F2770 /* IDBObjectStoreRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B6693EEA11AD63E6003F2770 /* IDBObjectStoreRequest.h */; };
+ B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6693EF011AD6486003F2770 /* JSIDBObjectStoreRequest.cpp */; };
+ B6693EF311AD6486003F2770 /* JSIDBObjectStoreRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = B6693EF111AD6486003F2770 /* JSIDBObjectStoreRequest.h */; };
B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */ = {isa = PBXBuildFile; fileRef = B776D43A1104525D00BEB0EC /* PrintContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
B734B181119B9911006587BD /* FontTranscoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B734B180119B9911006587BD /* FontTranscoder.cpp */; };
B734B183119B991D006587BD /* FontTranscoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B734B182119B991D006587BD /* FontTranscoder.h */; };
@@ -9701,6 +9708,13 @@
B5C11239102B6C4600096578 /* SQLTransactionCoordinator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLTransactionCoordinator.cpp; sourceTree = "<group>"; };
B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionCoordinator.h; sourceTree = "<group>"; };
B5D36019112F8B560048DEA8 /* DatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseCallback.h; sourceTree = "<group>"; };
+ B6693EE711AD63E6003F2770 /* IDBObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStore.cpp; sourceTree = "<group>"; };
+ B6693EE811AD63E6003F2770 /* IDBObjectStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStore.h; sourceTree = "<group>"; };
+ B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBObjectStoreRequest.cpp; sourceTree = "<group>"; };
+ B6693EEA11AD63E6003F2770 /* IDBObjectStoreRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBObjectStoreRequest.h; sourceTree = "<group>"; };
+ B6693EEF11AD63F6003F2770 /* IDBObjectStoreRequest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBObjectStoreRequest.idl; sourceTree = "<group>"; };
+ B6693EF011AD6486003F2770 /* JSIDBObjectStoreRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBObjectStoreRequest.cpp; sourceTree = "<group>"; };
+ B6693EF111AD6486003F2770 /* JSIDBObjectStoreRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBObjectStoreRequest.h; sourceTree = "<group>"; };
B734B180119B9911006587BD /* FontTranscoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontTranscoder.cpp; path = transcoder/FontTranscoder.cpp; sourceTree = "<group>"; };
B734B182119B991D006587BD /* FontTranscoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontTranscoder.h; path = transcoder/FontTranscoder.h; sourceTree = "<group>"; };
B776D43A1104525D00BEB0EC /* PrintContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrintContext.h; sourceTree = "<group>"; };
@@ -10977,6 +10991,11 @@
1AE82EC90CAAE177002237AE /* storage */ = {
isa = PBXGroup;
children = (
+ B6693EEF11AD63F6003F2770 /* IDBObjectStoreRequest.idl */,
+ B6693EE711AD63E6003F2770 /* IDBObjectStore.cpp */,
+ B6693EE811AD63E6003F2770 /* IDBObjectStore.h */,
+ B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */,
+ B6693EEA11AD63E6003F2770 /* IDBObjectStoreRequest.h */,
B5B5DC67119BB3D5002A8790 /* AbstractDatabase.cpp */,
B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */,
514185ED0CD65F0400763C99 /* ChangeVersionWrapper.cpp */,
@@ -14378,6 +14397,8 @@
C56C919D119D918100DE4CD9 /* JSIDBErrorEvent.h */,
C56C919E119D918100DE4CD9 /* JSIDBEvent.cpp */,
C56C919F119D918100DE4CD9 /* JSIDBEvent.h */,
+ B6693EF011AD6486003F2770 /* JSIDBObjectStoreRequest.cpp */,
+ B6693EF111AD6486003F2770 /* JSIDBObjectStoreRequest.h */,
C5F4F404119306AC00FDFADD /* JSIDBRequest.cpp */,
C5F4F405119306AC00FDFADD /* JSIDBRequest.h */,
C56C91A4119D918700DE4CD9 /* JSIDBSuccessEvent.cpp */,
@@ -19339,6 +19360,9 @@
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
+ B6693EEC11AD63E6003F2770 /* IDBObjectStore.h in Headers */,
+ B6693EEE11AD63E6003F2770 /* IDBObjectStoreRequest.h in Headers */,
+ B6693EF311AD6486003F2770 /* JSIDBObjectStoreRequest.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -21629,6 +21653,10 @@
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
A456FA2611AD4A830020B420 /* LabelsNodeList.cpp in Sources */,
+ B6693EEB11AD63E6003F2770 /* IDBObjectStore.cpp in Sources */,
+ B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */,
+ B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */,
+ B627FB2D11AD743500E97B72 /* IDBDatabaseImpl.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/bindings/js/JSIDBAnyCustom.cpp b/WebCore/bindings/js/JSIDBAnyCustom.cpp
index f7674b8..dfdd216 100644
--- a/WebCore/bindings/js/JSIDBAnyCustom.cpp
+++ b/WebCore/bindings/js/JSIDBAnyCustom.cpp
@@ -36,8 +36,10 @@
#include "IDBAny.h"
#include "IDBDatabaseRequest.h"
+#include "IDBObjectStoreRequest.h"
#include "IndexedDatabaseRequest.h"
#include "JSIDBDatabaseRequest.h"
+#include "JSIDBObjectStoreRequest.h"
#include "JSIndexedDatabaseRequest.h"
#include "SerializedScriptValue.h"
@@ -55,6 +57,8 @@
return jsUndefined();
case IDBAny::IDBDatabaseRequestType:
return toJS(exec, globalObject, idbAny->idbDatabaseRequest());
+ case IDBAny::IDBObjectStoreRequestType:
+ return toJS(exec, globalObject, idbAny->idbObjectStoreRequest());
case IDBAny::IndexedDatabaseRequestType:
return toJS(exec, globalObject, idbAny->indexedDatabaseRequest());
case IDBAny::SerializedScriptValueType:
diff --git a/WebCore/bindings/v8/custom/V8IDBAnyCustom.cpp b/WebCore/bindings/v8/custom/V8IDBAnyCustom.cpp
index 2e20e82..0db2a80 100644
--- a/WebCore/bindings/v8/custom/V8IDBAnyCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8IDBAnyCustom.cpp
@@ -36,6 +36,7 @@
#include "SerializedScriptValue.h"
#include "V8IDBDatabaseRequest.h"
+#include "V8IDBObjectStoreRequest.h"
#include "V8IndexedDatabaseRequest.h"
namespace WebCore {
@@ -50,6 +51,8 @@
return v8::Undefined();
case IDBAny::IDBDatabaseRequestType:
return toV8(impl->idbDatabaseRequest());
+ case IDBAny::IDBObjectStoreRequestType:
+ return toV8(impl->idbObjectStoreRequest());
case IDBAny::IndexedDatabaseRequestType:
return toV8(impl->indexedDatabaseRequest());
case IDBAny::SerializedScriptValueType:
diff --git a/WebCore/storage/IDBAny.cpp b/WebCore/storage/IDBAny.cpp
index 17a8007..b5aba0b 100644
--- a/WebCore/storage/IDBAny.cpp
+++ b/WebCore/storage/IDBAny.cpp
@@ -32,6 +32,7 @@
#if ENABLE(INDEXED_DATABASE)
#include "IDBDatabaseRequest.h"
+#include "IDBObjectStoreRequest.h"
#include "IndexedDatabaseRequest.h"
#include "SerializedScriptValue.h"
@@ -57,6 +58,12 @@
return m_idbDatabaseRequest;
}
+PassRefPtr<IDBObjectStoreRequest> IDBAny::idbObjectStoreRequest()
+{
+ ASSERT(m_type == IDBObjectStoreRequestType);
+ return m_idbObjectStoreRequest;
+}
+
PassRefPtr<IndexedDatabaseRequest> IDBAny::indexedDatabaseRequest()
{
ASSERT(m_type == IndexedDatabaseRequestType);
@@ -73,6 +80,16 @@
{
m_type = IDBDatabaseRequestType;
m_idbDatabaseRequest = value;
+ m_idbObjectStoreRequest = 0;
+ m_indexedDatabaseRequest = 0;
+ m_serializedScriptValue = 0;
+}
+
+void IDBAny::set(PassRefPtr<IDBObjectStoreRequest> value)
+{
+ m_type = IDBObjectStoreRequestType;
+ m_idbDatabaseRequest = 0;
+ m_idbObjectStoreRequest = value;
m_indexedDatabaseRequest = 0;
m_serializedScriptValue = 0;
}
@@ -81,6 +98,7 @@
{
m_type = IndexedDatabaseRequestType;
m_idbDatabaseRequest = 0;
+ m_idbObjectStoreRequest = 0;
m_indexedDatabaseRequest = value;
m_serializedScriptValue = 0;
}
@@ -89,6 +107,7 @@
{
m_type = SerializedScriptValueType;
m_idbDatabaseRequest = 0;
+ m_idbObjectStoreRequest = 0;
m_indexedDatabaseRequest = 0;
m_serializedScriptValue = value;
}
diff --git a/WebCore/storage/IDBAny.h b/WebCore/storage/IDBAny.h
index 56c57e2..d23f18f 100644
--- a/WebCore/storage/IDBAny.h
+++ b/WebCore/storage/IDBAny.h
@@ -38,6 +38,7 @@
namespace WebCore {
class IDBDatabaseRequest;
+class IDBObjectStoreRequest;
class IndexedDatabaseRequest;
class SerializedScriptValue;
@@ -49,6 +50,7 @@
enum Type {
UndefinedType = 0,
IDBDatabaseRequestType,
+ IDBObjectStoreRequestType,
IndexedDatabaseRequestType,
SerializedScriptValueType
};
@@ -56,10 +58,12 @@
Type type() const { return m_type; }
PassRefPtr<IDBDatabaseRequest> idbDatabaseRequest();
+ PassRefPtr<IDBObjectStoreRequest> idbObjectStoreRequest();
PassRefPtr<IndexedDatabaseRequest> indexedDatabaseRequest();
PassRefPtr<SerializedScriptValue> serializedScriptValue();
void set(PassRefPtr<IDBDatabaseRequest>);
+ void set(PassRefPtr<IDBObjectStoreRequest>);
void set(PassRefPtr<IndexedDatabaseRequest>);
void set(PassRefPtr<SerializedScriptValue>);
@@ -70,6 +74,7 @@
// Only one of the following should ever be in use at any given time.
RefPtr<IDBDatabaseRequest> m_idbDatabaseRequest;
+ RefPtr<IDBObjectStoreRequest> m_idbObjectStoreRequest;
RefPtr<IndexedDatabaseRequest> m_indexedDatabaseRequest;
RefPtr<SerializedScriptValue> m_serializedScriptValue;
};
diff --git a/WebCore/storage/IDBObjectStore.cpp b/WebCore/storage/IDBObjectStore.cpp
new file mode 100644
index 0000000..0a0cd3c
--- /dev/null
+++ b/WebCore/storage/IDBObjectStore.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IDBObjectStore.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+// FIXME: Write.
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IDBObjectStore.h b/WebCore/storage/IDBObjectStore.h
new file mode 100644
index 0000000..7364026
--- /dev/null
+++ b/WebCore/storage/IDBObjectStore.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IDBObjectStore_h
+#define IDBObjectStore_h
+
+#include "PlatformString.h"
+#include <wtf/Threading.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBObjectStore : public ThreadSafeShared<IDBObjectStore> {
+public:
+ static PassRefPtr<IDBObjectStore> create()
+ {
+ return adoptRef(new IDBObjectStore());
+ }
+ virtual ~IDBObjectStore() { }
+
+ String name() const { return m_name; }
+ String keyPath() const { return m_keyPath; }
+
+private:
+ IDBObjectStore() { }
+
+ String m_name;
+ String m_keyPath;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBObjectStore_h
+
diff --git a/WebCore/storage/IDBObjectStoreRequest.cpp b/WebCore/storage/IDBObjectStoreRequest.cpp
new file mode 100644
index 0000000..008e7b4
--- /dev/null
+++ b/WebCore/storage/IDBObjectStoreRequest.cpp
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "IDBObjectStoreRequest.h"
+
+#include "IDBAny.h"
+#include "ScriptExecutionContext.h"
+#include "SerializedScriptValue.h"
+#include <wtf/UnusedParam.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+IDBObjectStoreRequest::IDBObjectStoreRequest(ScriptExecutionContext* context, PassRefPtr<IDBObjectStore> idbStore)
+ : m_objectStore(idbStore)
+ , m_scriptExecutionContext(context)
+{
+ m_this = IDBAny::create();
+ m_this->set(this);
+}
+
+String IDBObjectStoreRequest::name() const
+{
+ ASSERT(m_objectStore);
+ return m_objectStore->name();
+}
+
+String IDBObjectStoreRequest::keyPath() const
+{
+ ASSERT(m_objectStore);
+ return m_objectStore->keyPath();
+}
+
+PassRefPtr<IDBRequest> IDBObjectStoreRequest::get(PassRefPtr<SerializedScriptValue> key)
+{
+ // FIXME: implement
+ UNUSED_PARAM(key);
+ return 0;
+}
+
+PassRefPtr<IDBRequest> IDBObjectStoreRequest::add(PassRefPtr<SerializedScriptValue> value, PassRefPtr<SerializedScriptValue> key)
+{
+ // FIXME: implement
+ UNUSED_PARAM(value);
+ UNUSED_PARAM(key);
+ return 0;
+}
+
+PassRefPtr<IDBRequest> IDBObjectStoreRequest::modify(PassRefPtr<SerializedScriptValue> value, PassRefPtr<SerializedScriptValue> key)
+{
+ // FIXME: implement
+ UNUSED_PARAM(value);
+ UNUSED_PARAM(key);
+ return 0;
+}
+
+PassRefPtr<IDBRequest> IDBObjectStoreRequest::addOrModify(PassRefPtr<SerializedScriptValue> value, PassRefPtr<SerializedScriptValue> key)
+{
+ // FIXME: implement
+ UNUSED_PARAM(value);
+ UNUSED_PARAM(key);
+ return 0;
+}
+
+PassRefPtr<IDBRequest> IDBObjectStoreRequest::remove(PassRefPtr<SerializedScriptValue> key)
+{
+ // FIXME: implement
+ UNUSED_PARAM(key);
+ return 0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBObjectStoreRequest.h b/WebCore/storage/IDBObjectStoreRequest.h
new file mode 100644
index 0000000..7d8714e
--- /dev/null
+++ b/WebCore/storage/IDBObjectStoreRequest.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IDBObjectStoreRequest_h
+#define IDBObjectStoreRequest_h
+
+#include "IDBObjectStore.h"
+#include "IDBRequest.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBAny;
+class ScriptExecutionContext;
+class SerializedScriptValue;
+
+class IDBObjectStoreRequest : public RefCounted<IDBObjectStoreRequest> {
+public:
+ static PassRefPtr<IDBObjectStoreRequest> create(ScriptExecutionContext* context, PassRefPtr<IDBObjectStore> idbObjectStore)
+ {
+ return adoptRef(new IDBObjectStoreRequest(context, idbObjectStore));
+ }
+ ~IDBObjectStoreRequest() { }
+
+ String name() const;
+ String keyPath() const;
+
+ PassRefPtr<IDBRequest> get(PassRefPtr<SerializedScriptValue> key);
+ PassRefPtr<IDBRequest> add(PassRefPtr<SerializedScriptValue> value, PassRefPtr<SerializedScriptValue> key = 0);
+ PassRefPtr<IDBRequest> modify(PassRefPtr<SerializedScriptValue> value, PassRefPtr<SerializedScriptValue> key = 0);
+ PassRefPtr<IDBRequest> addOrModify(PassRefPtr<SerializedScriptValue> value, PassRefPtr<SerializedScriptValue> key = 0);
+ PassRefPtr<IDBRequest> remove(PassRefPtr<SerializedScriptValue> key);
+
+private:
+ IDBObjectStoreRequest(ScriptExecutionContext*, PassRefPtr<IDBObjectStore>);
+
+ RefPtr<IDBObjectStore> m_objectStore;
+ RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
+ RefPtr<IDBAny> m_this;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBDatabaseRequest_h
+
diff --git a/WebCore/storage/IDBObjectStoreRequest.idl b/WebCore/storage/IDBObjectStoreRequest.idl
new file mode 100644
index 0000000..c79a2e8
--- /dev/null
+++ b/WebCore/storage/IDBObjectStoreRequest.idl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module storage {
+
+ interface [
+ Conditional=INDEXED_DATABASE
+ ] IDBObjectStoreRequest {
+ IDBRequest get(in SerializedScriptValue key);
+ IDBRequest add(in SerializedScriptValue value, in [Optional] SerializedScriptValue key);
+ IDBRequest modify(in SerializedScriptValue value, in [Optional] SerializedScriptValue key);
+ IDBRequest addOrModify(in SerializedScriptValue value, in [Optional] SerializedScriptValue key);
+ IDBRequest remove(in SerializedScriptValue key);
+
+ readonly attribute DOMString name;
+ readonly attribute DOMString keyPath;
+ // FIXME: add indexNames property.
+ };
+}