<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193487] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193487">193487</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-12-04 16:31:30 -0800 (Fri, 04 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: Flip test expectations around so we only list failures.
https://bugs.webkit.org/show_bug.cgi?id=151880

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by all existing tests).

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::stop):
(WebCore::IDBClient::IDBRequest::enqueueEvent):
(WebCore::IDBClient::IDBRequest::dispatchEvent):
* Modules/indexeddb/client/IDBRequestImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
(WebCore::IDBClient::IDBTransaction::hasPendingActivity):
(WebCore::IDBClient::IDBTransaction::stop):
(WebCore::IDBClient::IDBTransaction::enqueueEvent):
(WebCore::IDBClient::IDBTransaction::dispatchEvent):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyToScriptValue): Protection against a ScriptExecutionContext that no longer has an ExecState.
  A full reworking on the binding utilities to prevent this through is covered by b/151890

LayoutTests:

* platform/mac-wk1/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBRequestImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/LayoutTests/ChangeLog        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -1,5 +1,14 @@
</span><span class="cx"> 2015-12-04  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Modern IDB: Flip test expectations around so we only list failures.
+        https://bugs.webkit.org/show_bug.cgi?id=151880
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+
+2015-12-04  Brady Eidson  &lt;beidson@apple.com&gt;
+
</ins><span class="cx">         Modern IDB: storage/indexeddb/cursor-update.html fails.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=151879
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -57,7 +57,6 @@
</span><span class="cx"> ### START OF (2) Failures without bug reports
</span><span class="cx"> 
</span><span class="cx"> # Legacy IndexedDB will never be enabled in Mac WK1.
</span><del>-storage/indexeddb
</del><span class="cx"> imported/w3c/indexeddb
</span><span class="cx"> fast/history/page-cache-indexed-closed-db.html
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html
</span><span class="lines">@@ -70,28 +69,110 @@
</span><span class="cx"> crypto/subtle/rsa-indexeddb-non-exportable.html
</span><span class="cx"> inspector/indexeddb
</span><span class="cx"> 
</span><del>-# Tests that are skipped above but that pass in Modern IDB are unskipped below.
-storage/indexeddb/aborted-versionchange-closes.html [ Pass ]
-storage/indexeddb/basics.html [ Pass ]
-storage/indexeddb/create-and-remove-object-store.html [ Pass ]
-storage/indexeddb/create-object-store-options.html [ Pass ]
-storage/indexeddb/cursor-advance.html [ Pass ]
-storage/indexeddb/cursor-basics.html [ Pass ]
-storage/indexeddb/cursor-cast.html [ Pass ]
-storage/indexeddb/cursor-finished.html [ Pass ]
-storage/indexeddb/cursor-index-delete.html [ Pass ]
-storage/indexeddb/cursor-overloads.html [ Pass ]
-storage/indexeddb/cursor-skip-deleted.html [ Pass ]
-storage/indexeddb/cursor-update.html [ Pass ]
-storage/indexeddb/events.html [ Pass ]
-storage/indexeddb/exceptions.html [ Pass ]
-storage/indexeddb/modern [ Pass ]
-storage/indexeddb/mozilla [ Pass ]
-storage/indexeddb/transaction-abort.html [ Pass ]
-storage/indexeddb/transaction-error.html [ Pass ]
-storage/indexeddb/transaction-event-propagation.html [ Pass ]
-storage/indexeddb/version-change-exclusive.html [ Pass ]
</del><ins>+# IDB tests that crash
+storage/indexeddb/database-quota.html [ Skip ]
+storage/indexeddb/deleted-objects.html [ Skip ]
+storage/indexeddb/dont-wedge.html [ Skip ]
+storage/indexeddb/intversion-two-opens-no-versions.html [ Skip ]
+storage/indexeddb/keypath-basics.html [ Skip ]
+storage/indexeddb/keypath-fetch-key.html [ Skip ]
+storage/indexeddb/lazy-index-population.html [ Skip ]
+storage/indexeddb/list-ordering.html [ Skip ]
+storage/indexeddb/open-bad-versions.html [ Skip ]
+storage/indexeddb/open-cursor.html [ Skip ]
+storage/indexeddb/open-db-private-browsing.html [ Skip ]
+storage/indexeddb/open-during-transaction.html [ Skip ]
+storage/indexeddb/structured-clone.html [ Skip ]
+storage/indexeddb/transaction-crash-on-abort.html [ Skip ]
+storage/indexeddb/version-change-exclusive.html [ Skip ]
</ins><span class="cx"> 
</span><ins>+# Causes crashes downstream
+storage/indexeddb/key-generator.html [ Skip ]
+
+# IDB tests that timeout                                                               
+storage/indexeddb/database-closepending-flag.html [ Skip ]
+storage/indexeddb/delete-closed-database-object.html [ Skip ]
+storage/indexeddb/deletedatabase-blocked.html [ Skip ]
+storage/indexeddb/deletedatabase-delayed-by-versionchange.html [ Skip ] 
+storage/indexeddb/intversion-blocked.html [ Skip ]
+storage/indexeddb/intversion-long-queue.html [ Skip ]
+storage/indexeddb/intversion-pending-version-changes-ascending.html [ Skip ]
+storage/indexeddb/intversion-pending-version-changes-descending.html [ Skip ]
+storage/indexeddb/intversion-pending-version-changes-same.html [ Skip ]
+storage/indexeddb/objectstore-basics.html [ Skip ]
+storage/indexeddb/odd-strings.html [ Skip ]
+storage/indexeddb/set_version_blocked.html [ Skip ]
+storage/indexeddb/transaction-basics.html [ Skip ]
+storage/indexeddb/transaction-starvation.html [ Skip ]
+storage/indexeddb/unblocked-version-changes.html [ Skip ]
+
+# IDB tests with text failures                                                             
+storage/indexeddb/createIndex-after-failure.html [ Failure ]
+storage/indexeddb/cursor-continue-dir.html [ Failure ]
+storage/indexeddb/cursor-continue-validity.html [ Failure ]
+storage/indexeddb/cursor-continue.html [ Failure ]
+storage/indexeddb/cursor-continueprimarykey.html [ Failure ]
+storage/indexeddb/cursor-leak.html [ Failure ]
+storage/indexeddb/cursor-request-cycle.html [ Failure ]
+storage/indexeddb/database-basics.html [ Failure ]
+storage/indexeddb/database-close.html [ Failure ]
+storage/indexeddb/database-deletepending-flag.html [ Failure ]
+storage/indexeddb/database-wrapper.html [ Failure ]
+storage/indexeddb/delete-in-upgradeneeded-close-in-open-success.html [ Failure ]
+storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange.html [ Failure ]
+storage/indexeddb/deleteIndex.html [ Failure ]
+storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange.html [ Failure ]
+storage/indexeddb/deletedatabase-not-blocked.html [ Failure ]
+storage/indexeddb/dont-commit-on-blocked.html [ Failure ]
+storage/indexeddb/factory-basics.html [ Failure ]
+storage/indexeddb/factory-cmp.html [ Failure ]
+storage/indexeddb/factory-deletedatabase.html [ Failure ]
+storage/indexeddb/get-keyrange.html [ Failure ]
+storage/indexeddb/index-basics.html [ Failure ]
+storage/indexeddb/index-count.html [ Failure ]
+storage/indexeddb/index-cursor.html [ Failure ]
+storage/indexeddb/index-duplicate-keypaths.html [ Failure ]
+storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html [ Failure ]
+storage/indexeddb/intversion-close-between-events.html [ Failure ]
+storage/indexeddb/intversion-close-in-oncomplete.html [ Failure ]
+storage/indexeddb/intversion-close-in-upgradeneeded.html [ Failure ]
+storage/indexeddb/intversion-encoding.html [ Failure ]
+storage/indexeddb/intversion-gated-on-delete.html [ Failure ]
+storage/indexeddb/intversion-open-in-upgradeneeded.html [ Failure ]
+storage/indexeddb/intversion-open-with-version.html [ Failure ]
+storage/indexeddb/intversion-persistence.html [ Failure ]
+storage/indexeddb/intversion-upgrades.html [ Failure ]
+storage/indexeddb/invalid-keys.html [ Failure ]
+storage/indexeddb/key-type-array.html [ Failure ]
+storage/indexeddb/key-type-binary.html [ Failure ]
+storage/indexeddb/keypath-arrays.html [ Failure ]
+storage/indexeddb/keypath-edges.html [ Failure ]
+storage/indexeddb/keyrange.html [ Failure ]
+storage/indexeddb/lazy-index-types.html [ Failure ]
+storage/indexeddb/metadata.html [ Failure ]
+storage/indexeddb/noblobs.html [ Failure ]
+storage/indexeddb/object-lookups-in-versionchange.html [ Failure ] 
+storage/indexeddb/objectstore-autoincrement.html [ Failure ]
+storage/indexeddb/objectstore-count.html [ Failure ]
+storage/indexeddb/objectstore-cursor.html [ Failure ]
+storage/indexeddb/open-ordering.html [ Failure ]
+storage/indexeddb/optional-arguments.html [ Failure ]
+storage/indexeddb/pending-version-change-on-exit.html [ Failure ]
+storage/indexeddb/pending-version-change-stuck-works-with-terminate.html [ Failure ]
+storage/indexeddb/pending-version-change-stuck.html [ Failure ]
+storage/indexeddb/persistence.html [ Failure ]
+storage/indexeddb/properties-disabled-at-runtime.html [ Failure ]
+storage/indexeddb/request-leak.html [ Failure ]
+storage/indexeddb/request-result-cache.html [ Failure ]
+storage/indexeddb/setversion-blocked-by-versionchange-close.html [ Failure ]
+storage/indexeddb/setversion-not-blocked.html [ Failure ]
+storage/indexeddb/transaction-active-flag.html [ Failure ]
+storage/indexeddb/transaction-after-close.html [ Failure ]
+storage/indexeddb/transaction-and-objectstore-calls.html [ Failure ]
+storage/indexeddb/transaction-read-only.html [ Failure ]
+storage/indexeddb/transaction-scope-sequencing.html [ Failure ]
+storage/indexeddb/version-change-abort.html [ Failure ]
+
</ins><span class="cx"> # No workers support in Modern IDB yet
</span><span class="cx"> storage/indexeddb/basics-workers.html
</span><span class="cx"> storage/indexeddb/cursor-advance-workers.html
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/Source/WebCore/ChangeLog        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2015-12-04  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Flip test expectations around so we only list failures.
+        https://bugs.webkit.org/show_bug.cgi?id=151880
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Covered by all existing tests).
+
+        * Modules/indexeddb/client/IDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBRequest::stop):
+        (WebCore::IDBClient::IDBRequest::enqueueEvent):
+        (WebCore::IDBClient::IDBRequest::dispatchEvent):
+        * Modules/indexeddb/client/IDBRequestImpl.h:
+        
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
+        (WebCore::IDBClient::IDBTransaction::hasPendingActivity):
+        (WebCore::IDBClient::IDBTransaction::stop):
+        (WebCore::IDBClient::IDBTransaction::enqueueEvent):
+        (WebCore::IDBClient::IDBTransaction::dispatchEvent):
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+        
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::idbKeyToScriptValue): Protection against a ScriptExecutionContext that no longer has an ExecState.
+          A full reworking on the binding utilities to prevent this through is covered by b/151890
+
</ins><span class="cx"> 2015-12-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Some fonts cause CTFontCopyAvailableTables() to return nullptr
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -237,9 +237,15 @@
</span><span class="cx">     return m_hasPendingActivity;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBRequest::stop()
+{
+    ASSERT(!m_contextStopped);
+    m_contextStopped = true;
+}
+
</ins><span class="cx"> void IDBRequest::enqueueEvent(Ref&lt;Event&gt;&amp;&amp; event)
</span><span class="cx"> {
</span><del>-    if (!scriptExecutionContext())
</del><ins>+    if (!scriptExecutionContext() || m_contextStopped)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     event-&gt;setTarget(this);
</span><span class="lines">@@ -251,6 +257,7 @@
</span><span class="cx">     LOG(IndexedDB, &quot;IDBRequest::dispatchEvent - %s (%p)&quot;, event.type().characters8(), this);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_hasPendingActivity);
</span><ins>+    ASSERT(!m_contextStopped);
</ins><span class="cx"> 
</span><span class="cx">     if (event.type() != eventNames().blockedEvent)
</span><span class="cx">         m_readyState = IDBRequestReadyState::Done;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -110,7 +110,8 @@
</span><span class="cx">     virtual const char* activeDOMObjectName() const override final;
</span><span class="cx">     virtual bool canSuspendForDocumentSuspension() const override final;
</span><span class="cx">     virtual bool hasPendingActivity() const override final;
</span><del>-    
</del><ins>+    virtual void stop() override final;
+
</ins><span class="cx">     // EventTarget.
</span><span class="cx">     virtual void refEventTarget() override final { RefCounted&lt;IDBRequest&gt;::ref(); }
</span><span class="cx">     virtual void derefEventTarget() override final { RefCounted&lt;IDBRequest&gt;::deref(); }
</span><span class="lines">@@ -138,6 +139,8 @@
</span><span class="cx">     IndexedDB::IndexRecordType m_requestedIndexRecordType;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBCursor&gt; m_pendingCursor;
</span><ins>+
+    bool m_contextStopped { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -166,7 +166,8 @@
</span><span class="cx"> void IDBTransaction::abortDueToFailedRequest(DOMError&amp; error)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::abortDueToFailedRequest&quot;);
</span><del>-    ASSERT(!isFinishedOrFinishing());
</del><ins>+    if (isFinishedOrFinishing())
+        return;
</ins><span class="cx"> 
</span><span class="cx">     m_domError = &amp;error;
</span><span class="cx">     ExceptionCodeWithMessage ec;
</span><span class="lines">@@ -227,9 +228,15 @@
</span><span class="cx"> 
</span><span class="cx"> bool IDBTransaction::hasPendingActivity() const
</span><span class="cx"> {
</span><del>-    return m_state != IndexedDB::TransactionState::Finished;
</del><ins>+    return !m_contextStopped &amp;&amp; m_state != IndexedDB::TransactionState::Finished;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBTransaction::stop()
+{
+    ASSERT(!m_contextStopped);
+    m_contextStopped = true;
+}
+
</ins><span class="cx"> bool IDBTransaction::isActive() const
</span><span class="cx"> {
</span><span class="cx">     return m_state == IndexedDB::TransactionState::Active;
</span><span class="lines">@@ -395,7 +402,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_state != IndexedDB::TransactionState::Finished);
</span><span class="cx"> 
</span><del>-    if (!scriptExecutionContext())
</del><ins>+    if (!scriptExecutionContext() || m_contextStopped)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     event-&gt;setTarget(this);
</span><span class="lines">@@ -407,6 +414,7 @@
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::dispatchEvent&quot;);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(scriptExecutionContext());
</span><ins>+    ASSERT(!m_contextStopped);
</ins><span class="cx">     ASSERT(event.target() == this);
</span><span class="cx">     ASSERT(event.type() == eventNames().completeEvent || event.type() == eventNames().abortEvent);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -81,6 +81,7 @@
</span><span class="cx">     virtual const char* activeDOMObjectName() const override final;
</span><span class="cx">     virtual bool canSuspendForDocumentSuspension() const override final;
</span><span class="cx">     virtual bool hasPendingActivity() const override final;
</span><ins>+    virtual void stop() override final;
</ins><span class="cx"> 
</span><span class="cx">     const IDBTransactionInfo info() const { return m_info; }
</span><span class="cx">     IDBDatabase&amp; database() { return m_database.get(); }
</span><span class="lines">@@ -207,6 +208,8 @@
</span><span class="cx">     HashMap&lt;String, RefPtr&lt;IDBObjectStore&gt;&gt; m_referencedObjectStores;
</span><span class="cx"> 
</span><span class="cx">     HashSet&lt;RefPtr&lt;IDBRequest&gt;&gt; m_openRequests;
</span><ins>+
+    bool m_contextStopped { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class TransactionActivator {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (193486 => 193487)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2015-12-05 00:12:23 UTC (rev 193486)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2015-12-05 00:31:30 UTC (rev 193487)
</span><span class="lines">@@ -505,6 +505,9 @@
</span><span class="cx"> Deprecated::ScriptValue idbKeyToScriptValue(DOMRequestState* requestState, PassRefPtr&lt;IDBKey&gt; key)
</span><span class="cx"> {
</span><span class="cx">     ExecState* exec = requestState-&gt;exec();
</span><ins>+    if (!exec)
+        return { };
+
</ins><span class="cx">     return Deprecated::ScriptValue(exec-&gt;vm(), idbKeyToJSValue(exec, jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject()), key.get()));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>