Commit 457560e7 authored by Shubham Aggarwal's avatar Shubham Aggarwal Committed by Chromium LUCI CQ

Migrate sql_store_base.cc 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: Ia16c6612c254187e31951027cfb4284d494dde44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2594287Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarJustin DeWitt <dewittj@chromium.org>
Commit-Queue: Shubham Aggarwal <shuagga@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#837721}
parent 2e8ce851
......@@ -37,11 +37,7 @@ bool InitializeSync(
const base::FilePath& path,
const std::string& histogram_tag,
base::OnceCallback<bool(sql::Database*)> initialize_schema) {
// These values are default.
db->set_page_size(4096);
db->set_cache_size(500);
db->set_histogram_tag(histogram_tag);
db->set_exclusive_locking();
const bool in_memory = path.empty();
if (!in_memory && !PrepareDirectory(path))
return false;
......@@ -102,7 +98,10 @@ void SqlStoreBase::Initialize(base::OnceClosure pending_command) {
// This is how we reset a pointer and provide deleter. This is necessary to
// ensure that we can close the store more than once.
db_ = DatabaseUniquePtr(new sql::Database,
db_ = DatabaseUniquePtr(new sql::Database({// These values are default.
.exclusive_locking = true,
.page_size = 4096,
.cache_size = 500}),
base::OnTaskRunnerDeleter(background_task_runner_));
base::PostTaskAndReplyWithResult(
......
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