Commit 29477507 authored by Chris Mumford's avatar Chris Mumford Committed by Commit Bot

SessionStorage: Using DeleteDB to delete database.

base::DeleteFile ignores database locks, leveldb_chrome::DeleteDB does
not and is safer.

Bug: 802298
Change-Id: I6b30fb6826216c9e54a16569a133e1fbddfad98f
Reviewed-on: https://chromium-review.googlesource.com/1151543
Commit-Queue: Chris Mumford <cmumford@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578406}
parent 16fdc860
......@@ -7,6 +7,7 @@
#include <inttypes.h>
#include <stddef.h>
#include <utility>
#include <vector>
#include "base/files/file_util.h"
......@@ -430,7 +431,11 @@ bool SessionStorageDatabase::LazyOpen(bool create_if_needed) {
<< ", error: " << s.ToString();
// Clear the directory and try again.
base::DeleteFile(file_path_, true);
s = leveldb_chrome::DeleteDB(file_path_, leveldb_env::Options());
if (!s.ok()) {
LOG(WARNING) << "Failed to delete leveldb in " << file_path_.value()
<< ", error: " << s.ToString();
}
s = TryToOpen(&db_);
if (!s.ok()) {
LOG(WARNING) << "Failed to open leveldb in " << file_path_.value()
......
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