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

Unified Diff: webkit/dom_storage/dom_storage_context.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/dom_storage/dom_storage_context.cc
diff --git a/webkit/dom_storage/dom_storage_context.cc b/webkit/dom_storage/dom_storage_context.cc
index e31019067cea7b9922f5e894dd30e741c1d0b5c9..b8c1c910f86813a1d0b1b4808a1e25fe086f4ef7 100644
--- a/webkit/dom_storage/dom_storage_context.cc
+++ b/webkit/dom_storage/dom_storage_context.cc
@@ -31,8 +31,7 @@ DomStorageContext::DomStorageContext(
sessionstorage_directory_(sessionstorage_directory),
task_runner_(task_runner),
is_shutdown_(false),
- clear_local_state_(false),
- save_session_state_(false),
+ force_keep_session_state_(false),
special_storage_policy_(special_storage_policy) {
// AtomicSequenceNum starts at 0 but we want to start session
// namespace ids at one since zero is reserved for the
@@ -129,21 +128,21 @@ void DomStorageContext::Shutdown() {
// Respect the content policy settings about what to
// keep and what to discard.
- if (save_session_state_)
+ if (force_keep_session_state_)
return; // Keep everything.
bool has_session_only_origins =
special_storage_policy_.get() &&
special_storage_policy_->HasSessionOnlyOrigins();
- if (clear_local_state_ || has_session_only_origins) {
+ if (has_session_only_origins) {
// We may have to delete something. We continue on the
// commit sequence after area shutdown tasks have cycled
// thru that sequence (and closed their database files).
bool success = task_runner_->PostShutdownBlockingTask(
FROM_HERE,
DomStorageTaskRunner::COMMIT_SEQUENCE,
- base::Bind(&DomStorageContext::ClearLocalStateInCommitSequence, this));
+ base::Bind(&DomStorageContext::ClearSessionOnlyOrigins, this));
DCHECK(success);
}
}
@@ -214,17 +213,15 @@ void DomStorageContext::CloneSessionNamespace(
CreateSessionNamespace(new_id);
}
-void DomStorageContext::ClearLocalStateInCommitSequence() {
+void DomStorageContext::ClearSessionOnlyOrigins() {
std::vector<UsageInfo> infos;
const bool kDontIncludeFileInfo = false;
GetUsageInfo(&infos, kDontIncludeFileInfo);
for (size_t i = 0; i < infos.size(); ++i) {
const GURL& origin = infos[i].origin;
- if (special_storage_policy_ &&
- special_storage_policy_->IsStorageProtected(origin))
+ if (special_storage_policy_->IsStorageProtected(origin))
continue;
- if (!clear_local_state_ &&
- !special_storage_policy_->IsStorageSessionOnly(origin))
+ if (!special_storage_policy_->IsStorageSessionOnly(origin))
continue;
const bool kNotRecursive = false;

Powered by Google App Engine
This is Rietveld 408576698