IndexedDB: Transactions without any request scheduled should abort itself.
https://bugs.webkit.org/show_bug.cgi?id=88052

Reviewed by Kentaro Hara.

This is needed for indexedDB to make it work for JSC. We need to clean up all the
pending transactions(transactions without any request scheduled) when leaving Javascript context.

Manually tested using the existing test LayoutTests/storage/indexeddb/tutorial.html

* bindings/js/JSMainThreadExecState.cpp:
(WebCore):
(WebCore::JSMainThreadExecState::didLeaveScriptContext):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::~JSMainThreadExecState):
(JSMainThreadExecState):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/bindings/js/JSMainThreadExecState.cpp b/Source/WebCore/bindings/js/JSMainThreadExecState.cpp
index 9177a4b..00bc170 100644
--- a/Source/WebCore/bindings/js/JSMainThreadExecState.cpp
+++ b/Source/WebCore/bindings/js/JSMainThreadExecState.cpp
@@ -27,15 +27,23 @@
 #include "JSMainThreadExecState.h"
 #include "WebKitMutationObserver.h"
 
+#if ENABLE(INDEXED_DATABASE)
+#include "IDBPendingTransactionMonitor.h"
+#endif
+
 namespace WebCore {
 
 JSC::ExecState* JSMainThreadExecState::s_mainThreadState = 0;
 
-#if ENABLE(MUTATION_OBSERVERS)
 void JSMainThreadExecState::didLeaveScriptContext()
 {
-    WebKitMutationObserver::deliverAllMutations();
-}
+#if ENABLE(INDEXED_DATABASE)
+    IDBPendingTransactionMonitor::abortPendingTransactions();   
 #endif
 
+#if ENABLE(MUTATION_OBSERVERS)
+    WebKitMutationObserver::deliverAllMutations();
+#endif
+}
+
 } // namespace WebCore