<!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>[282550] releases/WebKitGTK/webkit-2.32/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/282550">282550</a></dd>
<dt>Author</dt> <dd>aperez@igalia.com</dd>
<dt>Date</dt> <dd>2021-09-16 04:14:49 -0700 (Thu, 16 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/279960">r279960</a> - Use WeakPtr with UniqueIDBDatabaseConnection
<rdar://79447808> and https://bugs.webkit.org/show_bug.cgi?id=227969

Reviewed by Geoff Garen.

No new tests possible.

Noticed this raw ptr which was raw to break a ref cycle.
WeakPtr works better.

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::didActivateInBackingStore):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit232SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit232SourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectionh">releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h</a></li>
<li><a href="#releasesWebKitGTKwebkit232SourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp">releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit232SourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh">releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit232SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog (282549 => 282550)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog  2021-09-16 11:12:54 UTC (rev 282549)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog     2021-09-16 11:14:49 UTC (rev 282550)
</span><span class="lines">@@ -1,5 +1,44 @@
</span><span class="cx"> 2021-07-15  Brady Eidson  <beidson@apple.com>
</span><span class="cx"> 
</span><ins>+        Use WeakPtr with UniqueIDBDatabaseConnection
+        <rdar://79447808> and https://bugs.webkit.org/show_bug.cgi?id=227969
+
+        Reviewed by Geoff Garen.
+
+        No new tests possible.
+        
+        Noticed this raw ptr which was raw to break a ref cycle.
+        WeakPtr works better.
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::didActivateInBackingStore):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection): Deleted.
+
+2021-07-15  Brady Eidson  <beidson@apple.com>
+
</ins><span class="cx">         MemoryIDBBackingStore cleanup.
</span><span class="cx">         <rdar://79497380> and https://bugs.webkit.org/show_bug.cgi?id=227993
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit232SourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectionh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h (282549 => 282550)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h     2021-09-16 11:12:54 UTC (rev 282549)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2021-09-16 11:14:49 UTC (rev 282550)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> class UniqueIDBDatabase;
</span><span class="cx"> class UniqueIDBDatabaseTransaction;
</span><span class="cx"> 
</span><del>-class UniqueIDBDatabaseConnection : public RefCounted<UniqueIDBDatabaseConnection>, public Identified<UniqueIDBDatabaseConnection> {
</del><ins>+class UniqueIDBDatabaseConnection : public RefCounted<UniqueIDBDatabaseConnection>, public Identified<UniqueIDBDatabaseConnection>, public CanMakeWeakPtr<UniqueIDBDatabaseConnection> {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref<UniqueIDBDatabaseConnection> create(UniqueIDBDatabase&, ServerOpenDBRequest&);
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit232SourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (282549 => 282550)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp  2021-09-16 11:12:54 UTC (rev 282549)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp     2021-09-16 11:14:49 UTC (rev 282550)
</span><span class="lines">@@ -43,23 +43,29 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction(UniqueIDBDatabaseConnection& connection, const IDBTransactionInfo& info)
</span><del>-    : m_databaseConnection(&connection)
</del><ins>+    : m_databaseConnection(makeWeakPtr(&connection))
</ins><span class="cx">     , m_transactionInfo(info)
</span><span class="cx"> {
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx"> 
</span><span class="cx">     if (m_transactionInfo.mode() == IDBTransactionMode::Versionchange)
</span><span class="cx">         m_originalDatabaseInfo = makeUnique<IDBDatabaseInfo>(database->info());
</span><span class="cx"> 
</span><del>-    m_databaseConnection->server()->registerTransaction(*this);
</del><ins>+    databaseConnection().server()->registerTransaction(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction()
</span><span class="cx"> {
</span><del>-    m_databaseConnection->server()->unregisterTransaction(*this);
</del><ins>+    databaseConnection().server()->unregisterTransaction(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+UniqueIDBDatabaseConnection& UniqueIDBDatabaseTransaction::databaseConnection()
+{
+    RELEASE_ASSERT(m_databaseConnection);
+    return *m_databaseConnection;
+}
+
</ins><span class="cx"> IDBDatabaseInfo* UniqueIDBDatabaseTransaction::originalDatabaseInfo() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_transactionInfo.mode() == IDBTransactionMode::Versionchange);
</span><span class="lines">@@ -70,13 +76,13 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, "UniqueIDBDatabaseTransaction::abort");
</span><span class="cx">     
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx"> 
</span><span class="cx">     database->abortTransaction(*this, [this](auto& error) {
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::abort (callback)");
</span><span class="cx"> 
</span><del>-        m_databaseConnection->didAbortTransaction(*this, error);
</del><ins>+        databaseConnection().didAbortTransaction(*this, error);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -84,7 +90,7 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, "UniqueIDBDatabaseTransaction::abortWithoutCallback");
</span><span class="cx"> 
</span><del>-    m_databaseConnection->abortTransactionWithoutCallback(*this);
</del><ins>+    databaseConnection().abortTransactionWithoutCallback(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool UniqueIDBDatabaseTransaction::isVersionChange() const
</span><span class="lines">@@ -101,12 +107,12 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, "UniqueIDBDatabaseTransaction::commit");
</span><span class="cx"> 
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx"> 
</span><span class="cx">     database->commitTransaction(*this, [this](auto& error) {
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::commit (callback)");
</span><span class="cx"> 
</span><del>-        m_databaseConnection->didCommitTransaction(*this, error);
</del><ins>+        databaseConnection().didCommitTransaction(*this, error);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -117,7 +123,7 @@
</span><span class="cx">     ASSERT(isVersionChange());
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx"> 
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx"> 
</span><span class="cx">     database->createObjectStore(*this, info, [this, requestData](auto& error) {
</span><span class="lines">@@ -124,9 +130,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::createObjectStore (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->didCreateObjectStore(IDBResultData::createObjectStoreSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().didCreateObjectStore(IDBResultData::createObjectStoreSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->didCreateObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().didCreateObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -136,8 +142,8 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(isVersionChange());
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><del>-    
-    auto database = m_databaseConnection->database();
</del><ins>+
+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx"> 
</span><span class="cx">     database->deleteObjectStore(*this, objectStoreName, [this, requestData](const IDBError& error) {
</span><span class="lines">@@ -144,9 +150,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::deleteObjectStore (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->didDeleteObjectStore(IDBResultData::deleteObjectStoreSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().didDeleteObjectStore(IDBResultData::deleteObjectStoreSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->didDeleteObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().didDeleteObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -157,7 +163,7 @@
</span><span class="cx">     ASSERT(isVersionChange());
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx"> 
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx"> 
</span><span class="cx">     database->renameObjectStore(*this, objectStoreIdentifier, newName, [this, requestData](auto& error) {
</span><span class="lines">@@ -164,9 +170,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::renameObjectStore (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->didRenameObjectStore(IDBResultData::renameObjectStoreSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().didRenameObjectStore(IDBResultData::renameObjectStoreSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->didRenameObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().didRenameObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -176,7 +182,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx"> 
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx"> 
</span><span class="cx">     database->clearObjectStore(*this, objectStoreIdentifier, [this, requestData](auto& error) {
</span><span class="lines">@@ -183,9 +189,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::clearObjectStore (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->didClearObjectStore(IDBResultData::clearObjectStoreSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().didClearObjectStore(IDBResultData::clearObjectStoreSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->didClearObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().didClearObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -196,7 +202,7 @@
</span><span class="cx">     ASSERT(isVersionChange());
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx">     
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx"> 
</span><span class="cx">     database->createIndex(*this, info, [this, requestData](auto& error) {
</span><span class="lines">@@ -203,9 +209,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::createIndex (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->didCreateIndex(IDBResultData::createIndexSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().didCreateIndex(IDBResultData::createIndexSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->didCreateIndex(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().didCreateIndex(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -216,7 +222,7 @@
</span><span class="cx">     ASSERT(isVersionChange());
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx"> 
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->deleteIndex(*this, objectStoreIdentifier, indexName, [this, requestData](auto& error) {
</span><span class="lines">@@ -223,9 +229,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::createIndex (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->didDeleteIndex(IDBResultData::deleteIndexSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().didDeleteIndex(IDBResultData::deleteIndexSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->didDeleteIndex(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().didDeleteIndex(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -235,8 +241,8 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(isVersionChange());
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><del>-    
-    auto database = m_databaseConnection->database();
</del><ins>+
+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->renameIndex(*this, objectStoreIdentifier, indexIdentifier, newName, [this, requestData](auto& error) {
</span><span class="lines">@@ -243,9 +249,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::renameIndex (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->didRenameIndex(IDBResultData::renameIndexSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().didRenameIndex(IDBResultData::renameIndexSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->didRenameIndex(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().didRenameIndex(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -257,7 +263,7 @@
</span><span class="cx">     ASSERT(!isReadOnly());
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx">     
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->putOrAdd(requestData, keyData, value, overwriteMode, [this, requestData](auto& error, const IDBKeyData& key) {
</span><span class="lines">@@ -264,9 +270,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::putOrAdd (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->connectionToClient().didPutOrAdd(IDBResultData::putOrAddSuccess(requestData.requestIdentifier(), key));
</del><ins>+            databaseConnection().connectionToClient().didPutOrAdd(IDBResultData::putOrAddSuccess(requestData.requestIdentifier(), key));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->connectionToClient().didPutOrAdd(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().connectionToClient().didPutOrAdd(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -276,7 +282,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx"> 
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->getRecord(requestData, getRecordData, [this, requestData](auto& error, const IDBGetResult& result) {
</span><span class="lines">@@ -283,9 +289,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::getRecord (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->connectionToClient().didGetRecord(IDBResultData::getRecordSuccess(requestData.requestIdentifier(), result));
</del><ins>+            databaseConnection().connectionToClient().didGetRecord(IDBResultData::getRecordSuccess(requestData.requestIdentifier(), result));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->connectionToClient().didGetRecord(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().connectionToClient().didGetRecord(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -295,7 +301,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx">     
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->getAllRecords(requestData, getAllRecordsData, [this, requestData](auto& error, const IDBGetAllResult& result) {
</span><span class="lines">@@ -302,9 +308,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::getAllRecords (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->connectionToClient().didGetAllRecords(IDBResultData::getAllRecordsSuccess(requestData.requestIdentifier(), result));
</del><ins>+            databaseConnection().connectionToClient().didGetAllRecords(IDBResultData::getAllRecordsSuccess(requestData.requestIdentifier(), result));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->connectionToClient().didGetAllRecords(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().connectionToClient().didGetAllRecords(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -314,7 +320,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx">     
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->getCount(requestData, keyRangeData, [this, requestData](auto& error, uint64_t count) {
</span><span class="lines">@@ -321,9 +327,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::getCount (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->connectionToClient().didGetCount(IDBResultData::getCountSuccess(requestData.requestIdentifier(), count));
</del><ins>+            databaseConnection().connectionToClient().didGetCount(IDBResultData::getCountSuccess(requestData.requestIdentifier(), count));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->connectionToClient().didGetCount(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().connectionToClient().didGetCount(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -333,7 +339,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx">     
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->deleteRecord(requestData, keyRangeData, [this, requestData](auto& error) {
</span><span class="lines">@@ -340,9 +346,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::deleteRecord (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->connectionToClient().didDeleteRecord(IDBResultData::deleteRecordSuccess(requestData.requestIdentifier()));
</del><ins>+            databaseConnection().connectionToClient().didDeleteRecord(IDBResultData::deleteRecordSuccess(requestData.requestIdentifier()));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->connectionToClient().didDeleteRecord(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().connectionToClient().didDeleteRecord(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -352,7 +358,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx">     
</span><del>-    auto database = m_databaseConnection->database();
</del><ins>+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->openCursor(requestData, info, [this, requestData](auto& error, const IDBGetResult& result) {
</span><span class="lines">@@ -359,9 +365,9 @@
</span><span class="cx">         LOG(IndexedDB, "UniqueIDBDatabaseTransaction::openCursor (callback)");
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->connectionToClient().didOpenCursor(IDBResultData::openCursorSuccess(requestData.requestIdentifier(), result));
</del><ins>+            databaseConnection().connectionToClient().didOpenCursor(IDBResultData::openCursorSuccess(requestData.requestIdentifier(), result));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->connectionToClient().didOpenCursor(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().connectionToClient().didOpenCursor(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -370,8 +376,8 @@
</span><span class="cx">     LOG(IndexedDB, "UniqueIDBDatabaseTransaction::iterateCursor");
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><del>-    
-    auto database = m_databaseConnection->database();
</del><ins>+
+    auto database = databaseConnection().database();
</ins><span class="cx">     ASSERT(database);
</span><span class="cx">     
</span><span class="cx">     database->iterateCursor(requestData, data, [this, requestData, option = data.option](auto& error, const IDBGetResult& result) {
</span><span class="lines">@@ -381,9 +387,9 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection->connectionToClient().didIterateCursor(IDBResultData::iterateCursorSuccess(requestData.requestIdentifier(), result));
</del><ins>+            databaseConnection().connectionToClient().didIterateCursor(IDBResultData::iterateCursorSuccess(requestData.requestIdentifier(), result));
</ins><span class="cx">         else
</span><del>-            m_databaseConnection->connectionToClient().didIterateCursor(IDBResultData::error(requestData.requestIdentifier(), error));
</del><ins>+            databaseConnection().connectionToClient().didIterateCursor(IDBResultData::error(requestData.requestIdentifier(), error));
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -392,7 +398,7 @@
</span><span class="cx">     if (!m_objectStoreIdentifiers.isEmpty())
</span><span class="cx">         return m_objectStoreIdentifiers;
</span><span class="cx"> 
</span><del>-    auto& info = m_databaseConnection->database()->info();
</del><ins>+    auto& info = databaseConnection().database()->info();
</ins><span class="cx">     for (const auto& objectStoreName : info.objectStoreNames()) {
</span><span class="cx">         auto objectStoreInfo = info.infoForExistingObjectStore(objectStoreName);
</span><span class="cx">         ASSERT(objectStoreInfo);
</span><span class="lines">@@ -410,7 +416,7 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, "UniqueIDBDatabaseTransaction::didActivateInBackingStore");
</span><span class="cx"> 
</span><del>-    m_databaseConnection->connectionToClient().didStartTransaction(m_transactionInfo.identifier(), error);
</del><ins>+    databaseConnection().connectionToClient().didStartTransaction(m_transactionInfo.identifier(), error);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBServer
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit232SourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (282549 => 282550)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h    2021-09-16 11:12:54 UTC (rev 282549)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h       2021-09-16 11:14:49 UTC (rev 282550)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> 
</span><span class="cx">     ~UniqueIDBDatabaseTransaction();
</span><span class="cx"> 
</span><del>-    UniqueIDBDatabaseConnection& databaseConnection() { return *m_databaseConnection; }
</del><ins>+    UniqueIDBDatabaseConnection& databaseConnection();
</ins><span class="cx">     const IDBTransactionInfo& info() const { return m_transactionInfo; }
</span><span class="cx">     bool isVersionChange() const;
</span><span class="cx">     bool isReadOnly() const;
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx"> private:
</span><span class="cx">     UniqueIDBDatabaseTransaction(UniqueIDBDatabaseConnection&, const IDBTransactionInfo&);
</span><span class="cx"> 
</span><del>-    UniqueIDBDatabaseConnection* m_databaseConnection;
</del><ins>+    WeakPtr<UniqueIDBDatabaseConnection> m_databaseConnection;
</ins><span class="cx">     IDBTransactionInfo m_transactionInfo;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr<IDBDatabaseInfo> m_originalDatabaseInfo;
</span></span></pre>
</div>
</div>

</body>
</html>