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

Unified Diff: webkit/dom_storage/dom_storage_area.cc

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/dom_storage_area.cc
diff --git a/webkit/dom_storage/dom_storage_area.cc b/webkit/dom_storage/dom_storage_area.cc
index 93946b8900fd0f74d9cf2ddb30aa133841251403..72120c6651445af5bcc2a0ad4f5416dee342a5e1 100644
--- a/webkit/dom_storage/dom_storage_area.cc
+++ b/webkit/dom_storage/dom_storage_area.cc
@@ -63,7 +63,7 @@ DomStorageArea::DomStorageArea(
is_shutdown_(false) {
if (namespace_id == kLocalStorageNamespaceId && !directory.empty()) {
FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_));
- backing_.reset(new DomStorageDatabase(path));
+ backing_.reset(new LocalStorageDatabase(path));
is_initial_import_done_ = false;
}
}
@@ -168,13 +168,14 @@ void DomStorageArea::DeleteOrigin() {
Clear();
return;
}
+ // FIXME(marja): session storage here...
map_ = new DomStorageMap(kPerAreaQuota);
if (backing_.get()) {
is_initial_import_done_ = false;
- backing_.reset(new DomStorageDatabase(backing_->file_path()));
+ backing_.reset(new LocalStorageDatabase(backing_->file_path()));
file_util::Delete(backing_->file_path(), false);
file_util::Delete(
- DomStorageDatabase::GetJournalFilePath(backing_->file_path()), false);
+ LocalStorageDatabase::GetJournalFilePath(backing_->file_path()), false);
}
}
@@ -191,7 +192,7 @@ void DomStorageArea::PurgeMemory() {
// Recreate the database object, this frees up the open sqlite connection
// and its page cache.
- backing_.reset(new DomStorageDatabase(backing_->file_path()));
+ backing_.reset(new LocalStorageDatabase(backing_->file_path()));
}
void DomStorageArea::Shutdown() {
@@ -216,7 +217,7 @@ void DomStorageArea::InitialImportIfNeeded() {
DCHECK(backing_.get());
ValuesMap initial_values;
- backing_->ReadAllValues(&initial_values);
+ backing_->ReadAllValues(namespace_id_, origin_, &initial_values);
map_->SwapValues(&initial_values);
is_initial_import_done_ = true;
}
@@ -262,6 +263,7 @@ void DomStorageArea::CommitChanges() {
// This method executes on the commit sequence.
DCHECK(in_flight_commit_batch_.get());
bool success = backing_->CommitChanges(
+ namespace_id_, origin_,
in_flight_commit_batch_->clear_all_first,
in_flight_commit_batch_->changed_values);
DCHECK(success); // TODO(michaeln): what if it fails?
@@ -290,6 +292,7 @@ void DomStorageArea::ShutdownInCommitSequence() {
if (commit_batch_.get()) {
// Commit any changes that accrued prior to the timer firing.
bool success = backing_->CommitChanges(
+ namespace_id_, origin_,
commit_batch_->clear_all_first,
commit_batch_->changed_values);
DCHECK(success);
« no previous file with comments | « no previous file | webkit/dom_storage/dom_storage_context.cc » ('j') | webkit/dom_storage/session_storage_database.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698