Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1317)

Unified Diff: content/browser/service_worker/service_worker_database.cc

Issue 651133004: Make ServiceWorkerDatabase::DestroyDatabase() work on in-memory db (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/service_worker/service_worker_context_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_database.cc
diff --git a/content/browser/service_worker/service_worker_database.cc b/content/browser/service_worker/service_worker_database.cc
index 0bd5bbc09fd3012698773898a07a069ef2a458b5..5cc8cd0f93b0c98970e84af7c873ad71c6eb1311 100644
--- a/content/browser/service_worker/service_worker_database.cc
+++ b/content/browser/service_worker/service_worker_database.cc
@@ -725,8 +725,19 @@ ServiceWorkerDatabase::Status ServiceWorkerDatabase::DeleteAllDataForOrigin(
ServiceWorkerDatabase::Status ServiceWorkerDatabase::DestroyDatabase() {
DCHECK(sequence_checker_.CalledOnValidSequencedThread());
Disable(FROM_HERE, STATUS_OK);
+
+ leveldb::Options options;
+ if (path_.empty()) {
+ if (env_) {
+ options.env = env_.get();
+ } else {
+ // In-memory database not initialized.
+ return STATUS_OK;
+ }
+ }
+
return LevelDBStatusToStatus(
- leveldb::DestroyDB(path_.AsUTF8Unsafe(), leveldb::Options()));
+ leveldb::DestroyDB(path_.AsUTF8Unsafe(), options));
}
ServiceWorkerDatabase::Status ServiceWorkerDatabase::LazyOpen(
« no previous file with comments | « content/browser/service_worker/service_worker_context_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698