| Index: Source/WebCore/Modules/indexeddb/IDBRequest.cpp
|
| ===================================================================
|
| --- Source/WebCore/Modules/indexeddb/IDBRequest.cpp (revision 132933)
|
| +++ Source/WebCore/Modules/indexeddb/IDBRequest.cpp (working copy)
|
| @@ -42,6 +42,9 @@
|
| #include "IDBTracing.h"
|
| #include "IDBTransaction.h"
|
| #include "ScriptExecutionContext.h"
|
| +#if USE(V8)
|
| +#include "V8Binding.h"
|
| +#endif
|
|
|
| namespace WebCore {
|
|
|
| @@ -76,6 +79,9 @@
|
| , m_pendingCursor(0)
|
| , m_didFireUpgradeNeededEvent(false)
|
| , m_preventPropagation(false)
|
| +#if USE(V8)
|
| + , m_worldContextHandle(UseCurrentWorld)
|
| +#endif
|
| {
|
| if (m_transaction) {
|
| m_transaction->registerRequest(this);
|
| @@ -284,6 +290,14 @@
|
| if (!shouldEnqueueEvent())
|
| return;
|
|
|
| +#if USE(V8)
|
| + v8::HandleScope handleScope;
|
| + v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), m_worldContextHandle);
|
| + if (context.IsEmpty())
|
| + CRASH();
|
| + v8::Context::Scope contextScope(context);
|
| +#endif
|
| +
|
| ScriptValue value = deserializeIDBValue(scriptExecutionContext(), serializedValue);
|
| ASSERT(m_cursorType != IDBCursorBackendInterface::InvalidCursorType);
|
| RefPtr<IDBCursor> cursor;
|
| @@ -340,6 +354,14 @@
|
| if (!shouldEnqueueEvent())
|
| return;
|
|
|
| +#if USE(V8)
|
| + v8::HandleScope handleScope;
|
| + v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), m_worldContextHandle);
|
| + if (context.IsEmpty())
|
| + CRASH();
|
| + v8::Context::Scope contextScope(context);
|
| +#endif
|
| +
|
| ScriptValue value = deserializeIDBValue(scriptExecutionContext(), serializedScriptValue);
|
| onSuccessInternal(value);
|
| }
|
| @@ -363,6 +385,14 @@
|
| if (!shouldEnqueueEvent())
|
| return;
|
|
|
| +#if USE(V8)
|
| + v8::HandleScope handleScope;
|
| + v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), m_worldContextHandle);
|
| + if (context.IsEmpty())
|
| + CRASH();
|
| + v8::Context::Scope contextScope(context);
|
| +#endif
|
| +
|
| #ifndef NDEBUG
|
| ASSERT(keyPath == effectiveObjectStore(m_source)->keyPath());
|
| #endif
|
| @@ -404,6 +434,14 @@
|
| if (!shouldEnqueueEvent())
|
| return;
|
|
|
| +#if USE(V8)
|
| + v8::HandleScope handleScope;
|
| + v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), m_worldContextHandle);
|
| + if (context.IsEmpty())
|
| + CRASH();
|
| + v8::Context::Scope contextScope(context);
|
| +#endif
|
| +
|
| ScriptValue value = deserializeIDBValue(scriptExecutionContext(), serializedValue);
|
| ASSERT(m_pendingCursor);
|
| setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
|
| @@ -449,6 +487,15 @@
|
| ASSERT(scriptExecutionContext());
|
| ASSERT(event->target() == this);
|
| ASSERT_WITH_MESSAGE(m_readyState < DONE, "When dispatching event %s, m_readyState < DONE(%d), was %d", event->type().string().utf8().data(), DONE, m_readyState);
|
| +
|
| +#if USE(V8)
|
| + v8::HandleScope handleScope;
|
| + v8::Local<v8::Context> context = toV8Context(scriptExecutionContext(), m_worldContextHandle);
|
| + if (context.IsEmpty())
|
| + CRASH();
|
| + v8::Context::Scope contextScope(context);
|
| +#endif
|
| +
|
| if (event->type() != eventNames().blockedEvent)
|
| m_readyState = DONE;
|
|
|
|
|