[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
dumi at chromium.org
dumi at chromium.org
Wed Dec 22 11:50:53 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c5a39843f294c17428cab73558d89e6e5a0cd087
Author: dumi at chromium.org <dumi at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Aug 9 21:36:24 2010 +0000
WebCore: Auto-generate most HTML5 DB bindings.
https://bugs.webkit.org/show_bug.cgi?id=43382
Reviewed by Adam Barth.
* Android.jscbindings.mk: Remove {JS|V8}Database{Sync}Custom.cpp
and the custom implementations of openDatabase{Sync}().
* Android.v8bindings.mk:
* CMakeLists.txt:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDatabaseCustom.cpp: Removed.
* bindings/js/JSDatabaseSyncCustom.cpp: Removed.
* bindings/js/JSWorkerContextCustom.cpp:
* bindings/v8/custom/V8DOMWindowCustom.cpp:
* bindings/v8/custom/V8DatabaseCustom.cpp: Removed.
* bindings/v8/custom/V8DatabaseSyncCustom.cpp: Removed.
* bindings/v8/custom/V8WorkerContextCustom.cpp:
* bindings/scripts/CodeGeneratorGObject.pm: Change the code generators
to check that each value can be converted to the respective
argument type.
* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/CodeGeneratorV8.pm:
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::~JSTestCallback):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgs):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionSerializedValue):
(WebCore::jsTestObjPrototypeFunctionIdbKey):
(WebCore::jsTestObjPrototypeFunctionCustomArgsAndException):
(WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndArg):
(WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg):
(WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture):
(WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjInternal::voidMethodWithArgsCallback):
(WebCore::TestObjInternal::intMethodWithArgsCallback):
(WebCore::TestObjInternal::objMethodWithArgsCallback):
(WebCore::TestObjInternal::methodThatRequiresAllArgsCallback):
(WebCore::TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback):
(WebCore::TestObjInternal::idbKeyCallback):
(WebCore::TestObjInternal::customArgsAndExceptionCallback):
(WebCore::TestObjInternal::withDynamicFrameAndArgCallback):
(WebCore::TestObjInternal::withDynamicFrameAndOptionalArgCallback):
(WebCore::TestObjInternal::withDynamicFrameAndUserGestureCallback):
(WebCore::TestObjInternal::withDynamicFrameAndUserGestureASADCallback):
(WebCore::TestObjInternal::methodWithOptionalArgCallback):
(WebCore::TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback):
(WebCore::TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback):
(WebCore::TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback):
(WebCore::TestObjInternal::methodWithCallbackAndOptionalArgCallback):
(WebCore::TestObjInternal::overloadedMethod1Callback):
(WebCore::TestObjInternal::overloadedMethod2Callback):
(WebCore::TestObjInternal::overloadedMethod3Callback):
(WebCore::TestObjInternal::overloadedMethod4Callback):
(WebCore::):
(WebCore::ConfigureV8TestObjTemplate):
* bindings/v8/custom/V8BindingMacros.h:
* bindings/v8/V8Binding.h: Minor changes required to support the
auto-generated bindings.
(WebCore::V8Parameter::V8Parameter):
* bindings/v8/custom/V8SQLTransactionCustom.cpp:
(WebCore::V8SQLTransaction::executeSqlCallback):
* bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
(WebCore::V8SQLTransactionSync::executeSqlCallback):
* page/DOMWindow.idl:
* storage/Database.cpp:
(WebCore::Database::transaction):
(WebCore::Database::readTransaction):
(WebCore::Database::runTransaction):
* storage/Database.h:
* storage/Database.idl:
* storage/DatabaseSync.cpp:
(WebCore::DatabaseSync::transaction):
(WebCore::DatabaseSync::readTransaction):
(WebCore::DatabaseSync::runTransaction):
* storage/DatabaseSync.h:
* storage/DatabaseSync.idl:
* workers/WorkerContext.idl:
LayoutTests: Changing the expected error message for a test.
https://bugs.webkit.org/show_bug.cgi?id=43382
Reviewed by Adam Barth.
* fast/workers/storage/open-database-inputs-sync-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0c64ead..d8b8fd7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-09 Dumitru Daniliuc <dumi at chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Changing the expected error message for a test.
+ https://bugs.webkit.org/show_bug.cgi?id=43382
+
+ * fast/workers/storage/open-database-inputs-sync-expected.txt:
+
2010-08-09 Zhenyao Mo <zmo at google.com>
Reviewed by David Levin.
diff --git a/LayoutTests/fast/workers/storage/open-database-inputs-sync-expected.txt b/LayoutTests/fast/workers/storage/open-database-inputs-sync-expected.txt
index 866c846..1235550 100644
--- a/LayoutTests/fast/workers/storage/open-database-inputs-sync-expected.txt
+++ b/LayoutTests/fast/workers/storage/open-database-inputs-sync-expected.txt
@@ -1,6 +1,6 @@
This test makes sure that openDatabaseSync() accepts only valid parameters.
-PASS: SYNTAX_ERR: DOM Exception 12
-PASS: SYNTAX_ERR: DOM Exception 12
+PASS: Not enough arguments
+PASS: Not enough arguments
PASS: undefined
PASS: undefined
PASS: undefined
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index 7013066..c007dc9 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -90,7 +90,6 @@ LOCAL_SRC_FILES += \
bindings/js/JSDatabaseCallback.cpp \
bindings/js/JSDataGridColumnListCustom.cpp \
bindings/js/JSDataGridDataSource.cpp \
- bindings/js/JSDatabaseCustom.cpp \
bindings/js/JSDedicatedWorkerContextCustom.cpp \
bindings/js/JSDesktopNotificationsCustom.cpp \
bindings/js/JSDeviceMotionEventCustom.cpp \
diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk
index 7074636..52078d1 100644
--- a/WebCore/Android.v8bindings.mk
+++ b/WebCore/Android.v8bindings.mk
@@ -106,7 +106,6 @@ LOCAL_SRC_FILES += \
bindings/v8/custom/V8DOMWindowCustom.cpp \
bindings/v8/custom/V8DataGridColumnListCustom.cpp \
bindings/v8/custom/V8DatabaseCallback.cpp \
- bindings/v8/custom/V8DatabaseCustom.cpp \
bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
bindings/v8/custom/V8DeviceMotionEventCustom.cpp \
bindings/v8/custom/V8DeviceOrientationEventCustom.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 64d12ed..5a7b99b 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -590,9 +590,6 @@ SET(WebCore_SOURCES
bindings/js/JSCustomSQLStatementErrorCallback.cpp
bindings/js/JSCustomVoidCallback.cpp
bindings/js/JSCustomXPathNSResolver.cpp
- bindings/js/JSDatabaseCustom.cpp
- bindings/js/JSDatabaseCustom.cpp
- bindings/js/JSDatabaseSyncCustom.cpp
bindings/js/JSDataGridColumnListCustom.cpp
bindings/js/JSDataGridDataSource.cpp
bindings/js/JSDebugWrapperSet.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 133b97b..843ca49 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,106 @@
+2010-08-09 Dumitru Daniliuc <dumi at chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Auto-generate most HTML5 DB bindings.
+ https://bugs.webkit.org/show_bug.cgi?id=43382
+
+ * Android.jscbindings.mk: Remove {JS|V8}Database{Sync}Custom.cpp
+ and the custom implementations of openDatabase{Sync}().
+ * Android.v8bindings.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ * bindings/js/JSDatabaseCustom.cpp: Removed.
+ * bindings/js/JSDatabaseSyncCustom.cpp: Removed.
+ * bindings/js/JSWorkerContextCustom.cpp:
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ * bindings/v8/custom/V8DatabaseCustom.cpp: Removed.
+ * bindings/v8/custom/V8DatabaseSyncCustom.cpp: Removed.
+ * bindings/v8/custom/V8WorkerContextCustom.cpp:
+
+ * bindings/scripts/CodeGeneratorGObject.pm: Change the code generators
+ to check that each value can be converted to the respective
+ argument type.
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/JS/JSTestCallback.cpp:
+ (WebCore::JSTestCallback::~JSTestCallback):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgs):
+ (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
+ (WebCore::jsTestObjPrototypeFunctionSerializedValue):
+ (WebCore::jsTestObjPrototypeFunctionIdbKey):
+ (WebCore::jsTestObjPrototypeFunctionCustomArgsAndException):
+ (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndArg):
+ (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg):
+ (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture):
+ (WebCore::jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::voidMethodWithArgsCallback):
+ (WebCore::TestObjInternal::intMethodWithArgsCallback):
+ (WebCore::TestObjInternal::objMethodWithArgsCallback):
+ (WebCore::TestObjInternal::methodThatRequiresAllArgsCallback):
+ (WebCore::TestObjInternal::methodThatRequiresAllArgsAndThrowsCallback):
+ (WebCore::TestObjInternal::idbKeyCallback):
+ (WebCore::TestObjInternal::customArgsAndExceptionCallback):
+ (WebCore::TestObjInternal::withDynamicFrameAndArgCallback):
+ (WebCore::TestObjInternal::withDynamicFrameAndOptionalArgCallback):
+ (WebCore::TestObjInternal::withDynamicFrameAndUserGestureCallback):
+ (WebCore::TestObjInternal::withDynamicFrameAndUserGestureASADCallback):
+ (WebCore::TestObjInternal::methodWithOptionalArgCallback):
+ (WebCore::TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback):
+ (WebCore::TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback):
+ (WebCore::TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback):
+ (WebCore::TestObjInternal::methodWithCallbackAndOptionalArgCallback):
+ (WebCore::TestObjInternal::overloadedMethod1Callback):
+ (WebCore::TestObjInternal::overloadedMethod2Callback):
+ (WebCore::TestObjInternal::overloadedMethod3Callback):
+ (WebCore::TestObjInternal::overloadedMethod4Callback):
+ (WebCore::):
+ (WebCore::ConfigureV8TestObjTemplate):
+ * bindings/v8/custom/V8BindingMacros.h:
+
+ * bindings/v8/V8Binding.h: Minor changes required to support the
+ auto-generated bindings.
+ (WebCore::V8Parameter::V8Parameter):
+ * bindings/v8/custom/V8SQLTransactionCustom.cpp:
+ (WebCore::V8SQLTransaction::executeSqlCallback):
+ * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
+ (WebCore::V8SQLTransactionSync::executeSqlCallback):
+ * page/DOMWindow.idl:
+ * storage/Database.cpp:
+ (WebCore::Database::transaction):
+ (WebCore::Database::readTransaction):
+ (WebCore::Database::runTransaction):
+ * storage/Database.h:
+ * storage/Database.idl:
+ * storage/DatabaseSync.cpp:
+ (WebCore::DatabaseSync::transaction):
+ (WebCore::DatabaseSync::readTransaction):
+ (WebCore::DatabaseSync::runTransaction):
+ * storage/DatabaseSync.h:
+ * storage/DatabaseSync.idl:
+ * workers/WorkerContext.idl:
+
2010-08-09 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index aba0ff1..f41ab3b 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2743,8 +2743,6 @@ webcore_built_sources += \
webcore_sources += \
WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp \
- WebCore/bindings/js/JSDatabaseCustom.cpp \
- WebCore/bindings/js/JSDatabaseSyncCustom.cpp \
WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp \
WebCore/bindings/js/JSSQLTransactionCustom.cpp \
WebCore/bindings/js/JSSQLTransactionSyncCustom.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index b9814b7..76479e3 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -543,8 +543,6 @@
'bindings/js/JSCustomVoidCallback.h',
'bindings/js/JSCustomXPathNSResolver.cpp',
'bindings/js/JSCustomXPathNSResolver.h',
- 'bindings/js/JSDatabaseCustom.cpp',
- 'bindings/js/JSDatabaseSyncCustom.cpp',
'bindings/js/JSDataGridColumnListCustom.cpp',
'bindings/js/JSDataGridDataSource.cpp',
'bindings/js/JSDataGridDataSource.h',
@@ -742,8 +740,6 @@
'bindings/v8/custom/V8CustomVoidCallback.h',
'bindings/v8/custom/V8CustomXPathNSResolver.cpp',
'bindings/v8/custom/V8CustomXPathNSResolver.h',
- 'bindings/v8/custom/V8DatabaseCustom.cpp',
- 'bindings/v8/custom/V8DatabaseSyncCustom.cpp',
'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
'bindings/v8/custom/V8DeviceMotionEventCustom.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 3544579..513db3b 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2425,8 +2425,6 @@ contains(DEFINES, ENABLE_DATABASE=1) {
storage/SQLTransactionCoordinator.cpp \
storage/SQLTransactionSync.cpp \
bindings/js/JSCustomSQLStatementErrorCallback.cpp \
- bindings/js/JSDatabaseCustom.cpp \
- bindings/js/JSDatabaseSyncCustom.cpp \
bindings/js/JSSQLResultSetRowListCustom.cpp \
bindings/js/JSSQLTransactionCustom.cpp \
bindings/js/JSSQLTransactionSyncCustom.cpp
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index ca90df4..bcb9689 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -42180,110 +42180,6 @@
>
</File>
<File
- RelativePath="..\bindings\js\JSDatabaseCustom.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="..\bindings\js\JSDatabaseSyncCustom.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="..\bindings\js\JSDataGridColumnListCustom.cpp"
>
<FileConfiguration
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index cc67b6d..b06936d 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4364,7 +4364,6 @@
B550B52611DC68A800923885 /* SQLStatementSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B550B52211DC68A800923885 /* SQLStatementSync.h */; };
B55D5AA4119131FC00BCC315 /* JSSQLTransactionSyncCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */; };
B55D5AA5119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */; };
- B55D5AA81191325000BCC315 /* JSDatabaseSyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA61191325000BCC315 /* JSDatabaseSyncCustom.cpp */; };
B55D5AA91191325000BCC315 /* JSSQLTransactionSyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA71191325000BCC315 /* JSSQLTransactionSyncCustom.cpp */; };
B56EBA8511C9FF8100B04477 /* SQLException.h in Headers */ = {isa = PBXBuildFile; fileRef = B56EBA8311C9FF8100B04477 /* SQLException.h */; };
B58CEB6911913607002A6790 /* JSDatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6711913607002A6790 /* JSDatabaseSync.h */; };
@@ -4822,7 +4821,6 @@
BCCBE7B50E07166900EAFA8E /* CSSVariableDependentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCBE7B40E07166900EAFA8E /* CSSVariableDependentValue.cpp */; };
BCCD74DC0A4C8D35005FDA6D /* HTMLViewSourceDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */; };
BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */; };
- BCCE58AC1061E8CF008FB35A /* JSDatabaseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCE58AB1061E8CF008FB35A /* JSDatabaseCustom.cpp */; };
BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCFBAE70B5152ED0001F1D7 /* DocumentParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCD0E0FA0E972C3500265DEA /* SecurityOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */; };
BCD0E0FB0E972C3500265DEA /* SecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD0E0F80E972C3500265DEA /* SecurityOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -10065,7 +10063,6 @@
B550B52211DC68A800923885 /* SQLStatementSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatementSync.h; sourceTree = "<group>"; };
B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSyncCallback.h; sourceTree = "<group>"; };
B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionSyncCallback.cpp; sourceTree = "<group>"; };
- B55D5AA61191325000BCC315 /* JSDatabaseSyncCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSyncCustom.cpp; sourceTree = "<group>"; };
B55D5AA71191325000BCC315 /* JSSQLTransactionSyncCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionSyncCustom.cpp; sourceTree = "<group>"; };
B55D5ABB1191327200BCC315 /* DatabaseSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DatabaseSync.idl; sourceTree = "<group>"; };
B55D5ABC1191327200BCC315 /* SQLTransactionSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SQLTransactionSync.idl; sourceTree = "<group>"; };
@@ -10560,7 +10557,6 @@
BCCBE7B40E07166900EAFA8E /* CSSVariableDependentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableDependentValue.cpp; sourceTree = "<group>"; };
BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLViewSourceDocument.h; sourceTree = "<group>"; };
BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLViewSourceDocument.cpp; sourceTree = "<group>"; };
- BCCE58AB1061E8CF008FB35A /* JSDatabaseCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseCustom.cpp; sourceTree = "<group>"; };
BCCFBAE70B5152ED0001F1D7 /* DocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DocumentParser.h; sourceTree = "<group>"; };
BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecurityOrigin.cpp; sourceTree = "<group>"; };
BCD0E0F80E972C3500265DEA /* SecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityOrigin.h; sourceTree = "<group>"; };
@@ -16026,8 +16022,6 @@
9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */,
BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
BC20FB7E0C0E8E6C00D1447F /* JSCSSValueCustom.cpp */,
- BCCE58AB1061E8CF008FB35A /* JSDatabaseCustom.cpp */,
- B55D5AA61191325000BCC315 /* JSDatabaseSyncCustom.cpp */,
BC77D1510FF19C730070887B /* JSDataGridColumnListCustom.cpp */,
4162A453101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp */,
33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
@@ -21320,9 +21314,7 @@
E10B93C30B73C291003ED890 /* JSCustomXPathNSResolver.cpp in Sources */,
1AE82F8F0CAAFA9D002237AE /* JSDatabase.cpp in Sources */,
B59DD69A119029E5007E9684 /* JSDatabaseCallback.cpp in Sources */,
- BCCE58AC1061E8CF008FB35A /* JSDatabaseCustom.cpp in Sources */,
B58CEB6A11913607002A6790 /* JSDatabaseSync.cpp in Sources */,
- B55D5AA81191325000BCC315 /* JSDatabaseSyncCustom.cpp in Sources */,
BC77D1690FF19F560070887B /* JSDataGridColumn.cpp in Sources */,
BC77D16B0FF19F560070887B /* JSDataGridColumnList.cpp in Sources */,
BC77D1520FF19C730070887B /* JSDataGridColumnListCustom.cpp in Sources */,
diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp
index bcec369..922e449 100644
--- a/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -57,8 +57,6 @@
#include "JSDOMWrapper.cpp"
#include "JSDataGridColumnListCustom.cpp"
#include "JSDataGridDataSource.cpp"
-#include "JSDatabaseCustom.cpp"
-#include "JSDatabaseSyncCustom.cpp"
#include "JSDebugWrapperSet.cpp"
#include "JSDedicatedWorkerContextCustom.cpp"
#include "JSDesktopNotificationsCustom.cpp"
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index 30d79b3..252ea93 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -22,7 +22,6 @@
#include "AtomicString.h"
#include "Chrome.h"
-#include "Database.h"
#include "DOMWindow.h"
#include "Document.h"
#include "ExceptionCode.h"
@@ -36,10 +35,6 @@
#include "HTMLDocument.h"
#include "History.h"
#include "JSAudioConstructor.h"
-#if ENABLE(DATABASE)
-#include "JSDatabase.h"
-#include "JSDatabaseCallback.h"
-#endif
#include "JSDOMWindowShell.h"
#include "JSEvent.h"
#include "JSEventListener.h"
@@ -1006,49 +1001,6 @@ JSValue JSDOMWindow::removeEventListener(ExecState* exec)
return jsUndefined();
}
-#if ENABLE(DATABASE)
-JSValue JSDOMWindow::openDatabase(ExecState* exec)
-{
- if (!allowsAccessFrom(exec) || (exec->argumentCount() < 4)) {
- setDOMException(exec, SYNTAX_ERR);
- return jsUndefined();
- }
-
- String name = ustringToString(exec->argument(0).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String version = ustringToString(exec->argument(1).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String displayName = ustringToString(exec->argument(2).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- // exec->argument(3) = estimated size
- unsigned long estimatedSize = exec->argument(3).toUInt32(exec);
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<DatabaseCallback> creationCallback;
- if (exec->argumentCount() >= 5) {
- if (!exec->argument(4).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- creationCallback = JSDatabaseCallback::create(asObject(exec->argument(4)), globalObject());
- }
-
- ExceptionCode ec = 0;
- JSValue result = toJS(exec, globalObject(), WTF::getPtr(impl()->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec)));
-
- setDOMException(exec, ec);
- return result;
-}
-#endif
-
DOMWindow* toDOMWindow(JSValue value)
{
if (!value.isObject())
diff --git a/WebCore/bindings/js/JSDatabaseCustom.cpp b/WebCore/bindings/js/JSDatabaseCustom.cpp
deleted file mode 100644
index 6733320..0000000
--- a/WebCore/bindings/js/JSDatabaseCustom.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2007 Apple 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * 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 "JSDatabase.h"
-
-#if ENABLE(DATABASE)
-
-#include "DOMWindow.h"
-#include "Database.h"
-#include "Document.h"
-#include "ExceptionCode.h"
-#include "JSSQLTransactionCallback.h"
-#include "JSSQLTransactionErrorCallback.h"
-#include "JSCustomVoidCallback.h"
-#include "JSDOMWindowCustom.h"
-#include "PlatformString.h"
-#include "SQLValue.h"
-#include <runtime/JSArray.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-JSValue JSDatabase::changeVersion(ExecState* exec)
-{
- String oldVersion = ustringToString(exec->argument(0).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String newVersion = ustringToString(exec->argument(1).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<SQLTransactionCallback> callback;
- if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) {
- JSObject* object = exec->argument(2).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- callback = JSSQLTransactionCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
- }
-
- RefPtr<SQLTransactionErrorCallback> errorCallback;
- if (exec->argumentCount() > 3 && !exec->argument(3).isNull()) {
- JSObject* object = exec->argument(3).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- errorCallback = JSSQLTransactionErrorCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
- }
-
- RefPtr<VoidCallback> successCallback;
- if (exec->argumentCount() > 4 && !exec->argument(4).isNull()) {
- JSObject* object = exec->argument(4).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- successCallback = JSCustomVoidCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
- }
-
- m_impl->changeVersion(oldVersion, newVersion, callback.release(), errorCallback.release(), successCallback.release());
-
- return jsUndefined();
-}
-
-static JSValue createTransaction(ExecState* exec, Database* database, JSDOMGlobalObject* globalObject, bool readOnly)
-{
- JSObject* object = exec->argument(0).getObject();
-
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- RefPtr<SQLTransactionCallback> callback(JSSQLTransactionCallback::create(object, globalObject));
- RefPtr<SQLTransactionErrorCallback> errorCallback;
- if (exec->argumentCount() > 1 && !exec->argument(1).isNull()) {
- object = exec->argument(1).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- errorCallback = JSSQLTransactionErrorCallback::create(object, globalObject);
- }
-
- RefPtr<VoidCallback> successCallback;
- if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) {
- object = exec->argument(2).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- successCallback = JSCustomVoidCallback::create(object, globalObject);
- }
-
- database->transaction(callback.release(), errorCallback.release(), successCallback.release(), readOnly);
- return jsUndefined();
-}
-
-JSValue JSDatabase::transaction(ExecState* exec)
-{
- return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), false);
-}
-
-JSValue JSDatabase::readTransaction(ExecState* exec)
-{
- return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), true);
-}
-
-}
-
-#endif // ENABLE(DATABASE)
diff --git a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp b/WebCore/bindings/js/JSDatabaseSyncCustom.cpp
deleted file mode 100644
index f929658..0000000
--- a/WebCore/bindings/js/JSDatabaseSyncCustom.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * 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 "JSDatabaseSync.h"
-
-#if ENABLE(DATABASE)
-
-#include "DatabaseSync.h"
-#include "ExceptionCode.h"
-#include "JSSQLTransactionSyncCallback.h"
-#include "PlatformString.h"
-#include "SQLValue.h"
-#include <runtime/JSArray.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-JSValue JSDatabaseSync::changeVersion(ExecState* exec)
-{
- String oldVersion = ustringToString(exec->argument(0).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String newVersion = ustringToString(exec->argument(1).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<SQLTransactionSyncCallback> callback;
- if (exec->argumentCount() > 2 && !exec->argument(2).isNull()) {
- JSObject* object = exec->argument(2).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- callback = JSSQLTransactionSyncCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
- }
-
- ExceptionCode ec = 0;
- m_impl->changeVersion(oldVersion, newVersion, callback.release(), ec);
- setDOMException(exec, ec);
-
- return jsUndefined();
-}
-
-static JSValue createTransaction(ExecState* exec, DatabaseSync* database, JSDOMGlobalObject* globalObject, bool readOnly)
-{
- JSObject* object = exec->argument(0).getObject();
- if (!object) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- RefPtr<SQLTransactionSyncCallback> callback(JSSQLTransactionSyncCallback::create(object, globalObject));
-
- ExceptionCode ec = 0;
- database->transaction(callback.release(), readOnly, ec);
- setDOMException(exec, ec);
-
- return jsUndefined();
-}
-
-JSValue JSDatabaseSync::transaction(ExecState* exec)
-{
- return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), false);
-}
-
-JSValue JSDatabaseSync::readTransaction(ExecState* exec)
-{
- return createTransaction(exec, m_impl.get(), static_cast<JSDOMGlobalObject*>(globalObject()), true);
-}
-
-}
-
-#endif // ENABLE(DATABASE)
diff --git a/WebCore/bindings/js/JSWorkerContextCustom.cpp b/WebCore/bindings/js/JSWorkerContextCustom.cpp
index b443f90..b8885cf 100644
--- a/WebCore/bindings/js/JSWorkerContextCustom.cpp
+++ b/WebCore/bindings/js/JSWorkerContextCustom.cpp
@@ -29,13 +29,6 @@
#include "JSWorkerContext.h"
-#if ENABLE(DATABASE)
-#include "Database.h"
-#include "DatabaseSync.h"
-#include "JSDatabase.h"
-#include "JSDatabaseCallback.h"
-#include "JSDatabaseSync.h"
-#endif
#include "ExceptionCode.h"
#include "JSDOMBinding.h"
#include "JSDOMGlobalObject.h"
@@ -153,89 +146,6 @@ JSValue JSWorkerContext::messageChannel(ExecState* exec) const
}
#endif
-#if ENABLE(DATABASE)
-JSValue JSWorkerContext::openDatabase(ExecState* exec)
-{
- if (exec->argumentCount() < 4) {
- setDOMException(exec, SYNTAX_ERR);
- return jsUndefined();
- }
-
- String name = ustringToString(exec->argument(0).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String version = ustringToString(exec->argument(1).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String displayName = ustringToString(exec->argument(2).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- // exec->argument(3) = estimated size
- unsigned long estimatedSize = exec->argument(3).toUInt32(exec);
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<DatabaseCallback> creationCallback;
- if (exec->argumentCount() >= 5) {
- if (!exec->argument(4).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- creationCallback = JSDatabaseCallback::create(asObject(exec->argument(4)), globalObject());
- }
-
- ExceptionCode ec = 0;
- JSValue result = toJS(exec, globalObject(), WTF::getPtr(impl()->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec)));
- setDOMException(exec, ec);
- return result;
-}
-
-JSValue JSWorkerContext::openDatabaseSync(ExecState* exec)
-{
- if (exec->argumentCount() < 4) {
- setDOMException(exec, SYNTAX_ERR);
- return jsUndefined();
- }
-
- String name = ustringToString(exec->argument(0).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String version = ustringToString(exec->argument(1).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- String displayName = ustringToString(exec->argument(2).toString(exec));
- if (exec->hadException())
- return jsUndefined();
-
- // exec->argument(3) = estimated size
- unsigned long estimatedSize = exec->argument(3).toUInt32(exec);
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<DatabaseCallback> creationCallback;
- if (exec->argumentCount() >= 5) {
- if (!exec->argument(4).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- creationCallback = JSDatabaseCallback::create(asObject(exec->argument(4)), globalObject());
- }
-
- ExceptionCode ec = 0;
- JSValue result = toJS(exec, globalObject(), WTF::getPtr(impl()->openDatabaseSync(name, version, displayName, estimatedSize, creationCallback.release(), ec)));
-
- setDOMException(exec, ec);
- return result;
-}
-#endif
-
} // namespace WebCore
#endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index f6a9419..d44d82f 100644
--- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -208,6 +208,14 @@ sub SkipFunction {
return 1;
}
+ # Skip functions that have ["Callback"] parameters, because this
+ # code generator doesn't know how to auto-generate callbacks.
+ foreach my $param (@{$function->parameters}) {
+ if ($param->extendedAttributes->{"Callback"}) {
+ return 1;
+ }
+ }
+
return 0;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 33820d8..200a95d 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -1853,12 +1853,20 @@ sub GenerateImplementation
my $requiresAllArguments = $function->signature->extendedAttributes->{"RequiresAllArguments"};
if ($requiresAllArguments) {
- push(@implContent, " if (exec->argumentCount() < $numParameters)\n");
- if ($requiresAllArguments eq "Raise") {
- push(@implContent, " return throwVMError(exec, createSyntaxError(exec, \"Not enough arguments\"));\n");
+ my $numMandatoryParams = @{$function->parameters};
+ foreach my $param (reverse(@{$function->parameters})) {
+ if ($param->extendedAttributes->{"Optional"}) {
+ $numMandatoryParams--;
} else {
- push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ last;
}
+ }
+ push(@implContent, " if (exec->argumentCount() < $numMandatoryParams)\n");
+ if ($requiresAllArguments eq "Raise") {
+ push(@implContent, " return throwVMError(exec, createSyntaxError(exec, \"Not enough arguments\"));\n");
+ } else {
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ }
}
if (@{$function->raisesExceptions}) {
@@ -1908,14 +1916,18 @@ sub GenerateImplementation
$paramIndex++;
}
+ $implIncludes{"ExceptionCode.h"} = 1;
+ $implIncludes{"JSDOMBinding.h"} = 1;
foreach my $parameter (@{$function->parameters}) {
- if ($parameter->extendedAttributes->{"Optional"}) {
+ # Optional callbacks should be treated differently, because they always have a default value (0),
+ # and we can reduce the number of overloaded functions that take a different number of parameters.
+ if ($parameter->extendedAttributes->{"Optional"} && !$parameter->extendedAttributes->{"Callback"}) {
# Generate early call if there are enough parameters.
if (!$hasOptionalArguments) {
push(@implContent, "\n int argsCount = exec->argumentCount();\n");
$hasOptionalArguments = 1;
}
- push(@implContent, " if (argsCount < " . ($argsIndex + 1) . ") {\n");
+ push(@implContent, " if (argsCount <= $argsIndex) {\n");
GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $podType, $implClassName);
push(@implContent, " }\n\n");
}
@@ -1934,12 +1946,22 @@ sub GenerateImplementation
} elsif ($parameter->extendedAttributes->{"Callback"}) {
my $callbackClassName = GetCallbackClassName($parameter->type);
$implIncludes{"$callbackClassName.h"} = 1;
- $implIncludes{"ExceptionCode.h"} = 1;
- push(@implContent, " if (exec->argumentCount() <= $argsIndex || !exec->argument($argsIndex).isObject()) {\n");
- push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
- push(@implContent, " return jsUndefined();\n");
- push(@implContent, " }\n");
- push(@implContent, " RefPtr<" . $parameter->type . "> $name = " . $callbackClassName . "::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
+ if ($parameter->extendedAttributes->{"Optional"}) {
+ push(@implContent, " RefPtr<" . $parameter->type. "> $name;\n");
+ push(@implContent, " if (exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isNull() && !exec->argument($argsIndex).isUndefined()) {\n");
+ push(@implContent, " if (!exec->argument($argsIndex).isObject()) {\n");
+ push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ push(@implContent, " }\n");
+ push(@implContent, " $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
+ push(@implContent, " }\n");
+ } else {
+ push(@implContent, " if (exec->argumentCount() <= $argsIndex || !exec->argument($argsIndex).isObject()) {\n");
+ push(@implContent, " setDOMException(exec, TYPE_MISMATCH_ERR);\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ push(@implContent, " }\n");
+ push(@implContent, " RefPtr<" . $parameter->type . "> $name = ${callbackClassName}::create(asObject(exec->argument($argsIndex)), castedThis->globalObject());\n");
+ }
} else {
push(@implContent, " " . GetNativeTypeFromSignature($parameter) . " $name = " . JSValueToNative($parameter, "exec->argument($argsIndex)") . ";\n");
@@ -1947,12 +1969,15 @@ sub GenerateImplementation
# But this needs to be done in the bindings, because the type is unsigned and the fact that it
# was negative will be lost by the time we're inside the DOM.
if ($parameter->extendedAttributes->{"IsIndex"}) {
- $implIncludes{"ExceptionCode.h"} = 1;
push(@implContent, " if ($name < 0) {\n");
push(@implContent, " setDOMException(exec, INDEX_SIZE_ERR);\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
push(@implContent, " }\n");
}
+
+ # Check if the type conversion succeeded.
+ push(@implContent, " if (exec->hadException())\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
}
$functionString .= ", " if $paramIndex;
@@ -2171,7 +2196,7 @@ sub GenerateCallbackImplementation
push(@implContent, "{\n");
push(@implContent, " ScriptExecutionContext* context = scriptExecutionContext();\n");
push(@implContent, " // When the context is destroyed, all tasks with a reference to a callback\n");
- push(@implContent, " // should be deleted. So if the context is NULL, we are on the context thread.\n");
+ push(@implContent, " // should be deleted. So if the context is 0, we are on the context thread.\n");
push(@implContent, " if (!context || context->isContextThread())\n");
push(@implContent, " delete m_data;\n");
push(@implContent, " else\n");
@@ -2343,7 +2368,8 @@ sub JSValueToNative
return "$value.toBoolean(exec)" if $type eq "boolean";
return "$value.toNumber(exec)" if $type eq "double";
return "$value.toFloat(exec)" if $type eq "float" or $type eq "SVGNumber";
- return "$value.toInt32(exec)" if $type eq "unsigned long" or $type eq "long" or $type eq "unsigned short";
+ return "$value.toInt32(exec)" if $type eq "long";
+ return "$value.toUInt32(exec)" if $type eq "unsigned long" or $type eq "unsigned short";
return "static_cast<$type>($value.toInteger(exec))" if $type eq "long long" or $type eq "unsigned long long";
return "valueToDate(exec, $value)" if $type eq "Date";
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 1b91470..f803c87 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -1106,7 +1106,15 @@ END
my $requiresAllArguments = $function->signature->extendedAttributes->{"RequiresAllArguments"};
if ($requiresAllArguments) {
- push(@implContentDecls, " if (args.Length() < $numParameters)\n");
+ my $numMandatoryParams = @{$function->parameters};
+ foreach my $param (reverse(@{$function->parameters})) {
+ if ($param->extendedAttributes->{"Optional"}) {
+ $numMandatoryParams--;
+ } else {
+ last;
+ }
+ }
+ push(@implContentDecls, " if (args.Length() < $numMandatoryParams)\n");
if ($requiresAllArguments eq "Raise") {
push(@implContentDecls, " return throwError(\"Not enough arguments\", V8Proxy::SyntaxError);\n");
} else {
@@ -1175,7 +1183,9 @@ END
my $parameterName = $parameter->name;
- if ($parameter->extendedAttributes->{"Optional"}) {
+ # Optional callbacks should be treated differently, because they always have a default value (0),
+ # and we can reduce the number of overloaded functions that take a different number of parameters.
+ if ($parameter->extendedAttributes->{"Optional"} && !$parameter->extendedAttributes->{"Callback"}) {
# Generate early call if there are not enough parameters.
push(@implContentDecls, " if (args.Length() <= $paramIndex) {\n");
my $functionCall = GenerateFunctionCallString($function, $paramIndex, " " x 2, $implClassName);
@@ -1183,51 +1193,59 @@ END
push(@implContentDecls, " }\n");
}
+ if (BasicTypeCanFailConversion($parameter)) {
+ push(@implContentDecls, " bool ${parameterName}Ok;\n");
+ }
+
+ $implIncludes{"ExceptionCode.h"} = 1;
+ my $nativeType = GetNativeTypeFromSignature($parameter, $paramIndex);
if ($parameter->extendedAttributes->{"Callback"}) {
my $className = GetCallbackClassName($parameter->type);
$implIncludes{"$className.h"} = 1;
- $implIncludes{"ExceptionCode.h"} = 1;
- push(@implContentDecls, " if (args.Length() <= $paramIndex || !args[$paramIndex]->IsObject())\n");
- push(@implContentDecls, " return throwError(TYPE_MISMATCH_ERR);\n");
- push(@implContentDecls, " RefPtr<" . $parameter->type . "> $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n");
- $paramIndex++;
- next;
- }
-
- if ($parameter->type eq "SerializedScriptValue") {
+ if ($parameter->extendedAttributes->{"Optional"}) {
+ push(@implContentDecls, " RefPtr<" . $parameter->type . "> $parameterName;\n");
+ push(@implContentDecls, " if (args.Length() > $paramIndex && !args[$paramIndex]->IsNull() && !args[$paramIndex]->IsUndefined()) {\n");
+ push(@implContentDecls, " if (!args[$paramIndex]->IsObject())\n");
+ push(@implContentDecls, " return throwError(TYPE_MISMATCH_ERR);\n");
+ push(@implContentDecls, " $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n");
+ push(@implContentDecls, " }\n");
+ } else {
+ push(@implContentDecls, " if (args.Length() <= $paramIndex || !args[$paramIndex]->IsObject())\n");
+ push(@implContentDecls, " return throwError(TYPE_MISMATCH_ERR);\n");
+ push(@implContentDecls, " RefPtr<" . $parameter->type . "> $parameterName = ${className}::create(args[$paramIndex], getScriptExecutionContext());\n");
+ }
+ } elsif ($parameter->type eq "SerializedScriptValue") {
$implIncludes{"SerializedScriptValue.h"} = 1;
push(@implContentDecls, " bool ${parameterName}DidThrow = false;\n");
- } elsif (BasicTypeCanFailConversion($parameter)) {
- push(@implContentDecls, " bool ${parameterName}Ok;\n");
- }
-
- push(@implContentDecls, " " . GetNativeTypeFromSignature($parameter, $paramIndex) . " $parameterName = ");
-
- if ($parameter->type eq "SerializedScriptValue") {
- push(@implContentDecls, "SerializedScriptValue::create(args[$paramIndex], ${parameterName}DidThrow);\n");
+ push(@implContentDecls, " $nativeType $parameterName = SerializedScriptValue::create(args[$paramIndex], ${parameterName}DidThrow);\n");
push(@implContentDecls, " if (${parameterName}DidThrow)\n");
push(@implContentDecls, " return v8::Undefined();\n");
+ } elsif (TypeCanFailConversion($parameter)) {
+ push(@implContentDecls, " $nativeType $parameterName = " .
+ JSValueToNative($parameter, "args[$paramIndex]", BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef) . ";\n");
+ push(@implContentDecls, " if (UNLIKELY(!$parameterName" . (BasicTypeCanFailConversion($parameter) ? "Ok" : "") . ")) {\n");
+ push(@implContentDecls, " ec = TYPE_MISMATCH_ERR;\n");
+ push(@implContentDecls, " goto fail;\n");
+ push(@implContentDecls, " }\n");
+ } elsif ($nativeType =~ /^V8Parameter/) {
+ my $value = JSValueToNative($parameter, "args[$paramIndex]", BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef);
+ if ($parameter->type eq "DOMString") {
+ push(@implContentDecls, " STRING_TO_V8PARAMETER_EXCEPTION_BLOCK($nativeType, $parameterName, $value);\n");
+ } else {
+ # Don't know how to properly check for conversion exceptions when $parameter->type is "DOMUserData"
+ push(@implContentDecls, " $nativeType $parameterName = $value;\n");
+ }
} else {
- push(@implContentDecls, JSValueToNative($parameter, "args[$paramIndex]",
- BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef) . ";\n");
- }
-
- if (TypeCanFailConversion($parameter)) {
- $implIncludes{"ExceptionCode.h"} = 1;
- push(@implContentDecls,
-" if (UNLIKELY(!$parameterName" . (BasicTypeCanFailConversion($parameter) ? "Ok" : "") . ")) {\n" .
-" ec = TYPE_MISMATCH_ERR;\n" .
-" goto fail;\n" .
-" }\n");
+ $implIncludes{"V8BindingMacros.h"} = 1;
+ push(@implContentDecls, " EXCEPTION_BLOCK($nativeType, $parameterName, " .
+ JSValueToNative($parameter, "args[$paramIndex]", BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef) . ");\n");
}
if ($parameter->extendedAttributes->{"IsIndex"}) {
- $implIncludes{"ExceptionCode.h"} = 1;
- push(@implContentDecls,
-" if (UNLIKELY($parameterName < 0)) {\n" .
-" ec = INDEX_SIZE_ERR;\n" .
-" goto fail;\n" .
-" }\n");
+ push(@implContentDecls, " if (UNLIKELY($parameterName < 0)) {\n");
+ push(@implContentDecls, " ec = INDEX_SIZE_ERR;\n");
+ push(@implContentDecls, " goto fail;\n");
+ push(@implContentDecls, " }\n");
}
$paramIndex++;
@@ -2825,7 +2843,8 @@ sub JSValueToNative
return "static_cast<$type>($value->NumberValue())" if $type eq "float" or $type eq "double";
return "$value->NumberValue()" if $type eq "SVGNumber";
- return "toInt32($value${maybeOkParam})" if $type eq "unsigned long" or $type eq "unsigned short" or $type eq "long";
+ return "toInt32($value${maybeOkParam})" if $type eq "long";
+ return "toUInt32($value${maybeOkParam})" if $type eq "unsigned long" or $type eq "unsigned short";
return "toInt64($value)" if $type eq "unsigned long long" or $type eq "long long";
return "static_cast<Range::CompareHow>($value->Int32Value())" if $type eq "CompareHow";
return "static_cast<SVGPaint::SVGPaintType>($value->ToInt32()->Int32Value())" if $type eq "SVGPaintType";
@@ -2955,7 +2974,7 @@ sub RequiresCustomSignature
}
foreach my $parameter (@{$function->parameters}) {
- if ($parameter->extendedAttributes->{"Optional"}) {
+ if ($parameter->extendedAttributes->{"Optional"} || $parameter->extendedAttributes->{"Callback"}) {
return 0;
}
}
diff --git a/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp b/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
index 3bf2a8b..069b8ae 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
@@ -42,10 +42,13 @@ JSTestCallback::JSTestCallback(JSObject* callback, JSDOMGlobalObject* globalObje
JSTestCallback::~JSTestCallback()
{
- if (m_scriptExecutionContext->isContextThread())
+ ScriptExecutionContext* context = scriptExecutionContext();
+ // When the context is destroyed, all tasks with a reference to a callback
+ // should be deleted. So if the context is 0, we are on the context thread.
+ if (!context || context->isContextThread())
delete m_data;
else
- m_data->globalObject()->scriptExecutionContext()->postTask(DeleteCallbackDataTask::create(m_data));
+ context->postTask(DeleteCallbackDataTask::create(m_data));
#ifndef NDEBUG
m_data = 0;
#endif
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 9c11bde..01a860c 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -25,6 +25,7 @@
#include "HTMLNames.h"
#include "IDBBindingUtilities.h"
#include "IDBKey.h"
+#include "JSDOMBinding.h"
#include "JSEventListener.h"
#include "JSTestCallback.h"
#include "JSTestObj.h"
@@ -794,8 +795,14 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVoidMethodWithArgs(ExecSt
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
const String& strArg = ustringToString(exec->argument(1).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
TestObj* objArg = toTestObj(exec->argument(2));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->voidMethodWithArgs(intArg, strArg, objArg);
return JSValue::encode(jsUndefined());
@@ -822,8 +829,14 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethodWithArgs(ExecSta
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
const String& strArg = ustringToString(exec->argument(1).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
TestObj* objArg = toTestObj(exec->argument(2));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
JSC::JSValue result = jsNumber(exec, imp->intMethodWithArgs(intArg, strArg, objArg));
@@ -851,8 +864,14 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionObjMethodWithArgs(ExecSta
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
const String& strArg = ustringToString(exec->argument(1).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
TestObj* objArg = toTestObj(exec->argument(2));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->objMethodWithArgs(intArg, strArg, objArg)));
@@ -869,7 +888,11 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgs
if (exec->argumentCount() < 2)
return JSValue::encode(jsUndefined());
const String& strArg = ustringToString(exec->argument(0).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
TestObj* objArg = toTestObj(exec->argument(1));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgs(strArg, objArg)));
@@ -887,7 +910,11 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgs
return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
ExceptionCode ec = 0;
const String& strArg = ustringToString(exec->argument(0).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
TestObj* objArg = toTestObj(exec->argument(1));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec)));
@@ -903,6 +930,8 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(ExecState
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(exec, exec->argument(0));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->serializedValue(serializedArg);
return JSValue::encode(jsUndefined());
@@ -916,6 +945,8 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(ExecState* exec)
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
RefPtr<IDBKey> key = createIDBKeyFromValue(exec, exec->argument(0));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->idbKey(key);
return JSValue::encode(jsUndefined());
@@ -963,6 +994,8 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(Ex
ExceptionCode ec = 0;
ScriptCallStack callStack(exec, 1);
log* intArg = tolog(exec->argument(0));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->customArgsAndException(intArg, &callStack, ec);
setDOMException(exec, ec);
@@ -1023,6 +1056,8 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(Ex
if (!dynamicFrame)
return JSValue::encode(jsUndefined());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->withDynamicFrameAndArg(dynamicFrame, intArg);
return JSValue::encode(jsUndefined());
@@ -1039,14 +1074,18 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOption
if (!dynamicFrame)
return JSValue::encode(jsUndefined());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
int argsCount = exec->argumentCount();
- if (argsCount < 2) {
+ if (argsCount <= 1) {
imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg);
return JSValue::encode(jsUndefined());
}
int optionalArg = exec->argument(1).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->withDynamicFrameAndOptionalArg(dynamicFrame, intArg, optionalArg);
return JSValue::encode(jsUndefined());
@@ -1063,6 +1102,8 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGe
if (!dynamicFrame)
return JSValue::encode(jsUndefined());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->withDynamicFrameAndUserGesture(dynamicFrame, intArg, processingUserGesture(exec));
return JSValue::encode(jsUndefined());
@@ -1079,14 +1120,18 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGe
if (!dynamicFrame)
return JSValue::encode(jsUndefined());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
int argsCount = exec->argumentCount();
- if (argsCount < 2) {
+ if (argsCount <= 1) {
imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg);
return JSValue::encode(jsUndefined());
}
int optionalArg = exec->argument(1).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, processingUserGesture(exec));
return JSValue::encode(jsUndefined());
@@ -1174,12 +1219,14 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalArg(Exe
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int argsCount = exec->argumentCount();
- if (argsCount < 1) {
+ if (argsCount <= 0) {
imp->methodWithOptionalArg();
return JSValue::encode(jsUndefined());
}
int opt = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->methodWithOptionalArg(opt);
return JSValue::encode(jsUndefined());
@@ -1193,14 +1240,18 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int nonOpt = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
int argsCount = exec->argumentCount();
- if (argsCount < 2) {
+ if (argsCount <= 1) {
imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
return JSValue::encode(jsUndefined());
}
int opt = exec->argument(1).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
return JSValue::encode(jsUndefined());
@@ -1214,15 +1265,21 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int nonOpt = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
int argsCount = exec->argumentCount();
- if (argsCount < 2) {
+ if (argsCount <= 1) {
imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
return JSValue::encode(jsUndefined());
}
int opt1 = exec->argument(1).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
int opt2 = exec->argument(2).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
return JSValue::encode(jsUndefined());
@@ -1237,7 +1294,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackArg(Exe
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) {
setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
+ return JSValue::encode(jsUndefined());
}
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
@@ -1253,9 +1310,11 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonCallbackArgA
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int nonCallback = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
if (exec->argumentCount() <= 1 || !exec->argument(1).isObject()) {
setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
+ return JSValue::encode(jsUndefined());
}
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(1)), castedThis->globalObject());
@@ -1270,18 +1329,14 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithCallbackAndOpti
return throwVMTypeError(exec);
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
-
- int argsCount = exec->argumentCount();
- if (argsCount < 1) {
- imp->methodWithCallbackAndOptionalArg();
- return JSValue::encode(jsUndefined());
- }
-
- if (exec->argumentCount() <= 0 || !exec->argument(0).isObject()) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
+ RefPtr<TestCallback> callback;
+ if (exec->argumentCount() > 0 && !exec->argument(0).isNull() && !exec->argument(0).isUndefined()) {
+ if (!exec->argument(0).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return JSValue::encode(jsUndefined());
+ }
+ callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
}
- RefPtr<TestCallback> callback = JSTestCallback::create(asObject(exec->argument(0)), castedThis->globalObject());
imp->methodWithCallbackAndOptionalArg(callback);
return JSValue::encode(jsUndefined());
@@ -1295,7 +1350,11 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
TestObj* objArg = toTestObj(exec->argument(0));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
const String& strArg = ustringToString(exec->argument(1).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->overloadedMethod(objArg, strArg);
return JSValue::encode(jsUndefined());
@@ -1309,14 +1368,18 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
TestObj* objArg = toTestObj(exec->argument(0));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
int argsCount = exec->argumentCount();
- if (argsCount < 2) {
+ if (argsCount <= 1) {
imp->overloadedMethod(objArg);
return JSValue::encode(jsUndefined());
}
int intArg = exec->argument(1).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->overloadedMethod(objArg, intArg);
return JSValue::encode(jsUndefined());
@@ -1330,6 +1393,8 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
const String& strArg = ustringToString(exec->argument(0).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->overloadedMethod(strArg);
return JSValue::encode(jsUndefined());
@@ -1343,6 +1408,8 @@ static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
int intArg = exec->argument(0).toInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
imp->overloadedMethod(intArg);
return JSValue::encode(jsUndefined());
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 72f3c5f..7428c93 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -29,6 +29,7 @@
#include "ScriptCallStack.h"
#include "SerializedScriptValue.h"
#include "V8Binding.h"
+#include "V8BindingMacros.h"
#include "V8BindingState.h"
#include "V8DOMWrapper.h"
#include "V8IsolatedContext.h"
@@ -556,9 +557,9 @@ static v8::Handle<v8::Value> voidMethodWithArgsCallback(const v8::Arguments& arg
{
INC_STATS("DOM.TestObj.voidMethodWithArgs");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
- V8Parameter<> strArg = args[1];
- TestObj* objArg = V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0;
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, args[1]);
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
imp->voidMethodWithArgs(intArg, strArg, objArg);
return v8::Handle<v8::Value>();
}
@@ -574,9 +575,9 @@ static v8::Handle<v8::Value> intMethodWithArgsCallback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.intMethodWithArgs");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
- V8Parameter<> strArg = args[1];
- TestObj* objArg = V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0;
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, args[1]);
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
return v8::Integer::New(imp->intMethodWithArgs(intArg, strArg, objArg));
}
@@ -591,9 +592,9 @@ static v8::Handle<v8::Value> objMethodWithArgsCallback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.objMethodWithArgs");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
- V8Parameter<> strArg = args[1];
- TestObj* objArg = V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0;
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, args[1]);
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(args[2]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
return toV8(imp->objMethodWithArgs(intArg, strArg, objArg));
}
@@ -603,8 +604,8 @@ static v8::Handle<v8::Value> methodThatRequiresAllArgsCallback(const v8::Argumen
if (args.Length() < 2)
return v8::Handle<v8::Value>();
TestObj* imp = V8TestObj::toNative(args.Holder());
- V8Parameter<> strArg = args[0];
- TestObj* objArg = V8TestObj::HasInstance(args[1]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, args[0]);
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(args[1]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
return toV8(imp->methodThatRequiresAllArgs(strArg, objArg));
}
@@ -616,8 +617,8 @@ static v8::Handle<v8::Value> methodThatRequiresAllArgsAndThrowsCallback(const v8
TestObj* imp = V8TestObj::toNative(args.Holder());
ExceptionCode ec = 0;
{
- V8Parameter<> strArg = args[0];
- TestObj* objArg = V8TestObj::HasInstance(args[1]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, args[0]);
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(args[1]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec);
if (UNLIKELY(ec))
goto fail;
@@ -644,7 +645,7 @@ static v8::Handle<v8::Value> idbKeyCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.idbKey");
TestObj* imp = V8TestObj::toNative(args.Holder());
- RefPtr<IDBKey> key = createIDBKeyFromValue(args[0]);
+ EXCEPTION_BLOCK(RefPtr<IDBKey>, key, createIDBKeyFromValue(args[0]));
imp->idbKey(key);
return v8::Handle<v8::Value>();
}
@@ -674,7 +675,7 @@ static v8::Handle<v8::Value> customArgsAndExceptionCallback(const v8::Arguments&
OwnPtr<ScriptCallStack> callStack(ScriptCallStack::create(args, 1));
if (!callStack)
return v8::Undefined();
- log* intArg = V8log::HasInstance(args[0]) ? V8log::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+ EXCEPTION_BLOCK(log*, intArg, V8log::HasInstance(args[0]) ? V8log::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
imp->customArgsAndException(intArg, callStack.get(), ec);
if (UNLIKELY(ec))
goto fail;
@@ -722,7 +723,7 @@ static v8::Handle<v8::Value> withDynamicFrameAndArgCallback(const v8::Arguments&
{
INC_STATS("DOM.TestObj.withDynamicFrameAndArg");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
if (!enteredFrame)
return v8::Undefined();
@@ -734,7 +735,7 @@ static v8::Handle<v8::Value> withDynamicFrameAndOptionalArgCallback(const v8::Ar
{
INC_STATS("DOM.TestObj.withDynamicFrameAndOptionalArg");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
if (args.Length() <= 1) {
Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
if (!enteredFrame)
@@ -742,7 +743,7 @@ static v8::Handle<v8::Value> withDynamicFrameAndOptionalArgCallback(const v8::Ar
imp->withDynamicFrameAndOptionalArg(enteredFrame, intArg);
return v8::Handle<v8::Value>();
}
- int optionalArg = toInt32(args[1]);
+ EXCEPTION_BLOCK(int, optionalArg, toInt32(args[1]));
Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
if (!enteredFrame)
return v8::Undefined();
@@ -754,7 +755,7 @@ static v8::Handle<v8::Value> withDynamicFrameAndUserGestureCallback(const v8::Ar
{
INC_STATS("DOM.TestObj.withDynamicFrameAndUserGesture");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
if (!enteredFrame)
return v8::Undefined();
@@ -766,7 +767,7 @@ static v8::Handle<v8::Value> withDynamicFrameAndUserGestureASADCallback(const v8
{
INC_STATS("DOM.TestObj.withDynamicFrameAndUserGestureASAD");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
if (args.Length() <= 1) {
Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
if (!enteredFrame)
@@ -774,7 +775,7 @@ static v8::Handle<v8::Value> withDynamicFrameAndUserGestureASADCallback(const v8
imp->withDynamicFrameAndUserGestureASAD(enteredFrame, intArg, processingUserGesture());
return v8::Handle<v8::Value>();
}
- int optionalArg = toInt32(args[1]);
+ EXCEPTION_BLOCK(int, optionalArg, toInt32(args[1]));
Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
if (!enteredFrame)
return v8::Undefined();
@@ -861,7 +862,7 @@ static v8::Handle<v8::Value> methodWithOptionalArgCallback(const v8::Arguments&
imp->methodWithOptionalArg();
return v8::Handle<v8::Value>();
}
- int opt = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, opt, toInt32(args[0]));
imp->methodWithOptionalArg(opt);
return v8::Handle<v8::Value>();
}
@@ -870,12 +871,12 @@ static v8::Handle<v8::Value> methodWithNonOptionalArgAndOptionalArgCallback(cons
{
INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndOptionalArg");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int nonOpt = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, nonOpt, toInt32(args[0]));
if (args.Length() <= 1) {
imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
return v8::Handle<v8::Value>();
}
- int opt = toInt32(args[1]);
+ EXCEPTION_BLOCK(int, opt, toInt32(args[1]));
imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
return v8::Handle<v8::Value>();
}
@@ -884,13 +885,13 @@ static v8::Handle<v8::Value> methodWithNonOptionalArgAndTwoOptionalArgsCallback(
{
INC_STATS("DOM.TestObj.methodWithNonOptionalArgAndTwoOptionalArgs");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int nonOpt = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, nonOpt, toInt32(args[0]));
if (args.Length() <= 1) {
imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
return v8::Handle<v8::Value>();
}
- int opt1 = toInt32(args[1]);
- int opt2 = toInt32(args[2]);
+ EXCEPTION_BLOCK(int, opt1, toInt32(args[1]));
+ EXCEPTION_BLOCK(int, opt2, toInt32(args[2]));
imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
return v8::Handle<v8::Value>();
}
@@ -910,7 +911,7 @@ static v8::Handle<v8::Value> methodWithNonCallbackArgAndCallbackArgCallback(cons
{
INC_STATS("DOM.TestObj.methodWithNonCallbackArgAndCallbackArg");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int nonCallback = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, nonCallback, toInt32(args[0]));
if (args.Length() <= 1 || !args[1]->IsObject())
return throwError(TYPE_MISMATCH_ERR);
RefPtr<TestCallback> callback = V8TestCallback::create(args[1], getScriptExecutionContext());
@@ -922,13 +923,12 @@ static v8::Handle<v8::Value> methodWithCallbackAndOptionalArgCallback(const v8::
{
INC_STATS("DOM.TestObj.methodWithCallbackAndOptionalArg");
TestObj* imp = V8TestObj::toNative(args.Holder());
- if (args.Length() <= 0) {
- imp->methodWithCallbackAndOptionalArg();
- return v8::Handle<v8::Value>();
+ RefPtr<TestCallback> callback;
+ if (args.Length() > 0 && !args[0]->IsNull() && !args[0]->IsUndefined()) {
+ if (!args[0]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ callback = V8TestCallback::create(args[0], getScriptExecutionContext());
}
- if (args.Length() <= 0 || !args[0]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
- RefPtr<TestCallback> callback = V8TestCallback::create(args[0], getScriptExecutionContext());
imp->methodWithCallbackAndOptionalArg(callback);
return v8::Handle<v8::Value>();
}
@@ -937,8 +937,8 @@ static v8::Handle<v8::Value> overloadedMethod1Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod1");
TestObj* imp = V8TestObj::toNative(args.Holder());
- TestObj* objArg = V8TestObj::HasInstance(args[0]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
- V8Parameter<> strArg = args[1];
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(args[0]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, args[1]);
imp->overloadedMethod(objArg, strArg);
return v8::Handle<v8::Value>();
}
@@ -947,12 +947,12 @@ static v8::Handle<v8::Value> overloadedMethod2Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod2");
TestObj* imp = V8TestObj::toNative(args.Holder());
- TestObj* objArg = V8TestObj::HasInstance(args[0]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(args[0]) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
if (args.Length() <= 1) {
imp->overloadedMethod(objArg);
return v8::Handle<v8::Value>();
}
- int intArg = toInt32(args[1]);
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[1]));
imp->overloadedMethod(objArg, intArg);
return v8::Handle<v8::Value>();
}
@@ -961,7 +961,7 @@ static v8::Handle<v8::Value> overloadedMethod3Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod3");
TestObj* imp = V8TestObj::toNative(args.Holder());
- V8Parameter<> strArg = args[0];
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, args[0]);
imp->overloadedMethod(strArg);
return v8::Handle<v8::Value>();
}
@@ -970,7 +970,7 @@ static v8::Handle<v8::Value> overloadedMethod4Callback(const v8::Arguments& args
{
INC_STATS("DOM.TestObj.overloadedMethod4");
TestObj* imp = V8TestObj::toNative(args.Holder());
- int intArg = toInt32(args[0]);
+ EXCEPTION_BLOCK(int, intArg, toInt32(args[0]));
imp->overloadedMethod(intArg);
return v8::Handle<v8::Value>();
}
@@ -1088,6 +1088,8 @@ static const BatchedCallback TestObjCallbacks[] = {
{"methodWithOptionalArg", TestObjInternal::methodWithOptionalArgCallback},
{"methodWithNonOptionalArgAndOptionalArg", TestObjInternal::methodWithNonOptionalArgAndOptionalArgCallback},
{"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjInternal::methodWithNonOptionalArgAndTwoOptionalArgsCallback},
+ {"methodWithCallbackArg", TestObjInternal::methodWithCallbackArgCallback},
+ {"methodWithNonCallbackArgAndCallbackArg", TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback},
{"methodWithCallbackAndOptionalArg", TestObjInternal::methodWithCallbackAndOptionalArgCallback},
{"overloadedMethod", TestObjInternal::overloadedMethodCallback},
};
@@ -1161,18 +1163,6 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
v8::Handle<v8::FunctionTemplate> customArgsAndExceptionArgv[customArgsAndExceptionArgc] = { V8log::GetRawTemplate() };
v8::Handle<v8::Signature> customArgsAndExceptionSignature = v8::Signature::New(desc, customArgsAndExceptionArgc, customArgsAndExceptionArgv);
proto->Set(v8::String::New("customArgsAndException"), v8::FunctionTemplate::New(TestObjInternal::customArgsAndExceptionCallback, v8::Handle<v8::Value>(), customArgsAndExceptionSignature));
-
- // Custom Signature 'methodWithCallbackArg'
- const int methodWithCallbackArgArgc = 1;
- v8::Handle<v8::FunctionTemplate> methodWithCallbackArgArgv[methodWithCallbackArgArgc] = { V8TestCallback::GetRawTemplate() };
- v8::Handle<v8::Signature> methodWithCallbackArgSignature = v8::Signature::New(desc, methodWithCallbackArgArgc, methodWithCallbackArgArgv);
- proto->Set(v8::String::New("methodWithCallbackArg"), v8::FunctionTemplate::New(TestObjInternal::methodWithCallbackArgCallback, v8::Handle<v8::Value>(), methodWithCallbackArgSignature));
-
- // Custom Signature 'methodWithNonCallbackArgAndCallbackArg'
- const int methodWithNonCallbackArgAndCallbackArgArgc = 2;
- v8::Handle<v8::FunctionTemplate> methodWithNonCallbackArgAndCallbackArgArgv[methodWithNonCallbackArgAndCallbackArgArgc] = { v8::Handle<v8::FunctionTemplate>(), V8TestCallback::GetRawTemplate() };
- v8::Handle<v8::Signature> methodWithNonCallbackArgAndCallbackArgSignature = v8::Signature::New(desc, methodWithNonCallbackArgAndCallbackArgArgc, methodWithNonCallbackArgAndCallbackArgArgv);
- proto->Set(v8::String::New("methodWithNonCallbackArgAndCallbackArg"), v8::FunctionTemplate::New(TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback, v8::Handle<v8::Value>(), methodWithNonCallbackArgAndCallbackArgSignature));
batchConfigureConstants(desc, proto, TestObjConsts, sizeof(TestObjConsts) / sizeof(*TestObjConsts));
// Custom toString template
diff --git a/WebCore/bindings/v8/V8Binding.h b/WebCore/bindings/v8/V8Binding.h
index 8383f94..c404ee7 100644
--- a/WebCore/bindings/v8/V8Binding.h
+++ b/WebCore/bindings/v8/V8Binding.h
@@ -220,7 +220,7 @@ namespace WebCore {
template <V8ParameterMode MODE = DefaultMode>
class V8Parameter {
public:
- V8Parameter (v8::Local<v8::Value> object) :m_v8Object(object) { }
+ V8Parameter(v8::Local<v8::Value> object = v8::Local<v8::Value>()) : m_v8Object(object) { }
operator String();
operator AtomicString();
private:
diff --git a/WebCore/bindings/v8/custom/V8BindingMacros.h b/WebCore/bindings/v8/custom/V8BindingMacros.h
index 4c8ecd3..b569b10 100644
--- a/WebCore/bindings/v8/custom/V8BindingMacros.h
+++ b/WebCore/bindings/v8/custom/V8BindingMacros.h
@@ -37,12 +37,13 @@
return block.ReThrow(); \
}
-#define TO_WEBCORE_STRING_EXCEPTION_BLOCK(var, value) \
- String var; \
- { \
- v8::TryCatch block; \
- v8::Handle<v8::String> v8String = (value)->ToString(); \
- if (block.HasCaught()) \
- return block.ReThrow(); \
- var = v8StringToWebCoreString<String>(v8String, DoNotExternalize); \
+#define STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(type, var, value) \
+ type var; \
+ { \
+ v8::Local<v8::Value> v8Value = (value); \
+ v8::TryCatch block; \
+ (value)->ToString(); \
+ if (block.HasCaught()) \
+ return block.ReThrow(); \
+ var = v8Value; \
}
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index cff2523..4bd55a8 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -32,7 +32,6 @@
#include "V8DOMWindow.h"
#include "Chrome.h"
-#include "Database.h"
#include "DOMTimer.h"
#include "DOMWindow.h"
#include "ExceptionCode.h"
@@ -55,8 +54,6 @@
#include "V8BindingMacros.h"
#include "V8BindingState.h"
#include "V8CustomEventListener.h"
-#include "V8Database.h"
-#include "V8DatabaseCallback.h"
#include "V8GCForContextDispose.h"
#include "V8HiddenPropertyName.h"
#include "V8HTMLAudioElementConstructor.h"
@@ -657,39 +654,6 @@ v8::Handle<v8::Value> V8DOMWindow::setIntervalCallback(const v8::Arguments& args
return WindowSetTimeoutImpl(args, false);
}
-#if ENABLE(DATABASE)
-v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DOMWindow.openDatabase");
- if (args.Length() < 4)
- return throwError(SYNTAX_ERR);
-
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(name, args[0]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(version, args[1]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(displayName, args[2]);
- EXCEPTION_BLOCK(unsigned long, estimatedSize, args[3]->Uint32Value());
-
- DOMWindow* imp = V8DOMWindow::toNative(args.Holder());
- if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true))
- return v8::Undefined();
-
- ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext();
- RefPtr<DatabaseCallback> creationCallback;
- if (args.Length() >= 5) {
- if (!args[4]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- creationCallback = V8DatabaseCallback::create(args[4], scriptExecutionContext);
- }
-
- ExceptionCode ec = 0;
- v8::Handle<v8::Value> result = toV8(imp->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec));
-
- V8Proxy::setDOMException(ec);
- return result;
-}
-#endif // ENABLE(DATABASE)
-
bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
{
v8::Handle<v8::Object> window = V8DOMWrapper::lookupDOMWrapper(V8DOMWindow::GetTemplate(), host);
diff --git a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
deleted file mode 100644
index f8ea40c..0000000
--- a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2009 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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"
-
-#if ENABLE(DATABASE)
-#include "V8Database.h"
-
-#include "Database.h"
-#include "ExceptionCode.h"
-#include "V8Binding.h"
-#include "V8BindingMacros.h"
-#include "V8SQLTransactionCallback.h"
-#include "V8SQLTransactionErrorCallback.h"
-#include "V8CustomVoidCallback.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8Database::changeVersionCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.Database.changeVersion()");
-
- if (args.Length() < 2)
- return throwError(SYNTAX_ERR);
-
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(oldVersion, args[0]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(newVersion, args[1]);
-
- Database* database = V8Database::toNative(args.Holder());
-
- ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext();
- if (!scriptExecutionContext)
- return v8::Undefined();
-
- RefPtr<V8SQLTransactionCallback> callback;
- if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
- if (!args[2]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- callback = V8SQLTransactionCallback::create(args[2], scriptExecutionContext);
- }
-
- RefPtr<V8SQLTransactionErrorCallback> errorCallback;
- if (args.Length() > 3 && !isUndefinedOrNull(args[3])) {
- if (!args[3]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- errorCallback = V8SQLTransactionErrorCallback::create(args[3], scriptExecutionContext);
- }
-
- RefPtr<V8CustomVoidCallback> successCallback;
- if (args.Length() > 4 && !isUndefinedOrNull(args[4])) {
- if (!args[4]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- successCallback = V8CustomVoidCallback::create(args[4], scriptExecutionContext);
- }
-
- database->changeVersion(oldVersion, newVersion, callback.release(), errorCallback.release(), successCallback.release());
-
- return v8::Undefined();
-}
-
-static v8::Handle<v8::Value> createTransaction(const v8::Arguments& args, bool readOnly)
-{
- if (!args.Length())
- return throwError(SYNTAX_ERR);
-
- if (!args[0]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- Database* database = V8Database::toNative(args.Holder());
-
- ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext();
- if (!scriptExecutionContext)
- return v8::Undefined();
- RefPtr<V8SQLTransactionCallback> callback = V8SQLTransactionCallback::create(args[0], scriptExecutionContext);
-
- RefPtr<V8SQLTransactionErrorCallback> errorCallback;
- if (args.Length() > 1 && !isUndefinedOrNull(args[1])) {
- if (!args[1]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- errorCallback = V8SQLTransactionErrorCallback::create(args[1], scriptExecutionContext);
- }
-
- RefPtr<V8CustomVoidCallback> successCallback;
- if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
- if (!args[2]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- successCallback = V8CustomVoidCallback::create(args[2], scriptExecutionContext);
- }
-
- database->transaction(callback.release(), errorCallback.release(), successCallback.release(), readOnly);
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8Database::transactionCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.Database.transaction()");
- return createTransaction(args, false);
-}
-
-v8::Handle<v8::Value> V8Database::readTransactionCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.Database.readTransaction()");
- return createTransaction(args, true);
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp
deleted file mode 100644
index af72053..0000000
--- a/WebCore/bindings/v8/custom/V8DatabaseSyncCustom.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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"
-
-#if ENABLE(DATABASE)
-#include "V8DatabaseSync.h"
-
-#include "DatabaseSync.h"
-#include "ExceptionCode.h"
-#include "V8Binding.h"
-#include "V8BindingMacros.h"
-#include "V8Proxy.h"
-#include "V8SQLTransactionSyncCallback.h"
-
-namespace WebCore {
-
-v8::Handle<v8::Value> V8DatabaseSync::changeVersionCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DatabaseSync.changeVersion()");
-
- if (args.Length() < 2)
- return throwError(SYNTAX_ERR);
-
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(oldVersion, args[0]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(newVersion, args[1]);
-
- DatabaseSync* database = V8DatabaseSync::toNative(args.Holder());
-
- ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext();
- RefPtr<V8SQLTransactionSyncCallback> callback;
- if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
- if (!args[2]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- callback = V8SQLTransactionSyncCallback::create(args[2], scriptExecutionContext);
- }
-
- ExceptionCode ec = 0;
- database->changeVersion(oldVersion, newVersion, callback.release(), ec);
- V8Proxy::setDOMException(ec);
-
- return v8::Undefined();
-}
-
-static v8::Handle<v8::Value> createTransaction(const v8::Arguments& args, bool readOnly)
-{
- if (!args.Length())
- return throwError(SYNTAX_ERR);
-
- if (!args[0]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- DatabaseSync* database = V8DatabaseSync::toNative(args.Holder());
-
- ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext();
- RefPtr<V8SQLTransactionSyncCallback> callback = V8SQLTransactionSyncCallback::create(args[0], scriptExecutionContext);
-
- ExceptionCode ec = 0;
- database->transaction(callback.release(), readOnly, ec);
- V8Proxy::setDOMException(ec);
-
- return v8::Undefined();
-}
-
-v8::Handle<v8::Value> V8DatabaseSync::transactionCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DatabaseSync.transaction()");
- return createTransaction(args, false);
-}
-
-v8::Handle<v8::Value> V8DatabaseSync::readTransactionCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DatabaseSync.readTransaction()");
- return createTransaction(args, true);
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp b/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp
index e74be26..af4185b 100644
--- a/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp
@@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8SQLTransaction::executeSqlCallback(const v8::Arguments&
if (args.Length() == 0)
return throwError(SYNTAX_ERR);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(statement, args[0]);
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, statement, args[0]);
Vector<SQLValue> sqlValues;
@@ -82,7 +82,7 @@ v8::Handle<v8::Value> V8SQLTransaction::executeSqlCallback(const v8::Arguments&
EXCEPTION_BLOCK(double, sqlValue, value->NumberValue());
sqlValues.append(SQLValue(sqlValue));
} else {
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(sqlValue, value);
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, sqlValue, value);
sqlValues.append(SQLValue(sqlValue));
}
}
diff --git a/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp b/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
index 495a8e4..8a57a9a 100644
--- a/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
@@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8SQLTransactionSync::executeSqlCallback(const v8::Argumen
if (!args.Length())
return throwError(SYNTAX_ERR);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(statement, args[0]);
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, statement, args[0]);
Vector<SQLValue> sqlValues;
@@ -82,7 +82,7 @@ v8::Handle<v8::Value> V8SQLTransactionSync::executeSqlCallback(const v8::Argumen
EXCEPTION_BLOCK(double, sqlValue, value->NumberValue());
sqlValues.append(SQLValue(sqlValue));
} else {
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(sqlValue, value);
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, sqlValue, value);
sqlValues.append(SQLValue(sqlValue));
}
}
diff --git a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
index 7633a2a..823ca28 100644
--- a/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp
@@ -33,12 +33,6 @@
#if ENABLE(WORKERS)
#include "V8WorkerContext.h"
-#if ENABLE(DATABASE)
-#include "Database.h"
-#include "V8Database.h"
-#include "V8DatabaseCallback.h"
-#include "V8DatabaseSync.h"
-#endif
#include "DOMTimer.h"
#include "ExceptionCode.h"
#include "ScheduledAction.h"
@@ -143,66 +137,6 @@ v8::Handle<v8::Value> toV8(WorkerContext* impl)
return global;
}
-#if ENABLE(DATABASE)
-v8::Handle<v8::Value> V8WorkerContext::openDatabaseCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.V8WorkerContext.openDatabase()");
- if (args.Length() < 4)
- return throwError(SYNTAX_ERR);
-
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(name, args[0]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(version, args[1]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(displayName, args[2]);
- EXCEPTION_BLOCK(unsigned long, estimatedSize, args[3]->Uint32Value());
-
- WorkerContext* workerContext = V8WorkerContext::toNative(args.Holder());
-
- ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext();
- RefPtr<DatabaseCallback> creationCallback;
- if (args.Length() >= 5) {
- if (!args[4]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- creationCallback = V8DatabaseCallback::create(args[4], scriptExecutionContext);
- }
-
- ExceptionCode ec = 0;
- v8::Handle<v8::Value> result = toV8(workerContext->openDatabase(name, version, displayName, estimatedSize, creationCallback.release(), ec));
-
- V8Proxy::setDOMException(ec);
- return result;
-}
-
-v8::Handle<v8::Value> V8WorkerContext::openDatabaseSyncCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.V8WorkerContext.openDatabaseSync()");
- if (args.Length() < 4)
- return throwError(SYNTAX_ERR);
-
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(name, args[0]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(version, args[1]);
- TO_WEBCORE_STRING_EXCEPTION_BLOCK(displayName, args[2]);
- EXCEPTION_BLOCK(unsigned long, estimatedSize, args[3]->Uint32Value());
-
- WorkerContext* workerContext = V8WorkerContext::toNative(args.Holder());
-
- ScriptExecutionContext* scriptExecutionContext = getScriptExecutionContext();
- RefPtr<DatabaseCallback> creationCallback;
- if (args.Length() >= 5) {
- if (!args[4]->IsObject())
- return throwError(TYPE_MISMATCH_ERR);
-
- creationCallback = V8DatabaseCallback::create(args[4], scriptExecutionContext);
- }
-
- ExceptionCode ec = 0;
- v8::Handle<v8::Value> result = toV8(workerContext->openDatabaseSync(name, version, displayName, estimatedSize, creationCallback.release(), ec));
-
- V8Proxy::setDOMException(ec);
- return result;
-}
-#endif
-
} // namespace WebCore
#endif // ENABLE(WORKERS)
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index c68f58b..41ac0a5 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -160,7 +160,7 @@ module window {
readonly attribute [EnabledAtRuntime] DOMApplicationCache applicationCache;
#endif
#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
- [EnabledAtRuntime, Custom] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in DatabaseCallback creationCallback)
+ [EnabledAtRuntime, RequiresAllArguments=Raise] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
raises(DOMException);
#endif
#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index 2d60acb..9550083 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -270,8 +270,18 @@ void Database::changeVersion(const String& oldVersion, const String& newVersion,
scheduleTransaction();
}
-void Database::transaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
- PassRefPtr<VoidCallback> successCallback, bool readOnly)
+void Database::transaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback, PassRefPtr<VoidCallback> successCallback)
+{
+ runTransaction(callback, errorCallback, successCallback, false);
+}
+
+void Database::readTransaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback, PassRefPtr<VoidCallback> successCallback)
+{
+ runTransaction(callback, errorCallback, successCallback, true);
+}
+
+void Database::runTransaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
+ PassRefPtr<VoidCallback> successCallback, bool readOnly)
{
m_transactionQueue.append(SQLTransaction::create(this, callback, errorCallback, successCallback, 0, readOnly));
MutexLocker locker(m_transactionInProgressMutex);
diff --git a/WebCore/storage/Database.h b/WebCore/storage/Database.h
index e8482a7..47001a4 100644
--- a/WebCore/storage/Database.h
+++ b/WebCore/storage/Database.h
@@ -59,8 +59,8 @@ public:
virtual String version() const;
void changeVersion(const String& oldVersion, const String& newVersion, PassRefPtr<SQLTransactionCallback>,
PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidCallback> successCallback);
- void transaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>,
- PassRefPtr<VoidCallback> successCallback, bool readOnly);
+ void transaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidCallback> successCallback);
+ void readTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidCallback> successCallback);
// Internal engine support
Vector<String> tableNames();
@@ -90,6 +90,8 @@ private:
Database(ScriptExecutionContext*, const String& name, const String& expectedVersion,
const String& displayName, unsigned long estimatedSize);
+ void runTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>,
+ PassRefPtr<VoidCallback> successCallback, bool readOnly);
bool openAndVerifyVersion(bool setVersionInNewDatabase, ExceptionCode&);
virtual bool performOpenAndVerify(bool setVersionInNewDatabase, ExceptionCode&);
diff --git a/WebCore/storage/Database.idl b/WebCore/storage/Database.idl
index ab79c97..20c2fa1 100644
--- a/WebCore/storage/Database.idl
+++ b/WebCore/storage/Database.idl
@@ -34,9 +34,9 @@ module storage {
NoStaticTables
] Database {
readonly attribute DOMString version;
- [Custom] void changeVersion(in DOMString oldVersion, in DOMString newVersion, in SQLTransactionCallback callback, in SQLTransactionErrorCallback errorCallback, in VoidCallback successCallback);
- [Custom] void transaction(in SQLTransactionCallback callback, in SQLTransactionErrorCallback errorCallback, in VoidCallback successCallback);
- [Custom] void readTransaction(in SQLTransactionCallback callback, in SQLTransactionErrorCallback errorCallback, in VoidCallback successCallback);
+ [RequiresAllArguments=Raise] void changeVersion(in DOMString oldVersion, in DOMString newVersion, in [Callback, Optional] SQLTransactionCallback callback, in [Callback, Optional] SQLTransactionErrorCallback errorCallback, in [Callback, Optional] VoidCallback successCallback);
+ [RequiresAllArguments=Raise] void transaction(in [Callback] SQLTransactionCallback callback, in [Callback, Optional] SQLTransactionErrorCallback errorCallback, in [Callback, Optional] VoidCallback successCallback);
+ [RequiresAllArguments=Raise] void readTransaction(in [Callback] SQLTransactionCallback callback, in [Callback, Optional] SQLTransactionErrorCallback errorCallback, in [Callback, Optional] VoidCallback successCallback);
};
}
diff --git a/WebCore/storage/DatabaseSync.cpp b/WebCore/storage/DatabaseSync.cpp
index 4c940dd..817fdcc 100644
--- a/WebCore/storage/DatabaseSync.cpp
+++ b/WebCore/storage/DatabaseSync.cpp
@@ -128,7 +128,17 @@ void DatabaseSync::changeVersion(const String& oldVersion, const String& newVers
setExpectedVersion(newVersion);
}
-void DatabaseSync::transaction(PassRefPtr<SQLTransactionSyncCallback> callback, bool readOnly, ExceptionCode& ec)
+void DatabaseSync::transaction(PassRefPtr<SQLTransactionSyncCallback> callback, ExceptionCode& ec)
+{
+ runTransaction(callback, false, ec);
+}
+
+void DatabaseSync::readTransaction(PassRefPtr<SQLTransactionSyncCallback> callback, ExceptionCode& ec)
+{
+ runTransaction(callback, true, ec);
+}
+
+void DatabaseSync::runTransaction(PassRefPtr<SQLTransactionSyncCallback> callback, bool readOnly, ExceptionCode& ec)
{
ASSERT(m_scriptExecutionContext->isContextThread());
diff --git a/WebCore/storage/DatabaseSync.h b/WebCore/storage/DatabaseSync.h
index 2019f85..6563b23 100644
--- a/WebCore/storage/DatabaseSync.h
+++ b/WebCore/storage/DatabaseSync.h
@@ -56,7 +56,8 @@ public:
static PassRefPtr<DatabaseSync> openDatabaseSync(ScriptExecutionContext*, const String& name, const String& expectedVersion,
const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback>, ExceptionCode&);
void changeVersion(const String& oldVersion, const String& newVersion, PassRefPtr<SQLTransactionSyncCallback>, ExceptionCode&);
- void transaction(PassRefPtr<SQLTransactionSyncCallback>, bool readOnly, ExceptionCode&);
+ void transaction(PassRefPtr<SQLTransactionSyncCallback>, ExceptionCode&);
+ void readTransaction(PassRefPtr<SQLTransactionSyncCallback>, ExceptionCode&);
virtual void markAsDeletedAndClose();
virtual void closeImmediately();
@@ -64,6 +65,7 @@ public:
private:
DatabaseSync(ScriptExecutionContext*, const String& name, const String& expectedVersion,
const String& displayName, unsigned long estimatedSize);
+ void runTransaction(PassRefPtr<SQLTransactionSyncCallback>, bool readOnly, ExceptionCode&);
};
} // namespace WebCore
diff --git a/WebCore/storage/DatabaseSync.idl b/WebCore/storage/DatabaseSync.idl
index 30adf38..0064991 100644
--- a/WebCore/storage/DatabaseSync.idl
+++ b/WebCore/storage/DatabaseSync.idl
@@ -36,9 +36,9 @@ module storage {
NoStaticTables
] DatabaseSync {
readonly attribute DOMString version;
- [Custom] void changeVersion(in DOMString oldVersion, in DOMString newVersion, in SQLTransactionSyncCallback callback);
- [Custom] void transaction(in SQLTransactionSyncCallback callback);
- [Custom] void readTransaction(in SQLTransactionSyncCallback callback);
+ [RequiresAllArguments=Raise] void changeVersion(in DOMString oldVersion, in DOMString newVersion, in [Callback, Optional] SQLTransactionSyncCallback callback) raises(DOMException);
+ [RequiresAllArguments=Raise] void transaction(in [Callback] SQLTransactionSyncCallback callback) raises(DOMException);
+ [RequiresAllArguments=Raise] void readTransaction(in [Callback] SQLTransactionSyncCallback callback) raises(DOMException);
};
}
diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
index 902c985..27b4b14 100644
--- a/WebCore/workers/WorkerContext.idl
+++ b/WebCore/workers/WorkerContext.idl
@@ -50,9 +50,10 @@ module threads {
[Custom] void importScripts(/*[Variadic] in DOMString urls */);
attribute [Replaceable] WorkerNavigator navigator;
#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
- [EnabledAtRuntime, Custom] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in DatabaseCallback creationCallback)
+ [EnabledAtRuntime, RequiresAllArguments=Raise] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
+ raises(DOMException);
+ [EnabledAtRuntime, RequiresAllArguments=Raise] DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
raises(DOMException);
- [EnabledAtRuntime, Custom] DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in DatabaseCallback creationCallback);
#endif
// Timers
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list