Commit 73c1a42f authored by dumi@chromium.org's avatar dumi@chromium.org

Auto-generate all Database callbacks.

https://bugs.webkit.org/show_bug.cgi?id=38503

Reviewed by Adam Barth.

* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pri:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSCustomSQLStatementCallback.cpp: Removed.
* bindings/js/JSCustomSQLStatementCallback.h: Removed.
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/js/JSCustomSQLStatementErrorCallback.h: Removed.
* bindings/js/JSCustomSQLTransactionCallback.cpp: Removed.
* bindings/js/JSCustomSQLTransactionCallback.h: Removed.
* bindings/js/JSCustomSQLTransactionErrorCallback.cpp: Removed.
* bindings/js/JSCustomSQLTransactionErrorCallback.h: Removed.
* bindings/js/JSDatabaseCallback.cpp: Removed.
* bindings/js/JSDatabaseCallback.h: Removed.
* bindings/js/JSDatabaseCustom.cpp:
(WebCore::JSDatabase::changeVersion):
(WebCore::createTransaction):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/v8/custom/V8CustomSQLStatementCallback.cpp: Removed.
* bindings/v8/custom/V8CustomSQLStatementCallback.h: Removed.
* bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
(WebCore::V8SQLStatementErrorCallback::handleEvent):
* bindings/v8/custom/V8CustomSQLStatementErrorCallback.h: Removed.
* bindings/v8/custom/V8CustomSQLTransactionCallback.cpp: Removed.
* bindings/v8/custom/V8CustomSQLTransactionCallback.h: Removed.
* bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp: Removed.
* bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h: Removed.
* bindings/v8/custom/V8DatabaseCallback.cpp: Removed.
* bindings/v8/custom/V8DatabaseCallback.h: Removed.
* bindings/v8/custom/V8DatabaseCustom.cpp:
(WebCore::V8Database::changeVersionCallback):
(WebCore::createTransaction):
* bindings/v8/custom/V8SQLTransactionCustom.cpp:
(WebCore::V8SQLTransaction::executeSqlCallback):
* storage/DatabaseCallback.h:
* storage/DatabaseCallback.idl: Added.
* storage/SQLStatement.cpp:
(WebCore::SQLStatement::performCallback):
* storage/SQLStatementCallback.h:
* storage/SQLStatementCallback.idl: Added.
* storage/SQLStatementErrorCallback.idl: Added.
* storage/SQLTransaction.cpp:
(WebCore::SQLTransaction::deliverTransactionCallback):
* storage/SQLTransactionCallback.h:
* storage/SQLTransactionCallback.idl: Added.
* storage/SQLTransactionErrorCallback.h:
* storage/SQLTransactionErrorCallback.idl: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1da56fb0
2010-05-04 Dumitru Daniliuc <dumi@chromium.org>
Reviewed by Adam Barth.
Auto-generate all Database callbacks.
https://bugs.webkit.org/show_bug.cgi?id=38503
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pri:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSCustomSQLStatementCallback.cpp: Removed.
* bindings/js/JSCustomSQLStatementCallback.h: Removed.
* bindings/js/JSCustomSQLStatementErrorCallback.cpp:
(WebCore::JSSQLStatementErrorCallback::handleEvent):
* bindings/js/JSCustomSQLStatementErrorCallback.h: Removed.
* bindings/js/JSCustomSQLTransactionCallback.cpp: Removed.
* bindings/js/JSCustomSQLTransactionCallback.h: Removed.
* bindings/js/JSCustomSQLTransactionErrorCallback.cpp: Removed.
* bindings/js/JSCustomSQLTransactionErrorCallback.h: Removed.
* bindings/js/JSDatabaseCallback.cpp: Removed.
* bindings/js/JSDatabaseCallback.h: Removed.
* bindings/js/JSDatabaseCustom.cpp:
(WebCore::JSDatabase::changeVersion):
(WebCore::createTransaction):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/v8/custom/V8CustomSQLStatementCallback.cpp: Removed.
* bindings/v8/custom/V8CustomSQLStatementCallback.h: Removed.
* bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
(WebCore::V8SQLStatementErrorCallback::handleEvent):
* bindings/v8/custom/V8CustomSQLStatementErrorCallback.h: Removed.
* bindings/v8/custom/V8CustomSQLTransactionCallback.cpp: Removed.
* bindings/v8/custom/V8CustomSQLTransactionCallback.h: Removed.
* bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp: Removed.
* bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h: Removed.
* bindings/v8/custom/V8DatabaseCallback.cpp: Removed.
* bindings/v8/custom/V8DatabaseCallback.h: Removed.
* bindings/v8/custom/V8DatabaseCustom.cpp:
(WebCore::V8Database::changeVersionCallback):
(WebCore::createTransaction):
* bindings/v8/custom/V8SQLTransactionCustom.cpp:
(WebCore::V8SQLTransaction::executeSqlCallback):
* storage/DatabaseCallback.h:
* storage/DatabaseCallback.idl: Added.
* storage/SQLStatement.cpp:
(WebCore::SQLStatement::performCallback):
* storage/SQLStatementCallback.h:
* storage/SQLStatementCallback.idl: Added.
* storage/SQLStatementErrorCallback.idl: Added.
* storage/SQLTransaction.cpp:
(WebCore::SQLTransaction::deliverTransactionCallback):
* storage/SQLTransactionCallback.h:
* storage/SQLTransactionCallback.idl: Added.
* storage/SQLTransactionErrorCallback.h:
* storage/SQLTransactionErrorCallback.idl: Added.
2010-05-04 Chris Marrin <cmarrin@apple.com>
Reviewed by Simon Fraser.
......@@ -64,6 +64,7 @@
#include "JSCSSVariablesRule.cpp"
#include "JSCustomEvent.cpp"
#include "JSDatabase.cpp"
#include "JSDatabaseCallback.cpp"
#include "JSDataGridColumn.cpp"
#include "JSDataGridColumnList.cpp"
#include "JSDedicatedWorkerContext.cpp"
......@@ -204,7 +205,11 @@
#include "JSSQLError.cpp"
#include "JSSQLResultSet.cpp"
#include "JSSQLResultSetRowList.cpp"
#include "JSSQLStatementCallback.cpp"
#include "JSSQLStatementErrorCallback.cpp"
#include "JSSQLTransaction.cpp"
#include "JSSQLTransactionCallback.cpp"
#include "JSSQLTransactionErrorCallback.cpp"
#include "JSStorage.cpp"
#include "JSStorageEvent.cpp"
#include "JSStyleMedia.cpp"
......
......@@ -115,6 +115,7 @@ DOM_CLASSES = \
DOMSelection \
DOMWindow \
Database \
DatabaseCallback \
Document \
DocumentFragment \
DocumentType \
......@@ -248,7 +249,11 @@ DOM_CLASSES = \
SQLError \
SQLResultSet \
SQLResultSetRowList \
SQLStatementCallback \
SQLStatementErrorCallback \
SQLTransaction \
SQLTransactionCallback \
SQLTransactionErrorCallback \
Storage \
StorageEvent \
SVGAElement \
......
......@@ -2304,25 +2304,21 @@ FEATURE_DEFINES += ENABLE_DATABASE=1
IDL_BINDINGS += \
WebCore/storage/Database.idl \
WebCore/storage/DatabaseCallback.idl \
WebCore/storage/SQLError.idl \
WebCore/storage/SQLResultSet.idl \
WebCore/storage/SQLResultSetRowList.idl \
WebCore/storage/SQLTransaction.idl
WebCore/storage/SQLStatementCallback.idl \
WebCore/storage/SQLStatementErrorCallback.idl \
WebCore/storage/SQLTransaction.idl \
WebCore/storage/SQLTransactionCallback.idl \
WebCore/storage/SQLTransactionErrorCallback.idl
webcore_cppflags += \
-DENABLE_DATABASE=1
webcore_sources += \
WebCore/bindings/js/JSCustomSQLStatementCallback.cpp \
WebCore/bindings/js/JSCustomSQLStatementCallback.h \
WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp \
WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h \
WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp \
WebCore/bindings/js/JSCustomSQLTransactionCallback.h \
WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp \
WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h \
WebCore/bindings/js/JSDatabaseCallback.cpp \
WebCore/bindings/js/JSDatabaseCallback.h \
WebCore/bindings/js/JSDatabaseCustom.cpp \
WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp \
WebCore/bindings/js/JSSQLTransactionCustom.cpp \
......
......@@ -218,6 +218,7 @@
'plugins/Plugin.idl',
'plugins/PluginArray.idl',
'storage/Database.idl',
'storage/DatabaseCallback.idl',
'storage/IDBDatabaseError.idl',
'storage/IDBDatabaseException.idl',
'storage/IDBDatabaseRequest.idl',
......@@ -225,7 +226,11 @@
'storage/SQLError.idl',
'storage/SQLResultSet.idl',
'storage/SQLResultSetRowList.idl',
'storage/SQLStatementCallback.idl',
'storage/SQLStatementErrorCallback.idl',
'storage/SQLTransaction.idl',
'storage/SQLTransactionCallback.idl',
'storage/SQLTransactionErrorCallback.idl',
'storage/Storage.idl',
'storage/StorageEvent.idl',
'websockets/WebSocket.idl',
......@@ -496,14 +501,7 @@
'bindings/js/JSCustomPositionCallback.h',
'bindings/js/JSCustomPositionErrorCallback.cpp',
'bindings/js/JSCustomPositionErrorCallback.h',
'bindings/js/JSCustomSQLStatementCallback.cpp',
'bindings/js/JSCustomSQLStatementCallback.h',
'bindings/js/JSCustomSQLStatementErrorCallback.cpp',
'bindings/js/JSCustomSQLStatementErrorCallback.h',
'bindings/js/JSCustomSQLTransactionCallback.cpp',
'bindings/js/JSCustomSQLTransactionCallback.h',
'bindings/js/JSCustomSQLTransactionErrorCallback.cpp',
'bindings/js/JSCustomSQLTransactionErrorCallback.h',
'bindings/js/JSCustomVoidCallback.cpp',
'bindings/js/JSCustomVoidCallback.h',
'bindings/js/JSCustomXPathNSResolver.cpp',
......@@ -708,20 +706,11 @@
'bindings/v8/custom/V8CustomPositionCallback.h',
'bindings/v8/custom/V8CustomPositionErrorCallback.cpp',
'bindings/v8/custom/V8CustomPositionErrorCallback.h',
'bindings/v8/custom/V8CustomSQLStatementCallback.cpp',
'bindings/v8/custom/V8CustomSQLStatementCallback.h',
'bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp',
'bindings/v8/custom/V8CustomSQLStatementErrorCallback.h',
'bindings/v8/custom/V8CustomSQLTransactionCallback.cpp',
'bindings/v8/custom/V8CustomSQLTransactionCallback.h',
'bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp',
'bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h',
'bindings/v8/custom/V8CustomVoidCallback.cpp',
'bindings/v8/custom/V8CustomVoidCallback.h',
'bindings/v8/custom/V8CustomXPathNSResolver.cpp',
'bindings/v8/custom/V8CustomXPathNSResolver.h',
'bindings/v8/custom/V8DatabaseCallback.cpp',
'bindings/v8/custom/V8DatabaseCallback.h',
'bindings/v8/custom/V8DatabaseCustom.cpp',
'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
......
......@@ -436,12 +436,17 @@ IDL_BINDINGS += \
plugins/PluginArray.idl \
plugins/MimeTypeArray.idl \
storage/Database.idl \
storage/DatabaseCallback.idl \
storage/Storage.idl \
storage/StorageEvent.idl \
storage/SQLError.idl \
storage/SQLResultSet.idl \
storage/SQLResultSetRowList.idl \
storage/SQLStatementCallback.idl \
storage/SQLStatementErrorCallback.idl \
storage/SQLTransaction.idl \
storage/SQLTransactionCallback.idl \
storage/SQLTransactionErrorCallback.idl \
svg/SVGZoomEvent.idl \
svg/SVGAElement.idl \
svg/SVGAltGlyphElement.idl \
......
......@@ -1029,13 +1029,8 @@ HEADERS += \
bindings/js/JSCSSStyleDeclarationCustom.h \
bindings/js/JSCustomPositionCallback.h \
bindings/js/JSCustomPositionErrorCallback.h \
bindings/js/JSCustomSQLStatementCallback.h \
bindings/js/JSCustomSQLStatementErrorCallback.h \
bindings/js/JSCustomSQLTransactionCallback.h \
bindings/js/JSCustomSQLTransactionErrorCallback.h \
bindings/js/JSCustomVoidCallback.h \
bindings/js/JSCustomXPathNSResolver.h \
bindings/js/JSDatabaseCallback.h \
bindings/js/JSDataGridDataSource.h \
bindings/js/JSDebugWrapperSet.h \
bindings/js/JSDOMBinding.h \
......@@ -2303,11 +2298,7 @@ contains(DEFINES, ENABLE_DATABASE=1) {
storage/SQLTransactionClient.cpp \
storage/SQLTransactionCoordinator.cpp \
storage/SQLTransactionSync.cpp \
bindings/js/JSCustomSQLStatementCallback.cpp \
bindings/js/JSCustomSQLStatementErrorCallback.cpp \
bindings/js/JSCustomSQLTransactionCallback.cpp \
bindings/js/JSCustomSQLTransactionErrorCallback.cpp \
bindings/js/JSDatabaseCallback.cpp \
bindings/js/JSDatabaseCustom.cpp \
bindings/js/JSSQLResultSetRowListCustom.cpp \
bindings/js/JSSQLTransactionCustom.cpp
......
......@@ -35474,62 +35474,6 @@
RelativePath="..\bindings\js\JSCustomPositionErrorCallback.cpp"
>
</File>
<File
RelativePath="..\bindings\js\JSCustomSQLStatementCallback.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\JSCustomSQLStatementCallback.h"
>
</File>
<File
RelativePath="..\bindings\js\JSCustomSQLStatementErrorCallback.cpp"
>
......@@ -35582,122 +35526,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\bindings\js\JSCustomSQLStatementErrorCallback.h"
>
</File>
<File
RelativePath="..\bindings\js\JSCustomSQLTransactionCallback.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\JSCustomSQLTransactionCallback.h"
>
</File>
<File
RelativePath="..\bindings\js\JSCustomSQLTransactionErrorCallback.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\JSCustomSQLTransactionErrorCallback.h"
>
</File>
<File
RelativePath="..\bindings\js\JSCustomVoidCallback.cpp"
>
......@@ -35810,14 +35638,6 @@
RelativePath="..\bindings\js\JSCustomXPathNSResolver.h"
>
</File>
<File
RelativePath="..\bindings\js\JSDatabaseCallback.cpp"
>
</File>
<File
RelativePath="..\bindings\js\JSDatabaseCallback.h"
>
</File>
<File
RelativePath="..\bindings\js\JSDatabaseCustom.cpp"
>
......
This diff is collapsed.
......@@ -39,10 +39,7 @@
#include "JSClipboardCustom.cpp"
#include "JSConsoleCustom.cpp"
#include "JSCoordinatesCustom.cpp"
#include "JSCustomSQLStatementCallback.cpp"
#include "JSCustomSQLStatementErrorCallback.cpp"
#include "JSCustomSQLTransactionCallback.cpp"
#include "JSCustomSQLTransactionErrorCallback.cpp"
#include "JSCustomVoidCallback.cpp"
#include "JSCustomXPathNSResolver.cpp"
#include "JSDOMApplicationCacheCustom.cpp"
......
/*
* 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 "JSCustomSQLStatementCallback.h"
#if ENABLE(DATABASE)
#include "Frame.h"
#include "JSSQLResultSet.h"
#include "JSSQLTransaction.h"
#include "ScriptExecutionContext.h"
#include <runtime/JSLock.h>
#include <wtf/MainThread.h>
namespace WebCore {
using namespace JSC;
JSCustomSQLStatementCallback::JSCustomSQLStatementCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
: m_data(new JSCallbackData(callback, globalObject))
, m_isolatedWorld(globalObject->world())
{
}
JSCustomSQLStatementCallback::~JSCustomSQLStatementCallback()
{
callOnMainThread(JSCallbackData::deleteData, m_data);
#ifndef NDEBUG
m_data = 0;
#endif
}
void JSCustomSQLStatementCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException)
{
ASSERT(m_data);
ASSERT(context);
RefPtr<JSCustomSQLStatementCallback> protect(this);
JSC::JSLock lock(SilenceAssertionsOnly);
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
if (!globalObject)
return;
ExecState* exec = globalObject->globalExec();
MarkedArgumentBuffer args;
args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), transaction));
args.append(toJS(exec, deprecatedGlobalObjectForPrototype(exec), resultSet));
m_data->invokeCallback(args, &raisedException);
}
}
#endif // ENABLE(DATABASE)
......@@ -27,42 +27,26 @@
*/
#include "config.h"
#include "JSCustomSQLStatementErrorCallback.h"
#include "JSSQLStatementErrorCallback.h"
#if ENABLE(DATABASE)
#include "Frame.h"
#include "JSCallbackData.h"
#include "JSSQLError.h"
#include "JSSQLTransaction.h"
#include "ScriptExecutionContext.h"
#include <runtime/JSLock.h>
#include <wtf/MainThread.h>
namespace WebCore {
using namespace JSC;
JSCustomSQLStatementErrorCallback::JSCustomSQLStatementErrorCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
: m_data(new JSCallbackData(callback, globalObject))
, m_isolatedWorld(globalObject->world())
{
}
JSCustomSQLStatementErrorCallback::~JSCustomSQLStatementErrorCallback()
{
callOnMainThread(JSCallbackData::deleteData, m_data);
#ifndef NDEBUG
m_data = 0;
#endif
}
bool JSCustomSQLStatementErrorCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLError* error)
bool JSSQLStatementErrorCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLError* error)
{
ASSERT(m_data);
ASSERT(context);
RefPtr<JSCustomSQLStatementErrorCallback> protect(this);
RefPtr<JSSQLStatementErrorCallback> protect(this);
JSC::JSLock lock(SilenceAssertionsOnly);
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
......
/*
* Copyright (C) 2007, 2008 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 "JSCustomSQLTransactionCallback.h"
#if ENABLE(DATABASE)
#include "Frame.h"
#include "JSCallbackData.h"
#include "JSSQLTransaction.h"
#include "ScriptExecutionContext.h"
#include <runtime/JSLock.h>
#include <wtf/MainThread.h>
#include <wtf/RefCountedLeakCounter.h>
namespace WebCore {
using namespace JSC;
#ifndef NDEBUG
static WTF::RefCountedLeakCounter counter("JSCustomSQLTransactionCallback");
#endif
JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
: m_data(new JSCallbackData(callback, globalObject))
, m_isolatedWorld(globalObject->world())
{