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

Unified Diff: webkit/dom_storage/local_storage_database_adapter.cc

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. Created 8 years, 8 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
Index: webkit/dom_storage/local_storage_database_adapter.cc
diff --git a/webkit/dom_storage/local_storage_database_adapter.cc b/webkit/dom_storage/local_storage_database_adapter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f19ebd09f9223dc7acb956fdb613e4cdbfb389de
--- /dev/null
+++ b/webkit/dom_storage/local_storage_database_adapter.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webkit/dom_storage/local_storage_database_adapter.h"
+
+#include "base/file_util.h"
+#include "webkit/dom_storage/dom_storage_database.h"
+
+namespace dom_storage {
+
+LocalStorageDatabaseAdapter::LocalStorageDatabaseAdapter(
+ DomStorageDatabase* db)
+ : db_(db) {
+}
+
+LocalStorageDatabaseAdapter::~LocalStorageDatabaseAdapter() { }
+
+void LocalStorageDatabaseAdapter::ReadAllValues(ValuesMap* result) {
+ db_->ReadAllValues(result);
+}
+
+bool LocalStorageDatabaseAdapter::CommitChanges(
+ bool clear_all_first, const ValuesMap& changes) {
+ return db_->CommitChanges(clear_all_first, changes);
+}
+
+void LocalStorageDatabaseAdapter::DeleteFiles() {
+ file_util::Delete(db_->file_path(), false);
+ file_util::Delete(
+ DomStorageDatabase::GetJournalFilePath(db_->file_path()), false);
+}
+
+void LocalStorageDatabaseAdapter::Reset() {
+ db_.reset(new DomStorageDatabase(db_->file_path()));
+}
+
+} // namespace dom_storage

Powered by Google App Engine
This is Rietveld 408576698