summaryrefslogtreecommitdiff
path: root/chromium/sql/database.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/sql/database.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/sql/database.h')
-rw-r--r--chromium/sql/database.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/chromium/sql/database.h b/chromium/sql/database.h
index 18ccdcd7d3d..2bf8652f33c 100644
--- a/chromium/sql/database.h
+++ b/chromium/sql/database.h
@@ -88,6 +88,23 @@ class COMPONENT_EXPORT(SQL) Database {
cache_size_ = cache_size;
}
+ // Returns whether a database will be opened in WAL mode.
+ bool UseWALMode() const;
+
+ // Enables/disables WAL mode (https://www.sqlite.org/wal.html) when
+ // opening a new database.
+ //
+ // WAL mode is currently not fully supported on FuchsiaOS. It will only be
+ // turned on if the database is also using exclusive locking mode.
+ // (https://crbug.com/1082059)
+ //
+ // Note: Changing page size is not supported when in WAL mode. So running
+ // 'PRAGMA page_size = <new-size>' or using set_page_size will result in
+ // no-ops.
+ //
+ // This must be called before Open() to have an effect.
+ void want_wal_mode(bool enabled) { want_wal_mode_ = enabled; }
+
// Call to put the database in exclusive locking mode. There is no "back to
// normal" flag because of some additional requirements sqlite puts on this
// transaction (requires another access to the DB) and because we don't
@@ -396,6 +413,14 @@ class COMPONENT_EXPORT(SQL) Database {
// See GetCachedStatement above for examples and error information.
scoped_refptr<StatementRef> GetUniqueStatement(const char* sql);
+ // Performs a passive checkpoint on the main attached database if it is in
+ // WAL mode. Returns true if the checkpoint was successful and false in case
+ // of an error. It is a no-op if the database is not in WAL mode.
+ //
+ // Note: Checkpointing is a very slow operation and will block any writes
+ // until it is finished. Please use with care.
+ bool CheckpointDatabase();
+
// Info querying -------------------------------------------------------------
// Returns true if the given structure exists. Instead of test-then-create,
@@ -693,7 +718,9 @@ class COMPONENT_EXPORT(SQL) Database {
// use the default value.
int page_size_;
int cache_size_;
+
bool exclusive_locking_;
+ bool want_wal_mode_;
// Holds references to all cached statements so they remain active.
//