diff options
Diffstat (limited to 'WebCore/bindings/js/JSCustomSQLStatementCallback.cpp')
-rw-r--r-- | WebCore/bindings/js/JSCustomSQLStatementCallback.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp b/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp index 1f6bd95..46a7ae5 100644 --- a/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp +++ b/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp @@ -32,21 +32,22 @@ #if ENABLE(DATABASE) #include "Frame.h" -#include "ScriptController.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); @@ -55,14 +56,19 @@ JSCustomSQLStatementCallback::~JSCustomSQLStatementCallback() #endif } -void JSCustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException) +void JSCustomSQLStatementCallback::handleEvent(ScriptExecutionContext* context, SQLTransaction* transaction, SQLResultSet* resultSet, bool& raisedException) { ASSERT(m_data); + ASSERT(context); RefPtr<JSCustomSQLStatementCallback> protect(this); JSC::JSLock lock(SilenceAssertionsOnly); - ExecState* exec = m_data->globalObject()->globalExec(); + 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)); |