<!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>[280415] 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/280415">280415</a></dd>
<dt>Author</dt> <dd>sihui_liu@apple.com</dd>
<dt>Date</dt> <dd>2021-07-28 21:04:18 -0700 (Wed, 28 Jul 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement IDBTransaction.durability
https://bugs.webkit.org/show_bug.cgi?id=228289

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idlharness.any-expected.txt:
* web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt:
* web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt:
* web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt:

Source/WebCore:

Spec: https://www.w3.org/TR/IndexedDB/#dom-idbtransaction-durability
      https://www.w3.org/TR/IndexedDB/#dictdef-idbtransactionoptions

IDBTransaction.durability gives a hint about durability of a transaction. If it's strict, backend would try
syncing data to database file after transaction commit, which enforces durability. If it's relaxed, it means
data may stay in the OS buffer some time after transaction commit, which gives better performance. Firefox and
Chrome already implemented durability. They have different ways of setting durability, and we choose to use
TransactionOptions as spec.

Rebaselined existing tests.
New tests: storage/indexeddb/idbtransaction-durability-private.html
           storage/indexeddb/idbtransaction-durability.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Headers.cmake:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/indexeddb/IDBTransactionDurability.h: Added.
* Modules/indexeddb/IDBTransactionDurability.idl: Added.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
(WebCore::IDBServer::SQLiteIDBTransaction::durability const):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::clientTransaction):
(WebCore::IDBTransactionInfo::IDBTransactionInfo):
(WebCore::IDBTransactionInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::durability const):
(WebCore::IDBTransactionInfo::encode const):
(WebCore::IDBTransactionInfo::decode):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/sql/SQLiteDatabase.cpp:
(WebCore::checkpointModeValue):
(WebCore::SQLiteDatabase::checkpoint):
(WebCore::SQLiteDatabase::useWALJournalMode):
* platform/sql/SQLiteDatabase.h:

LayoutTests:

* storage/indexeddb/idbtransaction-durability-expected.txt: Added.
* storage/indexeddb/idbtransaction-durability-private-expected.txt: Added.
* storage/indexeddb/idbtransaction-durability-private.html: Added.
* storage/indexeddb/idbtransaction-durability.html: Added.
* storage/indexeddb/resources/idbtransaction-durability.js: Added.
(onOpenUpgradeNeeded):
(onOpenSuccess):
(onTransactionComplete):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidlharnessanyexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidlharnessanyworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBtransactionrelaxeddurabilitytentativeanyexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBtransactionrelaxeddurabilitytentativeanyworkerexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesinputxcfilelist">trunk/Source/WebCore/DerivedSources-input.xcfilelist</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesoutputxcfilelist">trunk/Source/WebCore/DerivedSources-output.xcfilelist</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseidl">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionidl">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteDatabasecpp">trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteDatabaseh">trunk/Source/WebCore/platform/sql/SQLiteDatabase.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbidbtransactiondurabilityexpectedtxt">trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbidbtransactiondurabilityprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbidbtransactiondurabilityprivatehtml">trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbidbtransactiondurabilityhtml">trunk/LayoutTests/storage/indexeddb/idbtransaction-durability.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesidbtransactiondurabilityjs">trunk/LayoutTests/storage/indexeddb/resources/idbtransaction-durability.js</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionDurabilityh">trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionDurabilityidl">trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/LayoutTests/ChangeLog 2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2021-07-28  Sihui Liu  <sihui_liu@apple.com>
+
+        Implement IDBTransaction.durability
+        https://bugs.webkit.org/show_bug.cgi?id=228289
+
+        Reviewed by Darin Adler.
+
+        * storage/indexeddb/idbtransaction-durability-expected.txt: Added.
+        * storage/indexeddb/idbtransaction-durability-private-expected.txt: Added.
+        * storage/indexeddb/idbtransaction-durability-private.html: Added.
+        * storage/indexeddb/idbtransaction-durability.html: Added.
+        * storage/indexeddb/resources/idbtransaction-durability.js: Added.
+        (onOpenUpgradeNeeded):
+        (onOpenSuccess):
+        (onTransactionComplete):
+
</ins><span class="cx"> 2021-07-28  Ayumi Kojima  <ayumi_kojima@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [ iPad ] platform/ipad/media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html is a flaky timeout.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2021-07-28  Sihui Liu  <sihui_liu@apple.com>
</span><span class="cx"> 
</span><ins>+        Implement IDBTransaction.durability
+        https://bugs.webkit.org/show_bug.cgi?id=228289
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/IndexedDB/idlharness.any-expected.txt:
+        * web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt:
+        * web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt:
+        * web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt:
+
+2021-07-28  Sihui Liu  <sihui_liu@apple.com>
+
</ins><span class="cx">         IDBFactory.databases should not return databases with invalid version
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=228554
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidlharnessanyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any-expected.txt (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any-expected.txt  2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any-expected.txt     2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> PASS IDBTransaction interface: existence and properties of interface prototype object's @@unscopables property
</span><span class="cx"> PASS IDBTransaction interface: attribute objectStoreNames
</span><span class="cx"> PASS IDBTransaction interface: attribute mode
</span><del>-FAIL IDBTransaction interface: attribute durability assert_true: The prototype object must have a property "durability" expected true got false
</del><ins>+PASS IDBTransaction interface: attribute durability
</ins><span class="cx"> PASS IDBTransaction interface: attribute db
</span><span class="cx"> PASS IDBTransaction interface: attribute error
</span><span class="cx"> PASS IDBTransaction interface: operation objectStore(DOMString)
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidlharnessanyworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt   2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt      2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> PASS IDBTransaction interface: existence and properties of interface prototype object's @@unscopables property
</span><span class="cx"> PASS IDBTransaction interface: attribute objectStoreNames
</span><span class="cx"> PASS IDBTransaction interface: attribute mode
</span><del>-FAIL IDBTransaction interface: attribute durability assert_true: The prototype object must have a property "durability" expected true got false
</del><ins>+PASS IDBTransaction interface: attribute durability
</ins><span class="cx"> PASS IDBTransaction interface: attribute db
</span><span class="cx"> PASS IDBTransaction interface: attribute error
</span><span class="cx"> PASS IDBTransaction interface: operation objectStore(DOMString)
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBtransactionrelaxeddurabilitytentativeanyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt    2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt       2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -1,10 +1,8 @@
</span><span class="cx"> 
</span><del>-FAIL Committed data can be read back out: case 0 assert_equals: expected (string) "default" but got (undefined) undefined
-FAIL Committed data can be read back out: case 1 assert_equals: expected (string) "default" but got (undefined) undefined
-FAIL Committed data can be read back out: case 2 assert_equals: expected (string) "default" but got (undefined) undefined
-FAIL Committed data can be read back out: case 3 assert_equals: expected (string) "relaxed" but got (undefined) undefined
-FAIL Committed data can be read back out: case 4 assert_equals: expected (string) "strict" but got (undefined) undefined
-FAIL Invalid durability option throws a TypeError assert_throws_js: function "function () {
-      db.transaction(['books'], 'readwrite', { durability: 'invalid' });
-  }" did not throw
</del><ins>+PASS Committed data can be read back out: case 0
+PASS Committed data can be read back out: case 1
+PASS Committed data can be read back out: case 2
+PASS Committed data can be read back out: case 3
+PASS Committed data can be read back out: case 4
+PASS Invalid durability option throws a TypeError
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBtransactionrelaxeddurabilitytentativeanyworkerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt     2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt        2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -1,10 +1,8 @@
</span><span class="cx"> 
</span><del>-FAIL Committed data can be read back out: case 0 assert_equals: expected (string) "default" but got (undefined) undefined
-FAIL Committed data can be read back out: case 1 assert_equals: expected (string) "default" but got (undefined) undefined
-FAIL Committed data can be read back out: case 2 assert_equals: expected (string) "default" but got (undefined) undefined
-FAIL Committed data can be read back out: case 3 assert_equals: expected (string) "relaxed" but got (undefined) undefined
-FAIL Committed data can be read back out: case 4 assert_equals: expected (string) "strict" but got (undefined) undefined
-FAIL Invalid durability option throws a TypeError assert_throws_js: function "function () {
-      db.transaction(['books'], 'readwrite', { durability: 'invalid' });
-  }" did not throw
</del><ins>+PASS Committed data can be read back out: case 0
+PASS Committed data can be read back out: case 1
+PASS Committed data can be read back out: case 2
+PASS Committed data can be read back out: case 3
+PASS Committed data can be read back out: case 4
+PASS Invalid durability option throws a TypeError
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbidbtransactiondurabilityexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-expected.txt (0 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-expected.txt                               (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-expected.txt  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Ensure durability of transaction is expected
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+
+onOpenUpgradeNeeded():
+database = event.target.result
+PASS event.target.transaction.durability is "default"
+
+onOpenSuccess():
+transaction = database.transaction('objectstore')
+PASS transaction.durability is "default"
+
+onTransactionComplete():
+PASS transaction.durability is "default"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbidbtransactiondurabilityprivateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private-expected.txt (0 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private-expected.txt                               (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private-expected.txt  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+Ensure durability of transaction is expected
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+
+onOpenUpgradeNeeded():
+database = event.target.result
+PASS event.target.transaction.durability is "default"
+
+onOpenSuccess():
+transaction = database.transaction('objectstore')
+PASS transaction.durability is "default"
+
+onTransactionComplete():
+PASS transaction.durability is "default"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbidbtransactiondurabilityprivatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private.html (0 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private.html                               (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/idbtransaction-durability-private.html  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<script src="resources/idbtransaction-durability.js"></script>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbidbtransactiondurabilityhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/idbtransaction-durability.html (0 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/idbtransaction-durability.html                               (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/idbtransaction-durability.html  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<script src="resources/idbtransaction-durability.js"></script>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesidbtransactiondurabilityjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/resources/idbtransaction-durability.js (0 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/idbtransaction-durability.js                               (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/idbtransaction-durability.js  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description('Ensure durability of transaction is expected');
+
+indexedDBTest(onOpenUpgradeNeeded, onOpenSuccess);
+
+function onOpenUpgradeNeeded(event)
+{
+    preamble(event);
+
+    database = evalAndLog('database = event.target.result');
+    database.createObjectStore('objectstore');
+    shouldBeEqualToString('event.target.transaction.durability', 'default');
+}
+
+function onOpenSuccess(event)
+{
+    preamble(event);
+
+    transaction = evalAndLog("transaction = database.transaction('objectstore')");
+    transaction.oncomplete = onTransactionComplete;
+    shouldBeEqualToString('transaction.durability', 'default');
+}
+
+function onTransactionComplete(event)
+{
+    preamble(event);
+
+    shouldBeEqualToString('transaction.durability', 'default');
+    finishJSTest();
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt      2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/CMakeLists.txt 2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -303,6 +303,7 @@
</span><span class="cx">     Modules/indexeddb/IDBOpenDBRequest.idl
</span><span class="cx">     Modules/indexeddb/IDBRequest.idl
</span><span class="cx">     Modules/indexeddb/IDBTransaction.idl
</span><ins>+    Modules/indexeddb/IDBTransactionDurability.idl
</ins><span class="cx">     Modules/indexeddb/IDBTransactionMode.idl
</span><span class="cx">     Modules/indexeddb/IDBVersionChangeEvent.idl
</span><span class="cx">     Modules/indexeddb/WindowOrWorkerGlobalScope+IndexedDatabase.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/ChangeLog      2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -1,5 +1,58 @@
</span><span class="cx"> 2021-07-28  Sihui Liu  <sihui_liu@apple.com>
</span><span class="cx"> 
</span><ins>+        Implement IDBTransaction.durability
+        https://bugs.webkit.org/show_bug.cgi?id=228289
+
+        Reviewed by Darin Adler.
+
+        Spec: https://www.w3.org/TR/IndexedDB/#dom-idbtransaction-durability
+              https://www.w3.org/TR/IndexedDB/#dictdef-idbtransactionoptions
+
+        IDBTransaction.durability gives a hint about durability of a transaction. If it's strict, backend would try
+        syncing data to database file after transaction commit, which enforces durability. If it's relaxed, it means 
+        data may stay in the OS buffer some time after transaction commit, which gives better performance. Firefox and 
+        Chrome already implemented durability. They have different ways of setting durability, and we choose to use
+        TransactionOptions as spec.
+
+        Rebaselined existing tests.
+        New tests: storage/indexeddb/idbtransaction-durability-private.html
+                   storage/indexeddb/idbtransaction-durability.html
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Headers.cmake:
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::transaction):
+        * Modules/indexeddb/IDBDatabase.h:
+        * Modules/indexeddb/IDBDatabase.idl:
+        * Modules/indexeddb/IDBTransaction.h:
+        * Modules/indexeddb/IDBTransaction.idl:
+        * Modules/indexeddb/IDBTransactionDurability.h: Added.
+        * Modules/indexeddb/IDBTransactionDurability.idl: Added.
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
+        * Modules/indexeddb/server/SQLiteIDBTransaction.h:
+        (WebCore::IDBServer::SQLiteIDBTransaction::durability const):
+        * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
+        (WebCore::IDBTransactionInfo::clientTransaction):
+        (WebCore::IDBTransactionInfo::IDBTransactionInfo):
+        (WebCore::IDBTransactionInfo::isolatedCopy):
+        * Modules/indexeddb/shared/IDBTransactionInfo.h:
+        (WebCore::IDBTransactionInfo::durability const):
+        (WebCore::IDBTransactionInfo::encode const):
+        (WebCore::IDBTransactionInfo::decode):
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/sql/SQLiteDatabase.cpp:
+        (WebCore::checkpointModeValue):
+        (WebCore::SQLiteDatabase::checkpoint):
+        (WebCore::SQLiteDatabase::useWALJournalMode):
+        * platform/sql/SQLiteDatabase.h:
+
+2021-07-28  Sihui Liu  <sihui_liu@apple.com>
+
</ins><span class="cx">         IDBFactory.databases should not return databases with invalid version
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=228554
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesinputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources-input.xcfilelist     2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist        2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -151,6 +151,7 @@
</span><span class="cx"> $(PROJECT_DIR)/Modules/indexeddb/IDBOpenDBRequest.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/indexeddb/IDBRequest.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/indexeddb/IDBTransaction.idl
</span><ins>+$(PROJECT_DIR)/Modules/indexeddb/IDBTransactionDurability.idl
</ins><span class="cx"> $(PROJECT_DIR)/Modules/indexeddb/IDBTransactionMode.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/indexeddb/IDBVersionChangeEvent.idl
</span><span class="cx"> $(PROJECT_DIR)/Modules/indexeddb/WindowOrWorkerGlobalScope+IndexedDatabase.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesoutputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources-output.xcfilelist    2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist       2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -1167,6 +1167,8 @@
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBRequest.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBTransaction.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBTransaction.h
</span><ins>+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBTransactionDurability.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBTransactionDurability.h
</ins><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBTransactionMode.cpp
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBTransactionMode.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSIDBVersionChangeEvent.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make 2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/DerivedSources.make    2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -177,6 +177,7 @@
</span><span class="cx">     $(WebCore)/Modules/indexeddb/IDBOpenDBRequest.idl \
</span><span class="cx">     $(WebCore)/Modules/indexeddb/IDBRequest.idl \
</span><span class="cx">     $(WebCore)/Modules/indexeddb/IDBTransaction.idl \
</span><ins>+       $(WebCore)/Modules/indexeddb/IDBTransactionDurability.idl \
</ins><span class="cx">     $(WebCore)/Modules/indexeddb/IDBTransactionMode.idl \
</span><span class="cx">     $(WebCore)/Modules/indexeddb/IDBVersionChangeEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/indexeddb/WindowOrWorkerGlobalScope+IndexedDatabase.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Headers.cmake  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx">     Modules/indexeddb/IDBOpenDBRequest.h
</span><span class="cx">     Modules/indexeddb/IDBRequest.h
</span><span class="cx">     Modules/indexeddb/IDBTransaction.h
</span><ins>+    Modules/indexeddb/IDBTransactionDurability.h
</ins><span class="cx">     Modules/indexeddb/IDBTransactionMode.h
</span><span class="cx">     Modules/indexeddb/IDBValue.h
</span><span class="cx">     Modules/indexeddb/IndexedDB.h
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp   2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp      2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">     return m_versionChangeTransaction->createObjectStore(info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ExceptionOr<Ref<IDBTransaction>> IDBDatabase::transaction(StringOrVectorOfStrings&& storeNames, IDBTransactionMode mode)
</del><ins>+ExceptionOr<Ref<IDBTransaction>> IDBDatabase::transaction(StringOrVectorOfStrings&& storeNames, IDBTransactionMode mode, TransactionOptions options)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, "IDBDatabase::transaction");
</span><span class="cx"> 
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">     if (mode != IDBTransactionMode::Readonly && mode != IDBTransactionMode::Readwrite)
</span><span class="cx">         return Exception { TypeError };
</span><span class="cx"> 
</span><del>-    auto info = IDBTransactionInfo::clientTransaction(m_connectionProxy.get(), objectStores, mode);
</del><ins>+    auto info = IDBTransactionInfo::clientTransaction(m_connectionProxy.get(), objectStores, mode, options.durability);
</ins><span class="cx"> 
</span><span class="cx">     LOG(IndexedDBOperations, "IDB creating transaction: %s", info.loggingString().utf8().data());
</span><span class="cx">     auto transaction = IDBTransaction::create(*this, info);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h     2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -63,7 +63,10 @@
</span><span class="cx">     ExceptionOr<Ref<IDBObjectStore>> createObjectStore(const String& name, ObjectStoreParameters&&);
</span><span class="cx"> 
</span><span class="cx">     using StringOrVectorOfStrings = WTF::Variant<String, Vector<String>>;
</span><del>-    ExceptionOr<Ref<IDBTransaction>> transaction(StringOrVectorOfStrings&& storeNames, IDBTransactionMode);
</del><ins>+    struct TransactionOptions {
+        std::optional<IDBTransactionDurability> durability;
+    };
+    ExceptionOr<Ref<IDBTransaction>> transaction(StringOrVectorOfStrings&& storeNames, IDBTransactionMode, TransactionOptions = { });
</ins><span class="cx">     ExceptionOr<void> deleteObjectStore(const String& name);
</span><span class="cx">     void close();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl   2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl      2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -33,8 +33,7 @@
</span><span class="cx">     readonly attribute unsigned long long version;
</span><span class="cx">     readonly attribute DOMStringList objectStoreNames;
</span><span class="cx"> 
</span><del>-    // FIXME: 'transaction' should also take an optional 'IDBTransactionOptions' argument.
-    [NewObject] IDBTransaction transaction((DOMString or sequence<DOMString>) storeNames, optional IDBTransactionMode mode = "readonly");
</del><ins>+    [NewObject] IDBTransaction transaction((DOMString or sequence<DOMString>) storeNames, optional IDBTransactionMode mode = "readonly", optional IDBTransactionOptions options);
</ins><span class="cx">     undefined close();
</span><span class="cx"> 
</span><span class="cx">     [NewObject] IDBObjectStore createObjectStore(DOMString name, optional IDBObjectStoreParameters parameters);
</span><span class="lines">@@ -55,3 +54,7 @@
</span><span class="cx">     (DOMString or sequence<DOMString>)? keyPath = null;
</span><span class="cx">     boolean autoIncrement = false;
</span><span class="cx"> };
</span><ins>+
+dictionary IDBTransactionOptions {
+    IDBTransactionDurability durability = "default";
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h  2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h     2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx">     // IDBTransaction IDL
</span><span class="cx">     Ref<DOMStringList> objectStoreNames() const;
</span><span class="cx">     IDBTransactionMode mode() const { return m_info.mode(); }
</span><ins>+    IDBTransactionDurability durability() const { return m_info.durability(); }
</ins><span class="cx">     IDBDatabase* db();
</span><span class="cx">     DOMException* error() const;
</span><span class="cx">     ExceptionOr<Ref<IDBObjectStore>> objectStore(const String& name);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl        2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl   2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -32,8 +32,7 @@
</span><span class="cx"> ] interface IDBTransaction : EventTarget {
</span><span class="cx">     readonly attribute DOMStringList objectStoreNames;
</span><span class="cx">     readonly attribute IDBTransactionMode mode;
</span><del>-    // Implement 'durability'.
-    // readonly attribute IDBTransactionDurability durability;
</del><ins>+    readonly attribute IDBTransactionDurability durability;
</ins><span class="cx">     [SameObject] readonly attribute IDBDatabase db;
</span><span class="cx">     readonly attribute DOMException? error;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionDurabilityh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.h (0 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.h   2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/EnumTraits.h>
+
+namespace WebCore {
+
+enum class IDBTransactionDurability : uint8_t {
+    Strict,
+    Relaxed,
+    Default
+};
+
+} // namespace WebCore
+
+namespace WTF {
+
+template<> struct EnumTraits<WebCore::IDBTransactionDurability> {
+    using values = EnumValues<
+        WebCore::IDBTransactionDurability,
+        WebCore::IDBTransactionDurability::Strict,
+        WebCore::IDBTransactionDurability::Relaxed,
+        WebCore::IDBTransactionDurability::Default
+    >;
+};
+
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionDurabilityidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.idl (0 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.idl                              (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionDurability.idl 2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+] enum IDBTransactionDurability {
+    "strict",
+    "relaxed",
+    "default"
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp  2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp     2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -1149,8 +1149,11 @@
</span><span class="cx">             ASSERT(m_originalDatabaseInfoBeforeVersionChange);
</span><span class="cx">             m_databaseInfo = WTFMove(m_originalDatabaseInfoBeforeVersionChange);
</span><span class="cx">         }
</span><del>-    } else
</del><ins>+    } else {
</ins><span class="cx">         m_originalDatabaseInfoBeforeVersionChange = nullptr;
</span><ins>+        if (transaction->durability() == IDBTransactionDurability::Strict)
+            m_sqliteDB->checkpoint(SQLiteDatabase::CheckpointMode::Full);
+    }
</ins><span class="cx"> 
</span><span class="cx">     return error;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h     2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h        2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx">     void notifyCursorsOfChanges(int64_t objectStoreID);
</span><span class="cx"> 
</span><span class="cx">     IDBTransactionMode mode() const { return m_info.mode(); }
</span><ins>+    IDBTransactionDurability durability() const { return m_info.durability(); }
</ins><span class="cx">     bool inProgress() const;
</span><span class="cx"> 
</span><span class="cx">     SQLiteTransaction* sqliteTransaction() const { return m_sqliteTransaction.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp     2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp        2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -39,11 +39,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IDBTransactionInfo IDBTransactionInfo::clientTransaction(const IDBClient::IDBConnectionProxy& connectionProxy, const Vector<String>& objectStores, IDBTransactionMode mode)
</del><ins>+IDBTransactionInfo IDBTransactionInfo::clientTransaction(const IDBClient::IDBConnectionProxy& connectionProxy, const Vector<String>& objectStores, IDBTransactionMode mode, std::optional<IDBTransactionDurability> durability)
</ins><span class="cx"> {
</span><span class="cx">     IDBTransactionInfo result((IDBResourceIdentifier(connectionProxy)));
</span><ins>+    result.m_objectStores = objectStores;
</ins><span class="cx">     result.m_mode = mode;
</span><del>-    result.m_objectStores = objectStores;
</del><ins>+    if (durability)
+        result.m_durability = *durability;
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -61,6 +63,7 @@
</span><span class="cx"> IDBTransactionInfo::IDBTransactionInfo(const IDBTransactionInfo& info)
</span><span class="cx">     : m_identifier(info.identifier())
</span><span class="cx">     , m_mode(info.m_mode)
</span><ins>+    , m_durability(info.m_durability)
</ins><span class="cx">     , m_newVersion(info.m_newVersion)
</span><span class="cx">     , m_objectStores(info.m_objectStores)
</span><span class="cx"> {
</span><span class="lines">@@ -82,6 +85,7 @@
</span><span class="cx"> {
</span><span class="cx">     destination.m_identifier = source.m_identifier.isolatedCopy();
</span><span class="cx">     destination.m_mode = source.m_mode;
</span><ins>+    destination.m_durability = source.m_durability;
</ins><span class="cx">     destination.m_newVersion = source.m_newVersion;
</span><span class="cx"> 
</span><span class="cx">     destination.m_objectStores.reserveCapacity(source.m_objectStores.size());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h       2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "IDBDatabaseInfo.h"
</span><span class="cx"> #include "IDBResourceIdentifier.h"
</span><ins>+#include "IDBTransactionDurability.h"
</ins><span class="cx"> #include "IDBTransactionMode.h"
</span><span class="cx"> #include "IndexedDB.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="lines">@@ -44,7 +45,7 @@
</span><span class="cx"> class IDBTransactionInfo {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    static IDBTransactionInfo clientTransaction(const IDBClient::IDBConnectionProxy&, const Vector<String>& objectStores, IDBTransactionMode);
</del><ins>+    static IDBTransactionInfo clientTransaction(const IDBClient::IDBConnectionProxy&, const Vector<String>& objectStores, IDBTransactionMode, std::optional<IDBTransactionDurability>);
</ins><span class="cx">     static IDBTransactionInfo versionChange(const IDBServer::IDBConnectionToClient&, const IDBDatabaseInfo& originalDatabaseInfo, uint64_t newVersion);
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT IDBTransactionInfo(const IDBTransactionInfo&);
</span><span class="lines">@@ -59,6 +60,7 @@
</span><span class="cx">     const IDBResourceIdentifier& identifier() const { return m_identifier; }
</span><span class="cx"> 
</span><span class="cx">     IDBTransactionMode mode() const { return m_mode; }
</span><ins>+    IDBTransactionDurability durability() const { return m_durability; }
</ins><span class="cx">     uint64_t newVersion() const { return m_newVersion; }
</span><span class="cx"> 
</span><span class="cx">     const Vector<String>& objectStores() const { return m_objectStores; }
</span><span class="lines">@@ -81,6 +83,7 @@
</span><span class="cx">     IDBResourceIdentifier m_identifier;
</span><span class="cx"> 
</span><span class="cx">     IDBTransactionMode m_mode { IDBTransactionMode::Readonly };
</span><ins>+    IDBTransactionDurability m_durability { IDBTransactionDurability::Default };
</ins><span class="cx">     uint64_t m_newVersion { 0 };
</span><span class="cx">     Vector<String> m_objectStores;
</span><span class="cx">     std::unique_ptr<IDBDatabaseInfo> m_originalDatabaseInfo;
</span><span class="lines">@@ -90,7 +93,7 @@
</span><span class="cx"> void IDBTransactionInfo::encode(Encoder& encoder) const
</span><span class="cx"> {
</span><span class="cx">     encoder << m_identifier << m_newVersion << m_objectStores;
</span><del>-    encoder << m_mode;
</del><ins>+    encoder << m_mode << m_durability;
</ins><span class="cx"> 
</span><span class="cx">     encoder << !!m_originalDatabaseInfo;
</span><span class="cx">     if (m_originalDatabaseInfo)
</span><span class="lines">@@ -112,6 +115,9 @@
</span><span class="cx">     if (!decoder.decode(info.m_mode))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decode(info.m_durability))
+        return false;
+
</ins><span class="cx">     bool hasObject;
</span><span class="cx">     if (!decoder.decode(hasObject))
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/Sources.txt    2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -3210,6 +3210,7 @@
</span><span class="cx"> JSIDBOpenDBRequest.cpp
</span><span class="cx"> JSIDBRequest.cpp
</span><span class="cx"> JSIDBTransaction.cpp
</span><ins>+JSIDBTransactionDurability.cpp
</ins><span class="cx"> JSIDBTransactionMode.cpp
</span><span class="cx"> JSIDBVersionChangeEvent.cpp
</span><span class="cx"> JSIdleDeadline.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -2849,6 +2849,7 @@
</span><span class="cx">          935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 935F45410F7C3B5F00D7C1FB /* JSLazyEventListener.h */; };
</span><span class="cx">          935FBC4509BA00B900E230B1 /* EventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 935FBC4409BA00B900E230B1 /* EventListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          935FBCF209BA143B00E230B1 /* ExceptionCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 935FBCF109BA143B00E230B1 /* ExceptionCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               936583B726AB92B5004E61F4 /* IDBTransactionDurability.h in Headers */ = {isa = PBXBuildFile; fileRef = 936583B626AB9174004E61F4 /* IDBTransactionDurability.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */; };
</span><span class="cx">          9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 9377AB9F15DEFEEF0031FD04 /* Pagination.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          937FF3D51A1012D6008EBA31 /* DictionaryLookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 937FF3D41A1012D6008EBA31 /* DictionaryLookup.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -11706,6 +11707,8 @@
</span><span class="cx">          935F45410F7C3B5F00D7C1FB /* JSLazyEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLazyEventListener.h; sourceTree = "<group>"; };
</span><span class="cx">          935FBC4409BA00B900E230B1 /* EventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventListener.h; sourceTree = "<group>"; };
</span><span class="cx">          935FBCF109BA143B00E230B1 /* ExceptionCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionCode.h; sourceTree = "<group>"; };
</span><ins>+               936583B426AB8CB4004E61F4 /* IDBTransactionDurability.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBTransactionDurability.idl; sourceTree = "<group>"; };
+               936583B626AB9174004E61F4 /* IDBTransactionDurability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionDurability.h; sourceTree = "<group>"; };
</ins><span class="cx">           936B21F41DBBF8300052E117 /* CanvasPath.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CanvasPath.idl; sourceTree = "<group>"; };
</span><span class="cx">          936DD03A09CEAC270056AE8C /* Range.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Range.idl; sourceTree = "<group>"; };
</span><span class="cx">          9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "textAreaResizeCorner@2x.png"; sourceTree = "<group>"; };
</span><span class="lines">@@ -24432,6 +24435,8 @@
</span><span class="cx">                          51645B501B9F889B00F789CE /* IDBTransaction.cpp */,
</span><span class="cx">                          51645B511B9F889B00F789CE /* IDBTransaction.h */,
</span><span class="cx">                          51D719A6181106E00016DC51 /* IDBTransaction.idl */,
</span><ins>+                               936583B626AB9174004E61F4 /* IDBTransactionDurability.h */,
+                               936583B426AB8CB4004E61F4 /* IDBTransactionDurability.idl */,
</ins><span class="cx">                           838EF5361DC149DA008F0C39 /* IDBTransactionMode.h */,
</span><span class="cx">                          838EF5371DC149DA008F0C39 /* IDBTransactionMode.idl */,
</span><span class="cx">                          516103AD1CADB9A30016B4C7 /* IDBValue.cpp */,
</span><span class="lines">@@ -33127,6 +33132,7 @@
</span><span class="cx">                          9323B07023061F9700901C8B /* IDBSerializationContext.h in Headers */,
</span><span class="cx">                          5185FCBB1BB4CBF80012898F /* IDBServer.h in Headers */,
</span><span class="cx">                          5185FCAD1BB4C4E80012898F /* IDBTransaction.h in Headers */,
</span><ins>+                               936583B726AB92B5004E61F4 /* IDBTransactionDurability.h in Headers */,
</ins><span class="cx">                           5198F7AD1BBDD3EB00E2CC5F /* IDBTransactionInfo.h in Headers */,
</span><span class="cx">                          838EF5381DC149E2008F0C39 /* IDBTransactionMode.h in Headers */,
</span><span class="cx">                          516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp     2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp        2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -192,6 +192,31 @@
</span><span class="cx">     sqlite3_wal_hook(m_db, walAutomaticTruncationHook, nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static int checkpointModeValue(SQLiteDatabase::CheckpointMode mode)
+{
+    switch (mode) {
+    case SQLiteDatabase::CheckpointMode::Full:
+        return SQLITE_CHECKPOINT_FULL;
+    case SQLiteDatabase::CheckpointMode::Truncate:
+        return SQLITE_CHECKPOINT_TRUNCATE;
+    }
+}
+
+void SQLiteDatabase::checkpoint(CheckpointMode mode)
+{
+    SQLiteTransactionInProgressAutoCounter transactionCounter;
+    int result = sqlite3_wal_checkpoint_v2(m_db, nullptr, checkpointModeValue(mode), nullptr, nullptr);
+    if (result == SQLITE_OK)
+        return;
+
+    if (result == SQLITE_BUSY) {
+        LOG(SQLDatabase, "SQLite database checkpoint is blocked");
+        return;
+    }
+
+    LOG_ERROR("SQLite database failed to checkpoint: %s", lastErrorMsg());
+}
+
</ins><span class="cx"> void SQLiteDatabase::useWALJournalMode()
</span><span class="cx"> {
</span><span class="cx">     m_useWAL = true;
</span><span class="lines">@@ -207,15 +232,7 @@
</span><span class="cx">             LOG_ERROR("SQLite database failed to set journal_mode to WAL, error: %s", lastErrorMsg());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    {
-        SQLiteTransactionInProgressAutoCounter transactionCounter;
-        auto checkpointStatement = prepareStatement("PRAGMA wal_checkpoint(TRUNCATE)"_s);
-        if (checkpointStatement && checkpointStatement->step() == SQLITE_ROW) {
-            if (checkpointStatement->columnInt(0))
-                LOG(SQLDatabase, "SQLite database checkpoint is blocked");
-        } else
-            LOG_ERROR("SQLite database failed to checkpoint: %s", lastErrorMsg());
-    }
</del><ins>+    checkpoint(CheckpointMode::Truncate);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SQLiteDatabase::close(ShouldSetErrorState shouldSetErrorState)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabase.h (280414 => 280415)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteDatabase.h       2021-07-29 02:33:05 UTC (rev 280414)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabase.h  2021-07-29 04:04:18 UTC (rev 280415)
</span><span class="lines">@@ -97,6 +97,8 @@
</span><span class="cx">     // SQLITE_CHECKPOINT_TRUNCATE will invoke the busy handler if it can't acquire the necessary
</span><span class="cx">     // locks, which can lead to unintended delays.
</span><span class="cx">     void enableAutomaticWALTruncation();
</span><ins>+    enum class CheckpointMode : uint8_t { Full, Truncate };
+    void checkpoint(CheckpointMode);
</ins><span class="cx"> 
</span><span class="cx">     // Gets/sets the maximum size in bytes
</span><span class="cx">     // Depending on per-database attributes, the size will only be settable in units that are the page size of the database, which is established at creation
</span></span></pre>
</div>
</div>

</body>
</html>