summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/V8Proxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/V8Proxy.cpp')
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index 50e9fdc..5d3eeb8 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -37,6 +37,8 @@
#include "DocumentLoader.h"
#include "Frame.h"
#include "FrameLoaderClient.h"
+#include "IDBFactoryBackendInterface.h"
+#include "IDBPendingTransactionMonitor.h"
#include "InspectorTimelineAgent.h"
#include "Page.h"
#include "PageGroup.h"
@@ -487,7 +489,7 @@ v8::Local<v8::Value> V8Proxy::runScriptInternal(v8::Handle<v8::Script> script, b
}
// Release the storage mutex if applicable.
- releaseStorageMutex();
+ didLeaveScriptContext();
if (handleOutOfMemory())
ASSERT(result.IsEmpty());
@@ -563,7 +565,7 @@ v8::Local<v8::Value> V8Proxy::callFunction(v8::Handle<v8::Function> function, v8
}
// Release the storage mutex if applicable.
- releaseStorageMutex();
+ didLeaveScriptContext();
if (v8::V8::IsDead())
handleFatalErrorInV8();
@@ -675,16 +677,24 @@ void V8Proxy::disconnectFrame()
{
}
-void V8Proxy::releaseStorageMutex()
+void V8Proxy::didLeaveScriptContext()
{
+ Page* page = m_frame->page();
+ if (!page)
+ return;
+ // If we've just left a script context and indexed database has been
+ // instantiated, we must let its transaction coordinator know so it can terminate
+ // any not-yet-started transactions.
+ if (IDBPendingTransactionMonitor::hasPendingTransactions()) {
+ ASSERT(page->group().hasIDBFactory());
+ page->group().idbFactory()->abortPendingTransactions(IDBPendingTransactionMonitor::pendingTransactions());
+ IDBPendingTransactionMonitor::clearPendingTransactions();
+ }
// If we've just left a top level script context and local storage has been
// instantiated, we must ensure that any storage locks have been freed.
// Per http://dev.w3.org/html5/spec/Overview.html#storage-mutex
if (m_recursion != 0)
return;
- Page* page = m_frame->page();
- if (!page)
- return;
if (page->group().hasLocalStorage())
page->group().localStorage()->unlock();
}