Commit bb09dcd6 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

DOM Storage: Remove unused SQLite migration code.

Change-Id: I3673a9a4411c00b72a3e96b405ce726c9632ca4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359235
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798825}
parent 56fdaa91
...@@ -18,9 +18,7 @@ LegacyDomStorageDatabase::LegacyDomStorageDatabase( ...@@ -18,9 +18,7 @@ LegacyDomStorageDatabase::LegacyDomStorageDatabase(
const base::FilePath& file_path, const base::FilePath& file_path,
std::unique_ptr<FilesystemProxy> filesystem_proxy) std::unique_ptr<FilesystemProxy> filesystem_proxy)
: file_path_(file_path), filesystem_proxy_(std::move(filesystem_proxy)) { : file_path_(file_path), filesystem_proxy_(std::move(filesystem_proxy)) {
// Note: in normal use we should never get an empty backing path here. DCHECK(!file_path_.empty());
// However, the unit test for this class can contruct an instance
// with an empty path.
Init(); Init();
} }
...@@ -167,22 +165,13 @@ bool LegacyDomStorageDatabase::LazyOpen(bool create_if_needed) { ...@@ -167,22 +165,13 @@ bool LegacyDomStorageDatabase::LazyOpen(bool create_if_needed) {
// (tiny amount of) problems that mmap() may cause. // (tiny amount of) problems that mmap() may cause.
db_->set_mmap_disabled(); db_->set_mmap_disabled();
if (file_path_.empty()) { if (!db_->Open(file_path_)) {
// This code path should only be triggered by unit tests. LOG(ERROR) << "Unable to open DOM storage database at "
if (!db_->OpenInMemory()) { << file_path_.value() << " error: " << db_->GetErrorMessage();
NOTREACHED() << "Unable to open DOM storage database in memory."; if (database_exists && !tried_to_recreate_)
failed_to_open_ = true; return DeleteFileAndRecreate();
return false; failed_to_open_ = true;
} return false;
} else {
if (!db_->Open(file_path_)) {
LOG(ERROR) << "Unable to open DOM storage database at "
<< file_path_.value() << " error: " << db_->GetErrorMessage();
if (database_exists && !tried_to_recreate_)
return DeleteFileAndRecreate();
failed_to_open_ = true;
return false;
}
} }
// sql::Database uses UTF-8 encoding, but WebCore style databases use // sql::Database uses UTF-8 encoding, but WebCore style databases use
......
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