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

Unified Diff: webkit/appcache/appcache_storage_impl.cc

Issue 8820009: Appcache, local storage, indexed db, databases: skip exit-time deletion when restarting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 9 years 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 | « webkit/appcache/appcache_service.cc ('k') | webkit/database/database_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_storage_impl.cc
diff --git a/webkit/appcache/appcache_storage_impl.cc b/webkit/appcache/appcache_storage_impl.cc
index 78231c160762f8c39cc1d48744dc6fe6c10ae5e8..8363052d05778f4cf11b017d4123040ed85f36ba 100644
--- a/webkit/appcache/appcache_storage_impl.cc
+++ b/webkit/appcache/appcache_storage_impl.cc
@@ -72,14 +72,20 @@ bool DeleteGroupAndRelatedRecords(AppCacheDatabase* database,
return success;
}
-// Deletes all appcache data (if clear_all_data is true), or session-only
-// appcache data. Also, schedules the database to be destroyed.
+// Destroys |database|. If there is appcache data to be deleted
+// (|save_session_state| is false), deletes all appcache data (if
+// |clear_all_data| is true), or session-only appcache data (otherwise).
void CleanUpOnDatabaseThread(
AppCacheDatabase* database,
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy,
- bool clear_all_appcaches) {
+ bool clear_all_appcaches,
+ bool save_session_state) {
scoped_ptr<AppCacheDatabase> database_to_delete(database);
+ // If saving session state, only delete the database.
+ if (save_session_state)
+ return;
+
bool has_session_only_appcaches =
special_storage_policy.get() &&
special_storage_policy->HasSessionOnlyOrigins();
@@ -1191,7 +1197,8 @@ AppCacheStorageImpl::~AppCacheStorageImpl() {
FROM_HERE,
base::Bind(&CleanUpOnDatabaseThread, database_,
make_scoped_refptr(service_->special_storage_policy()),
- service()->clear_local_state_on_exit()));
+ service()->clear_local_state_on_exit(),
+ service()->save_session_state()));
}
}
« no previous file with comments | « webkit/appcache/appcache_service.cc ('k') | webkit/database/database_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698