Commit 5797f62b authored by Shubham Aggarwal's avatar Shubham Aggarwal Committed by Chromium LUCI CQ

Migrate legacy_dom_storage 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: Ia277a910bcc837e89aabdbb26c7a14bfbc0cdaad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595188Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Commit-Queue: Shubham Aggarwal <shuagga@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#839481}
parent e79a745b
......@@ -8,6 +8,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "components/services/storage/public/cpp/filesystem/filesystem_proxy.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/transaction.h"
#include "third_party/sqlite/sqlite3.h"
......@@ -153,13 +154,14 @@ bool LegacyDomStorageDatabase::LazyOpen(bool create_if_needed) {
return false;
}
db_ = std::make_unique<sql::Database>();
db_ = std::make_unique<sql::Database>(sql::DatabaseOptions{
// This database should only be accessed from the process hosting the
// storage service, so exclusive locking is appropriate.
.exclusive_locking = true,
.page_size = 4096,
.cache_size = 500});
db_->set_histogram_tag("DOMStorageDatabase");
// This database should only be accessed from the process hosting the storage
// service, so exclusive locking is appropriate.
db_->set_exclusive_locking();
// This database is only opened to migrate DOMStorage data to a new backend.
// Given the use case, mmap()'s performance improvements are not worth the
// (tiny amount of) problems that mmap() may cause.
......
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