summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/Sqlite.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /toolkit/modules/Sqlite.sys.mjs
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/modules/Sqlite.sys.mjs')
-rw-r--r--toolkit/modules/Sqlite.sys.mjs41
1 files changed, 31 insertions, 10 deletions
diff --git a/toolkit/modules/Sqlite.sys.mjs b/toolkit/modules/Sqlite.sys.mjs
index b1f48c28be..ca58904d6b 100644
--- a/toolkit/modules/Sqlite.sys.mjs
+++ b/toolkit/modules/Sqlite.sys.mjs
@@ -1184,9 +1184,15 @@ ConnectionData.prototype = Object.freeze({
* @param {string} destFilePath
* The path on the local filesystem to write the database copy. Any existing
* file at this path will be overwritten.
+ * @param {number} [pagesPerStep=0]
+ * The number of pages to copy per step. If not supplied or is 0, falls back
+ * to the platform default which is currently 5.
+ * @param {number} [stepDelayMs=0]
+ * The number of milliseconds to wait between copying step. If not supplied
+ * or is 0, falls back to the platform default which is currently 250.
* @return Promise<undefined, nsresult>
*/
- async backupToFile(destFilePath) {
+ async backupToFile(destFilePath, pagesPerStep = 0, stepDelayMs = 0) {
if (!this._dbConn) {
return Promise.reject(
new Error("No opened database connection to create a backup from.")
@@ -1194,13 +1200,18 @@ ConnectionData.prototype = Object.freeze({
}
let destFile = await IOUtils.getFile(destFilePath);
return new Promise((resolve, reject) => {
- this._dbConn.backupToFileAsync(destFile, result => {
- if (Components.isSuccessCode(result)) {
- resolve();
- } else {
- reject(result);
- }
- });
+ this._dbConn.backupToFileAsync(
+ destFile,
+ result => {
+ if (Components.isSuccessCode(result)) {
+ resolve();
+ } else {
+ reject(result);
+ }
+ },
+ pagesPerStep,
+ stepDelayMs
+ );
});
},
});
@@ -2002,10 +2013,20 @@ OpenedConnection.prototype = Object.freeze({
* @param {string} destFilePath
* The path on the local filesystem to write the database copy. Any existing
* file at this path will be overwritten.
+ * @param {number} [pagesPerStep=0]
+ * The number of pages to copy per step. If not supplied or is 0, falls back
+ * to the platform default which is currently 5.
+ * @param {number} [stepDelayMs=0]
+ * The number of milliseconds to wait between copying step. If not supplied
+ * or is 0, falls back to the platform default which is currently 250.
* @return Promise<undefined, nsresult>
*/
- backup(destFilePath) {
- return this._connectionData.backupToFile(destFilePath);
+ backup(destFilePath, pagesPerStep = 0, stepDelayMs = 0) {
+ return this._connectionData.backupToFile(
+ destFilePath,
+ pagesPerStep,
+ stepDelayMs
+ );
},
});