<!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>[208471] trunk/Source/WebCore</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/208471">208471</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-11-09 12:58:07 -0800 (Wed, 09 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Followup to https://bugs.webkit.org/show_bug.cgi?id=164466 - Make an IDBTransaction* be an IDBTransaction&amp;

Rubberstamped by Alex Christensen.

No new tests (No behavior change).

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::IDBObjectStore):
(WebCore::IDBObjectStore::~IDBObjectStore):
(WebCore::IDBObjectStore::hasPendingActivity):
(WebCore::IDBObjectStore::name):
(WebCore::IDBObjectStore::setName):
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::indexNames):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::autoIncrement):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
(WebCore::IDBObjectStore::markAsDeleted):
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::ref):
(WebCore::IDBObjectStore::deref):
* Modules/indexeddb/IDBObjectStore.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208470 => 208471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-09 20:38:28 UTC (rev 208470)
+++ trunk/Source/WebCore/ChangeLog        2016-11-09 20:58:07 UTC (rev 208471)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-11-07  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Followup to https://bugs.webkit.org/show_bug.cgi?id=164466 - Make an IDBTransaction* be an IDBTransaction&amp;
+
+        Rubberstamped by Alex Christensen.
+
+        No new tests (No behavior change).
+
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::IDBObjectStore):
+        (WebCore::IDBObjectStore::~IDBObjectStore):
+        (WebCore::IDBObjectStore::hasPendingActivity):
+        (WebCore::IDBObjectStore::name):
+        (WebCore::IDBObjectStore::setName):
+        (WebCore::IDBObjectStore::keyPath):
+        (WebCore::IDBObjectStore::indexNames):
+        (WebCore::IDBObjectStore::transaction):
+        (WebCore::IDBObjectStore::autoIncrement):
+        (WebCore::IDBObjectStore::openCursor):
+        (WebCore::IDBObjectStore::openKeyCursor):
+        (WebCore::IDBObjectStore::get):
+        (WebCore::IDBObjectStore::putOrAdd):
+        (WebCore::IDBObjectStore::doDelete):
+        (WebCore::IDBObjectStore::clear):
+        (WebCore::IDBObjectStore::createIndex):
+        (WebCore::IDBObjectStore::index):
+        (WebCore::IDBObjectStore::deleteIndex):
+        (WebCore::IDBObjectStore::doCount):
+        (WebCore::IDBObjectStore::getAll):
+        (WebCore::IDBObjectStore::getAllKeys):
+        (WebCore::IDBObjectStore::markAsDeleted):
+        (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
+        (WebCore::IDBObjectStore::ref):
+        (WebCore::IDBObjectStore::deref):
+        * Modules/indexeddb/IDBObjectStore.h:
+
</ins><span class="cx"> 2016-11-09  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move RenderNamedFlowThread nextRendererForElement logic to RenderTreeUpdater.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (208470 => 208471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-11-09 20:38:28 UTC (rev 208470)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-11-09 20:58:07 UTC (rev 208471)
</span><span class="lines">@@ -57,9 +57,9 @@
</span><span class="cx">     : ActiveDOMObject(&amp;context)
</span><span class="cx">     , m_info(info)
</span><span class="cx">     , m_originalInfo(info)
</span><del>-    , m_transaction(&amp;transaction)
</del><ins>+    , m_transaction(transaction)
</ins><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     suspendIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> IDBObjectStore::~IDBObjectStore()
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const char* IDBObjectStore::activeDOMObjectName() const
</span><span class="lines">@@ -81,35 +81,35 @@
</span><span class="cx"> 
</span><span class="cx"> bool IDBObjectStore::hasPendingActivity() const
</span><span class="cx"> {
</span><del>-    return !m_transaction-&gt;isFinished();
</del><ins>+    return !m_transaction.isFinished();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const String&amp; IDBObjectStore::name() const
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx">     return m_info.name();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;void&gt; IDBObjectStore::setName(const String&amp; name)
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { INVALID_STATE_ERR, ASCIILiteral(&quot;Failed set property 'name' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isVersionChange())
</del><ins>+    if (!m_transaction.isVersionChange())
</ins><span class="cx">         return Exception { INVALID_STATE_ERR, ASCIILiteral(&quot;Failed set property 'name' on 'IDBObjectStore': The object store's transaction is not a version change transaction.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed set property 'name' on 'IDBObjectStore': The object store's transaction is not active.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     if (m_info.name() == name)
</span><span class="cx">         return { };
</span><span class="cx"> 
</span><del>-    if (m_transaction-&gt;database().info().hasObjectStore(name))
</del><ins>+    if (m_transaction.database().info().hasObjectStore(name))
</ins><span class="cx">         return Exception { IDBDatabaseException::ConstraintError, makeString(&quot;Failed set property 'name' on 'IDBObjectStore': The database already has an object store named '&quot;, name, &quot;'.&quot;) };
</span><span class="cx"> 
</span><del>-    m_transaction-&gt;database().renameObjectStore(*this, name);
</del><ins>+    m_transaction.database().renameObjectStore(*this, name);
</ins><span class="cx">     m_info.rename(name);
</span><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="lines">@@ -117,13 +117,13 @@
</span><span class="cx"> 
</span><span class="cx"> const Optional&lt;IDBKeyPath&gt;&amp; IDBObjectStore::keyPath() const
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx">     return m_info.keyPath();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;DOMStringList&gt; IDBObjectStore::indexNames() const
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;DOMStringList&gt; indexNames = DOMStringList::create();
</span><span class="cx"> 
</span><span class="lines">@@ -138,13 +138,13 @@
</span><span class="cx"> 
</span><span class="cx"> IDBTransaction&amp; IDBObjectStore::transaction()
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
-    return *m_transaction;
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
+    return m_transaction;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool IDBObjectStore::autoIncrement() const
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx">     return m_info.autoIncrement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -151,12 +151,12 @@
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::openCursor(ExecState&amp; execState, RefPtr&lt;IDBKeyRange&gt; range, const String&amp; directionString)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::openCursor&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'openCursor' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     auto direction = IDBCursor::stringToDirection(directionString);
</span><span class="lines">@@ -163,8 +163,8 @@
</span><span class="cx">     if (!direction)
</span><span class="cx">         return Exception { TypeError };
</span><span class="cx"> 
</span><del>-    auto info = IDBCursorInfo::objectStoreCursor(*m_transaction, m_info.identifier(), range.get(), direction.value(), IndexedDB::CursorType::KeyAndValue);
-    return m_transaction-&gt;requestOpenCursor(execState, *this, info);
</del><ins>+    auto info = IDBCursorInfo::objectStoreCursor(m_transaction, m_info.identifier(), range.get(), direction.value(), IndexedDB::CursorType::KeyAndValue);
+    return m_transaction.requestOpenCursor(execState, *this, info);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::openCursor(ExecState&amp; execState, JSValue key, const String&amp; direction)
</span><span class="lines">@@ -179,12 +179,12 @@
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::openKeyCursor(ExecState&amp; execState, RefPtr&lt;IDBKeyRange&gt; range, const String&amp; directionString)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::openCursor&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'openKeyCursor' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     auto direction = IDBCursor::stringToDirection(directionString);
</span><span class="lines">@@ -191,8 +191,8 @@
</span><span class="cx">     if (!direction)
</span><span class="cx">         return Exception { TypeError };
</span><span class="cx"> 
</span><del>-    auto info = IDBCursorInfo::objectStoreCursor(*m_transaction, m_info.identifier(), range.get(), direction.value(), IndexedDB::CursorType::KeyOnly);
-    return m_transaction-&gt;requestOpenCursor(execState, *this, info);
</del><ins>+    auto info = IDBCursorInfo::objectStoreCursor(m_transaction, m_info.identifier(), range.get(), direction.value(), IndexedDB::CursorType::KeyOnly);
+    return m_transaction.requestOpenCursor(execState, *this, info);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::openKeyCursor(ExecState&amp; execState, JSValue key, const String&amp; direction)
</span><span class="lines">@@ -207,12 +207,12 @@
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::get(ExecState&amp; execState, JSValue key)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::get&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     auto idbKey = scriptValueToIDBKey(execState, key);
</span><span class="lines">@@ -219,18 +219,18 @@
</span><span class="cx">     if (!idbKey-&gt;isValid())
</span><span class="cx">         return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.&quot;) };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestGetRecord(execState, *this, { idbKey.ptr() });
</del><ins>+    return m_transaction.requestGetRecord(execState, *this, { idbKey.ptr() });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::get(ExecState&amp; execState, IDBKeyRange* keyRange)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::get&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError };
</span><span class="cx"> 
</span><span class="cx">     IDBKeyRangeData keyRangeData(keyRange);
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx">     if (!keyRangeData.isValid())
</span><span class="cx">         return Exception { IDBDatabaseException::DataError };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestGetRecord(execState, *this, { keyRangeData });
</del><ins>+    return m_transaction.requestGetRecord(execState, *this, { keyRangeData });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::add(ExecState&amp; execState, JSValue value, JSValue key)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx">     auto scope = DECLARE_CATCH_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::putOrAdd&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     auto context = scriptExecutionContextFromExecState(&amp;state);
</span><span class="cx">     if (!context)
</span><span class="lines">@@ -276,10 +276,10 @@
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isReadOnly())
</del><ins>+    if (m_transaction.isReadOnly())
</ins><span class="cx">         return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The transaction is read-only.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     auto serializedValue = SerializedScriptValue::create(state, value);
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx">     } else if (!usesKeyGenerator &amp;&amp; !key)
</span><span class="cx">         return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.&quot;) };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestPutOrAdd(state, *this, key.get(), *serializedValue, overwriteMode);
</del><ins>+    return m_transaction.requestPutOrAdd(state, *this, key.get(), *serializedValue, overwriteMode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::deleteFunction(ExecState&amp; execState, IDBKeyRange* keyRange)
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::doDelete(ExecState&amp; execState, IDBKeyRange* keyRange)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::deleteFunction&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
</span><span class="cx">     // the exception for an object store being deleted.
</span><span class="lines">@@ -349,10 +349,10 @@
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isReadOnly())
</del><ins>+    if (m_transaction.isReadOnly())
</ins><span class="cx">         return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The transaction is read-only.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     IDBKeyRangeData keyRangeData(keyRange);
</span><span class="lines">@@ -359,7 +359,7 @@
</span><span class="cx">     if (!keyRangeData.isValid())
</span><span class="cx">         return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key range.&quot;) };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestDeleteRecord(execState, *this, keyRangeData);
</del><ins>+    return m_transaction.requestDeleteRecord(execState, *this, keyRangeData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::deleteFunction(ExecState&amp; execState, JSValue key)
</span><span class="lines">@@ -373,7 +373,7 @@
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::clear(ExecState&amp; execState)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::clear&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
</span><span class="cx">     // the exception for an object store being deleted.
</span><span class="lines">@@ -383,27 +383,27 @@
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isReadOnly())
</del><ins>+    if (m_transaction.isReadOnly())
</ins><span class="cx">         return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral(&quot;Failed to execute 'clear' on 'IDBObjectStore': The transaction is read-only.&quot;) };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestClearObjectStore(execState, *this);
</del><ins>+    return m_transaction.requestClearObjectStore(execState, *this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBIndex&gt;&gt; IDBObjectStore::createIndex(ExecState&amp;, const String&amp; name, IDBKeyPath&amp;&amp; keyPath, const IndexParameters&amp; parameters)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::createIndex %s&quot;, name.utf8().data());
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isVersionChange())
</del><ins>+    if (!m_transaction.isVersionChange())
</ins><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'createIndex' on 'IDBObjectStore': The database is not running a version change transaction.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError };
</span><span class="cx"> 
</span><span class="cx">     if (!isIDBKeyPathValid(keyPath))
</span><span class="lines">@@ -420,10 +420,10 @@
</span><span class="cx"> 
</span><span class="cx">     // Install the new Index into the ObjectStore's info.
</span><span class="cx">     IDBIndexInfo info = m_info.createNewIndex(name, WTFMove(keyPath), parameters.unique, parameters.multiEntry);
</span><del>-    m_transaction-&gt;database().didCreateIndexInfo(info);
</del><ins>+    m_transaction.database().didCreateIndexInfo(info);
</ins><span class="cx"> 
</span><span class="cx">     // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
</span><del>-    auto index = m_transaction-&gt;createIndex(*this, info);
</del><ins>+    auto index = m_transaction.createIndex(*this, info);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;IDBIndex&gt; referencedIndex { *index };
</span><span class="cx"> 
</span><span class="lines">@@ -436,7 +436,7 @@
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBIndex&gt;&gt; IDBObjectStore::index(const String&amp; indexName)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::index&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (!scriptExecutionContext())
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError }; // FIXME: Is this code tested? Is iteven reachable?
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (m_transaction-&gt;isFinishedOrFinishing())
</del><ins>+    if (m_transaction.isFinishedOrFinishing())
</ins><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'index' on 'IDBObjectStore': The transaction is finished.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     Locker&lt;Lock&gt; locker(m_referencedIndexLock);
</span><span class="lines">@@ -468,15 +468,15 @@
</span><span class="cx"> ExceptionOr&lt;void&gt; IDBObjectStore::deleteIndex(const String&amp; name)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::deleteIndex %s&quot;, name.utf8().data());
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isVersionChange())
</del><ins>+    if (!m_transaction.isVersionChange())
</ins><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The database is not running a version change transaction.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError,  ASCIILiteral(&quot;Failed to execute 'deleteIndex' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     if (!m_info.hasIndex(name))
</span><span class="lines">@@ -484,7 +484,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto* info = m_info.infoForExistingIndex(name);
</span><span class="cx">     ASSERT(info);
</span><del>-    m_transaction-&gt;database().didDeleteIndexInfo(*info);
</del><ins>+    m_transaction.database().didDeleteIndexInfo(*info);
</ins><span class="cx"> 
</span><span class="cx">     m_info.deleteIndex(name);
</span><span class="cx"> 
</span><span class="lines">@@ -496,7 +496,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_transaction-&gt;deleteIndex(m_info.identifier(), name);
</del><ins>+    m_transaction.deleteIndex(m_info.identifier(), name);
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -521,7 +521,7 @@
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::doCount(ExecState&amp; execState, const IDBKeyRangeData&amp; range)
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
</span><span class="cx">     // the exception for an object store being deleted.
</span><span class="lines">@@ -531,27 +531,27 @@
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'count' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><span class="cx">     if (!range.isValid())
</span><span class="cx">         return Exception { IDBDatabaseException::DataError };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestCount(execState, *this, range);
</del><ins>+    return m_transaction.requestCount(execState, *this, range);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAll(ExecState&amp; execState, RefPtr&lt;IDBKeyRange&gt; range, Optional&lt;uint32_t&gt; count)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::getAll&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'getAll' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'getAll' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count);
</del><ins>+    return m_transaction.requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAll(ExecState&amp; execState, JSValue key, Optional&lt;uint32_t&gt; count)
</span><span class="lines">@@ -566,15 +566,15 @@
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAllKeys(ExecState&amp; execState, RefPtr&lt;IDBKeyRange&gt; range, Optional&lt;uint32_t&gt; count)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::getAllKeys&quot;);
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     if (m_deleted)
</span><span class="cx">         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'getAllKeys' on 'IDBObjectStore': The object store has been deleted.&quot;) };
</span><span class="cx"> 
</span><del>-    if (!m_transaction-&gt;isActive())
</del><ins>+    if (!m_transaction.isActive())
</ins><span class="cx">         return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'getAllKeys' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
</span><span class="cx"> 
</span><del>-    return m_transaction-&gt;requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count);
</del><ins>+    return m_transaction.requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAllKeys(ExecState&amp; execState, JSValue key, Optional&lt;uint32_t&gt; count)
</span><span class="lines">@@ -588,13 +588,13 @@
</span><span class="cx"> 
</span><span class="cx"> void IDBObjectStore::markAsDeleted()
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx">     m_deleted = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBObjectStore::rollbackForVersionChangeAbort()
</span><span class="cx"> {
</span><del>-    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</del><ins>+    ASSERT(currentThread() == m_transaction.database().originThreadID());
</ins><span class="cx"> 
</span><span class="cx">     String currentName = m_info.name();
</span><span class="cx">     m_info = m_originalInfo;
</span><span class="lines">@@ -655,12 +655,12 @@
</span><span class="cx"> 
</span><span class="cx"> void IDBObjectStore::ref()
</span><span class="cx"> {
</span><del>-    m_transaction-&gt;ref();
</del><ins>+    m_transaction.ref();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBObjectStore::deref()
</span><span class="cx"> {
</span><del>-    m_transaction-&gt;deref();
</del><ins>+    m_transaction.deref();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (208470 => 208471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-11-09 20:38:28 UTC (rev 208470)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-11-09 20:58:07 UTC (rev 208471)
</span><span class="lines">@@ -122,12 +122,8 @@
</span><span class="cx"> 
</span><span class="cx">     // IDBObjectStore objects are always owned by their referencing IDBTransaction.
</span><span class="cx">     // ObjectStores will never outlive transactions so its okay to keep a raw C++ reference here.
</span><ins>+    IDBTransaction&amp; m_transaction;
</ins><span class="cx"> 
</span><del>-    // FIXME: This should be a reference instead of a pointer (as mentioned by the above comment)
-    // but leaving it a pointer for now makes this patch much easier to review.
-    // I'll make the ptr-&gt;ref change right after this patch lands.
-    IDBTransaction* m_transaction;
-
</del><span class="cx">     bool m_deleted { false };
</span><span class="cx"> 
</span><span class="cx">     mutable Lock m_referencedIndexLock;
</span></span></pre>
</div>
</div>

</body>
</html>