Commit 7538717f authored by Shubham Aggarwal's avatar Shubham Aggarwal Committed by Commit Bot

Migrate the Conversions API DB to use the new sql::Database constructor

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

This change should have no intended behaviour changes.

Bug: 1126968
Change-Id: Ic1f5cbde9420ae64b33353795ed29bffce6dfd0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505794
Commit-Queue: Shubham Aggarwal <shuagga@microsoft.com>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822787}
parent ad54de3e
......@@ -645,7 +645,8 @@ bool ConversionStorageSql::LazyInit(DbCreationPolicy creation_policy) {
return true;
}
db_ = std::make_unique<sql::Database>();
db_ = std::make_unique<sql::Database>(sql::DatabaseOptions{
.exclusive_locking = true, .page_size = 4096, .cache_size = 32});
db_->set_histogram_tag("Conversions");
// Supply this callback with a weak_ptr to avoid calling the error callback
......@@ -653,9 +654,6 @@ bool ConversionStorageSql::LazyInit(DbCreationPolicy creation_policy) {
db_->set_error_callback(
base::BindRepeating(&ConversionStorageSql::DatabaseErrorCallback,
weak_factory_.GetWeakPtr()));
db_->set_page_size(4096);
db_->set_cache_size(32);
db_->set_exclusive_locking();
const base::FilePath& dir = path_to_database_.DirName();
bool opened = false;
......
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