Commit 6a48d268 authored by Shubham Aggarwal's avatar Shubham Aggarwal Committed by Chromium LUCI CQ

Migrate media_history_store.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: I500612cf31a29d0529337d65eccb7724a1e20ec8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2595925Reviewed-by: default avatarBecca Hughes <beccahughes@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837845}
parent 7ceef142
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "net/cookies/cookie_change_dispatcher.h" #include "net/cookies/cookie_change_dispatcher.h"
#include "services/media_session/public/cpp/media_image.h" #include "services/media_session/public/cpp/media_image.h"
#include "services/media_session/public/cpp/media_position.h" #include "services/media_session/public/cpp/media_position.h"
#include "sql/database.h"
#include "sql/recovery.h" #include "sql/recovery.h"
#include "sql/statement.h" #include "sql/statement.h"
#include "sql/transaction.h" #include "sql/transaction.h"
...@@ -198,7 +199,10 @@ MediaHistoryStore::MediaHistoryStore( ...@@ -198,7 +199,10 @@ MediaHistoryStore::MediaHistoryStore(
scoped_refptr<base::UpdateableSequencedTaskRunner> db_task_runner) scoped_refptr<base::UpdateableSequencedTaskRunner> db_task_runner)
: db_task_runner_(db_task_runner), : db_task_runner_(db_task_runner),
db_path_(GetDBPath(profile)), db_path_(GetDBPath(profile)),
db_(std::make_unique<sql::Database>()), db_(std::make_unique<sql::Database>(
sql::DatabaseOptions{.exclusive_locking = true,
.page_size = 4096,
.cache_size = 500})),
meta_table_(std::make_unique<sql::MetaTable>()), meta_table_(std::make_unique<sql::MetaTable>()),
origin_table_(new MediaHistoryOriginTable(db_task_runner_)), origin_table_(new MediaHistoryOriginTable(db_task_runner_)),
playback_table_(new MediaHistoryPlaybackTable(db_task_runner_)), playback_table_(new MediaHistoryPlaybackTable(db_task_runner_)),
...@@ -216,7 +220,6 @@ MediaHistoryStore::MediaHistoryStore( ...@@ -216,7 +220,6 @@ MediaHistoryStore::MediaHistoryStore(
new MediaHistoryKaleidoscopeDataTable(db_task_runner_)), new MediaHistoryKaleidoscopeDataTable(db_task_runner_)),
initialization_successful_(false) { initialization_successful_(false) {
db_->set_histogram_tag("MediaHistory"); db_->set_histogram_tag("MediaHistory");
db_->set_exclusive_locking();
// To recover from corruption. // To recover from corruption.
db_->set_error_callback( db_->set_error_callback(
......
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