summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_storage_impl.cc
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 10:44:03 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 10:44:03 +0000
commite9005779e42a908cb54400018b94a2f158116321 (patch)
tree4217188a1f8dea29170b89c87bcc8661a6003dc6 /webkit/appcache/appcache_storage_impl.cc
parentb5621306f7ff98d66d5a25920a8749f5034b6c7c (diff)
downloadchromium_src-e9005779e42a908cb54400018b94a2f158116321.zip
chromium_src-e9005779e42a908cb54400018b94a2f158116321.tar.gz
chromium_src-e9005779e42a908cb54400018b94a2f158116321.tar.bz2
Appcache, local storage, indexed db, databases: skip exit-time deletion when restarting.
BUG=104291 TEST={ChromeAppCacheServiceTest, DOMStorageTest, IndexedDBBrowserTest, DatabaseTrackerTest}.SaveSessionState Review URL: http://codereview.chromium.org/8820009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_storage_impl.cc')
-rw-r--r--webkit/appcache/appcache_storage_impl.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/webkit/appcache/appcache_storage_impl.cc b/webkit/appcache/appcache_storage_impl.cc
index 78231c1..8363052 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()));
}
}