<!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>[192956] 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/192956">192956</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-12-02 12:32:38 -0800 (Wed, 02 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: IDBTransaction::error is not exposed.
https://bugs.webkit.org/show_bug.cgi?id=151752

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).

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

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::error):
(WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
(WebCore::IDBClient::IDBTransaction::abort):
(WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
* Modules/indexeddb/client/IDBTransactionImpl.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/modern/basic-add.html:
* storage/indexeddb/modern/double-abort-expected.txt:
* storage/indexeddb/modern/index-3.html:
* storage/indexeddb/resources/transaction-error.js:
* storage/indexeddb/transaction-error-expected.txt:</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="#trunkLayoutTestsstorageindexeddbmodernbasicaddhtml">trunk/LayoutTests/storage/indexeddb/modern/basic-add.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderndoubleabortexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/double-abort-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernindex3html">trunk/LayoutTests/storage/indexeddb/modern/index-3.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcestransactionerrorjs">trunk/LayoutTests/storage/indexeddb/resources/transaction-error.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbtransactionerrorexpectedtxt">trunk/LayoutTests/storage/indexeddb/transaction-error-expected.txt</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/LayoutTests/ChangeLog        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-12-02  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: IDBTransaction::error is not exposed.
+        https://bugs.webkit.org/show_bug.cgi?id=151752
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+        * storage/indexeddb/modern/basic-add.html:
+        * storage/indexeddb/modern/double-abort-expected.txt:
+        * storage/indexeddb/modern/index-3.html:
+        * storage/indexeddb/resources/transaction-error.js:
+        * storage/indexeddb/transaction-error-expected.txt:
+
</ins><span class="cx"> 2015-12-02  Adenilson Cavalcanti  &lt;cavalcantii@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css border] border-image doesn't honor border-style
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -78,6 +78,9 @@
</span><span class="cx"> storage/indexeddb/cursor-finished.html [ Pass ]
</span><span class="cx"> storage/indexeddb/modern [ Pass ]
</span><span class="cx"> storage/indexeddb/mozilla [ Pass ]
</span><ins>+storage/indexeddb/transaction-abort.html [ Pass ]
+storage/indexeddb/transaction-error.html [ Pass ]
+storage/indexeddb/transaction-event-propagation.html [ Pass ]
</ins><span class="cx"> 
</span><span class="cx"> # No workers support in Modern IDB yet
</span><span class="cx"> storage/indexeddb/basics-workers.html
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernbasicaddhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/basic-add.html (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/basic-add.html        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/LayoutTests/storage/indexeddb/modern/basic-add.html        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         event.stopPropagation();
</span><ins>+        event.preventDefault();
</ins><span class="cx">     }
</span><span class="cx">         
</span><span class="cx">     tx.onabort = function(event) {
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderndoubleabortexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/double-abort-expected.txt (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/double-abort-expected.txt        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/LayoutTests/storage/indexeddb/modern/double-abort-expected.txt        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> ALERT: Initial upgrade needed: Old version - 0 New version - 1
</span><del>-ALERT: Second abort failed: Error: InvalidStateError: DOM Exception 11
</del><ins>+ALERT: Second abort failed: Error: InvalidStateError: DOM IDBDatabase Exception 11
</ins><span class="cx"> ALERT: Initial upgrade versionchange transaction aborted
</span><span class="cx"> ALERT: Done
</span><span class="cx"> This test aborts the same transaction twice, making the appropriate exception is thrown.
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernindex3html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/index-3.html (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/index-3.html        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-3.html        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx">     request2.onerror = function(e) {
</span><span class="cx">         log(&quot;Second put failure&quot;);
</span><span class="cx">         e.stopPropagation();
</span><ins>+        e.preventDefault();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     checkObjectStore();
</span><span class="lines">@@ -90,6 +91,7 @@
</span><span class="cx">     request3.onerror = function(e) {
</span><span class="cx">         log(&quot;Third put failure&quot;);
</span><span class="cx">         e.stopPropagation();
</span><ins>+        e.preventDefault();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     checkObjectStore();
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcestransactionerrorjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/resources/transaction-error.js (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/transaction-error.js        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-error.js        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -53,8 +53,6 @@
</span><span class="cx">     trans.onabort = function() {
</span><span class="cx">         debug(&quot;Transaction received abort event.&quot;);
</span><span class="cx">         shouldBeNonNull(&quot;trans.error&quot;);
</span><del>-        debug(&quot;trans.error.message = &quot; + trans.error.message);
-        shouldBeNonNull(&quot;trans.error.message&quot;);
</del><span class="cx">         shouldBe(&quot;trans.error&quot;, &quot;request_error&quot;);
</span><span class="cx">         testErrorFromException();
</span><span class="cx">     };
</span><span class="lines">@@ -85,8 +83,6 @@
</span><span class="cx">         self.onerror = self.originalWindowOnError;
</span><span class="cx"> 
</span><span class="cx">         shouldBeNonNull(&quot;trans.error&quot;);
</span><del>-        debug(&quot;trans.error.message = &quot; + trans.error.message);
-        shouldBeNonNull(&quot;trans.error.message&quot;);
</del><span class="cx">         shouldBe(&quot;trans.error.name&quot;, &quot;'AbortError'&quot;);
</span><span class="cx">         testErrorFromCommit();
</span><span class="cx">     };
</span><span class="lines">@@ -117,10 +113,7 @@
</span><span class="cx">                 debug(&quot;Transaction received abort event.&quot;);
</span><span class="cx">                 shouldBeNonNull(&quot;trans.error&quot;);
</span><span class="cx">                 shouldBe(&quot;trans.error.name&quot;, &quot;'ConstraintError'&quot;);
</span><del>-                debug(&quot;trans.error.message = &quot; + trans.error.message);
-                shouldBeNonNull(&quot;trans.error.message&quot;);
</del><span class="cx">                 debug(&quot;Note: This fails because of http://wkb.ug/37327&quot;);
</span><del>-                shouldNotBe(&quot;trans.error.message.indexOf(indexName)&quot;, &quot;-1&quot;);
</del><span class="cx">                 debug(&quot;&quot;);
</span><span class="cx">                 finishJSTest();
</span><span class="cx">             };
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbtransactionerrorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/transaction-error-expected.txt (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/transaction-error-expected.txt        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/LayoutTests/storage/indexeddb/transaction-error-expected.txt        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE ERROR: line 78: Uncaught Error: This should *NOT* be caught!
</del><ins>+CONSOLE MESSAGE: line 76: Error: This should *NOT* be caught!
</ins><span class="cx"> Test IDBTransaction.error cases.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx"> request_error = request.error
</span><span class="cx"> Transaction received abort event.
</span><span class="cx"> PASS trans.error is non-null.
</span><del>-trans.error.message = Key already exists in the object store.
-PASS trans.error.message is non-null.
</del><span class="cx"> PASS trans.error is request_error
</span><span class="cx"> 
</span><span class="cx"> If the transaction is aborted due to an exception thrown from event callback, IDBTransaction.error should be AbortError:
</span><span class="lines">@@ -42,8 +40,6 @@
</span><span class="cx"> Throwing exception...
</span><span class="cx"> Transaction received abort event.
</span><span class="cx"> PASS trans.error is non-null.
</span><del>-trans.error.message = Uncaught exception in event handler.
-PASS trans.error.message is non-null.
</del><span class="cx"> PASS trans.error.name is 'AbortError'
</span><span class="cx"> 
</span><span class="cx"> If the transaction is aborted due to an error during commit, IDBTransaction.error should reflect that error:
</span><span class="lines">@@ -58,10 +54,7 @@
</span><span class="cx"> Transaction received abort event.
</span><span class="cx"> PASS trans.error is non-null.
</span><span class="cx"> PASS trans.error.name is 'ConstraintError'
</span><del>-trans.error.message = Unable to add key to index 'Also test utf8: 漢': at least one key does not satisfy the uniqueness requirements.
-PASS trans.error.message is non-null.
</del><span class="cx"> Note: This fails because of http://wkb.ug/37327
</span><del>-PASS trans.error.message.indexOf(indexName) is not -1
</del><span class="cx"> 
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/Source/WebCore/ChangeLog        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-12-02  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: IDBTransaction::error is not exposed.
+        https://bugs.webkit.org/show_bug.cgi?id=151752
+
+        Reviewed by Alex Christensen.
+
+        No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).
+
+        * Modules/indexeddb/client/IDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBRequest::dispatchEvent):
+        (WebCore::IDBClient::IDBRequest::uncaughtExceptionInEventHandler):
+        * Modules/indexeddb/client/IDBRequestImpl.h:
+        
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::error):
+        (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
+        (WebCore::IDBClient::IDBTransaction::abort):
+        (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+
</ins><span class="cx"> 2015-12-02  Adenilson Cavalcanti  &lt;cavalcantii@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css border] border-image doesn't honor border-style
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -278,9 +278,22 @@
</span><span class="cx">     if (m_transaction &amp;&amp; !m_pendingCursor)
</span><span class="cx">         m_transaction-&gt;removeRequest(*this);
</span><span class="cx"> 
</span><ins>+    if (dontPreventDefault &amp;&amp; event.type() == eventNames().errorEvent &amp;&amp; m_transaction &amp;&amp; !m_transaction-&gt;isFinishedOrFinishing()) {
+        ASSERT(m_domError);
+        m_transaction-&gt;abortDueToFailedRequest(*m_domError);
+    }
+
</ins><span class="cx">     return dontPreventDefault;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBRequest::uncaughtExceptionInEventHandler()
+{
+    LOG(IndexedDB, &quot;IDBRequest::uncaughtExceptionInEventHandler&quot;);
+
+    if (m_transaction &amp;&amp; m_idbError.code() != IDBDatabaseException::AbortError)
+        m_transaction-&gt;abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError)));
+}
+
</ins><span class="cx"> void IDBRequest::setResult(const IDBKeyData* keyData)
</span><span class="cx"> {
</span><span class="cx">     if (!keyData) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -114,6 +114,7 @@
</span><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><ins>+    virtual void uncaughtExceptionInEventHandler() override final;
</ins><span class="cx"> 
</span><span class="cx">     virtual bool isOpenDBRequest() const { return false; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;DOMError.h&quot;
</span><span class="cx"> #include &quot;EventQueue.h&quot;
</span><span class="cx"> #include &quot;IDBCursorWithValueImpl.h&quot;
</span><ins>+#include &quot;IDBDatabaseException.h&quot;
</ins><span class="cx"> #include &quot;IDBDatabaseImpl.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><span class="cx"> #include &quot;IDBEventDispatcher.h&quot;
</span><span class="lines">@@ -117,8 +118,7 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;DOMError&gt; IDBTransaction::error() const
</span><span class="cx"> {
</span><del>-    ASSERT_NOT_REACHED();
-    return nullptr;
</del><ins>+    return m_domError;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBObjectStore&gt; IDBTransaction::objectStore(const String&amp; objectStoreName, ExceptionCode&amp; ec)
</span><span class="lines">@@ -165,12 +165,23 @@
</span><span class="cx">     return adoptRef(&amp;objectStore.leakRef());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+void IDBTransaction::abortDueToFailedRequest(DOMError&amp; error)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::abortDueToFailedRequest&quot;);
+    ASSERT(!isFinishedOrFinishing());
+
+    m_domError = &amp;error;
+    ExceptionCode ec;
+    abort(ec);
+}
+
</ins><span class="cx"> void IDBTransaction::abort(ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::abort&quot;);
</span><span class="cx"> 
</span><span class="cx">     if (isFinishedOrFinishing()) {
</span><del>-        ec = INVALID_STATE_ERR;
</del><ins>+        ec = IDBDatabaseException::InvalidStateError;
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -481,8 +492,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Otherwise, failure to create an index forced abortion of the transaction.
</span><del>-    ExceptionCode ec;
-    abort(ec);
</del><ins>+    abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(resultData.error().code())));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;IDBRequest&gt; IDBTransaction::requestOpenCursor(ScriptExecutionContext&amp; context, IDBObjectStore&amp; objectStore, const IDBCursorInfo&amp; info)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h (192955 => 192956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-12-02 20:25:55 UTC (rev 192955)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-12-02 20:32:38 UTC (rev 192956)
</span><span class="lines">@@ -116,6 +116,8 @@
</span><span class="cx">     void addRequest(IDBRequest&amp;);
</span><span class="cx">     void removeRequest(IDBRequest&amp;);
</span><span class="cx"> 
</span><ins>+    void abortDueToFailedRequest(DOMError&amp;);
+
</ins><span class="cx">     IDBConnectionToServer&amp; serverConnection();
</span><span class="cx"> 
</span><span class="cx">     void activate();
</span><span class="lines">@@ -191,6 +193,7 @@
</span><span class="cx">     bool m_startedOnServer { false };
</span><span class="cx"> 
</span><span class="cx">     IDBError m_idbError;
</span><ins>+    RefPtr&lt;DOMError&gt; m_domError;
</ins><span class="cx"> 
</span><span class="cx">     Timer m_operationTimer;
</span><span class="cx">     std::unique_ptr&lt;Timer&gt; m_activationTimer;
</span></span></pre>
</div>
</div>

</body>
</html>