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

Unified Diff: webkit/appcache/appcache_storage_impl.cc

Issue 10447117: Unwire the clear on exit preference from the storage systems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years, 7 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/appcache/appcache_storage_impl.cc
diff --git a/webkit/appcache/appcache_storage_impl.cc b/webkit/appcache/appcache_storage_impl.cc
index 1ddfaa468ff36b4811d225fd983534175a19c42c..3d8c785ca9089a15a20197bd0c0263f01113314f 100644
--- a/webkit/appcache/appcache_storage_impl.cc
+++ b/webkit/appcache/appcache_storage_impl.cc
@@ -75,17 +75,15 @@ bool DeleteGroupAndRelatedRecords(AppCacheDatabase* database,
}
// 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(
+// (|force_keep_session_state| is false), deletes session-only appcache data.
+void ClearSessionOnlyOrigins(
AppCacheDatabase* database,
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy,
- bool clear_all_appcaches,
- bool save_session_state) {
+ bool force_keep_session_state) {
scoped_ptr<AppCacheDatabase> database_to_delete(database);
// If saving session state, only delete the database.
- if (save_session_state)
+ if (force_keep_session_state)
return;
bool has_session_only_appcaches =
@@ -93,7 +91,7 @@ void CleanUpOnDatabaseThread(
special_storage_policy->HasSessionOnlyOrigins();
// Clearning only session-only databases, and there are none.
- if (!clear_all_appcaches && !has_session_only_appcaches)
+ if (!has_session_only_appcaches)
return;
std::set<GURL> origins;
@@ -109,8 +107,7 @@ void CleanUpOnDatabaseThread(
std::set<GURL>::const_iterator origin;
for (origin = origins.begin(); origin != origins.end(); ++origin) {
- if (!clear_all_appcaches &&
- !special_storage_policy->IsStorageSessionOnly(*origin))
+ if (!special_storage_policy->IsStorageSessionOnly(*origin))
continue;
if (special_storage_policy &&
special_storage_policy->IsStorageProtected(*origin))
@@ -1315,10 +1312,9 @@ AppCacheStorageImpl::~AppCacheStorageImpl() {
if (database_ &&
!db_thread_->PostTask(
FROM_HERE,
- base::Bind(&CleanUpOnDatabaseThread, database_,
+ base::Bind(&ClearSessionOnlyOrigins, database_,
make_scoped_refptr(service_->special_storage_policy()),
- service()->clear_local_state_on_exit(),
- service()->save_session_state()))) {
+ service()->force_keep_session_state()))) {
delete database_;
}
}

Powered by Google App Engine
This is Rietveld 408576698