From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- chromium/sql/database.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'chromium/sql/database.h') 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 = ' 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 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. // -- cgit v1.2.1