Commit aadeb16f authored by Shubham Aggarwal's avatar Shubham Aggarwal Committed by Commit Bot

Migrate android_cache_database to use the new sql::Database constructor

Migrate uses of the relevant set_* functions on the sql::Database object
to use the new DatabaseOptions constructor instead.

This change should have no intended behavioral effect.

Bug: 1126968
Change-Id: I3b3983f2fdd9eb9f7d66283aa5fbe0363aa8fe7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505674Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Shubham Aggarwal <shuagga@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#824063}
parent 2713db45
......@@ -178,16 +178,14 @@ bool AndroidCacheDatabase::CreateDatabase(const base::FilePath& db_name) {
sql::Database::Delete(db_name_);
// Using a new connection, otherwise we can not create the database.
sql::Database connection;
//
// The db doesn't store too much data, so we don't need that big a page
// size or cache.
connection.set_page_size(2048);
connection.set_cache_size(32);
// Run the database in exclusive mode. Nobody else should be accessing the
//
// The database is open in exclusive mode. Nobody else should be accessing the
// database while we're running, and this will give somewhat improved perf.
connection.set_exclusive_locking();
sql::Database connection(
{.exclusive_locking = true, .page_size = 2048, .cache_size = 32});
if (!connection.Open(db_name_)) {
LOG(ERROR) << connection.GetErrorMessage();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment