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

Unified Diff: chrome/browser/net/sqlite_server_bound_cert_store.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: chrome/browser/net/sqlite_server_bound_cert_store.cc
diff --git a/chrome/browser/net/sqlite_server_bound_cert_store.cc b/chrome/browser/net/sqlite_server_bound_cert_store.cc
index acf8ba99b029070cd16eec81267c4f3f72459743..0a297ee10f593725560a6384019f7c3cc1e8a126 100644
--- a/chrome/browser/net/sqlite_server_bound_cert_store.cc
+++ b/chrome/browser/net/sqlite_server_bound_cert_store.cc
@@ -36,7 +36,7 @@ class SQLiteServerBoundCertStore::Backend
: path_(path),
db_(NULL),
num_pending_(0),
- clear_local_state_on_exit_(false),
+ force_keep_session_state_(false),
clear_on_exit_policy_(clear_on_exit_policy) {
}
@@ -59,7 +59,7 @@ class SQLiteServerBoundCertStore::Backend
// before the object is destructed.
void Close();
- void SetClearLocalStateOnExit(bool clear_local_state);
+ void SetForceKeepSessionState();
private:
friend class base::RefCountedThreadSafe<SQLiteServerBoundCertStore::Backend>;
@@ -114,9 +114,9 @@ class SQLiteServerBoundCertStore::Backend
typedef std::list<PendingOperation*> PendingOperationsList;
PendingOperationsList pending_;
PendingOperationsList::size_type num_pending_;
- // True if the persistent store should be deleted upon destruction.
- bool clear_local_state_on_exit_;
- // Guard |pending_|, |num_pending_| and |clear_local_state_on_exit_|.
+ // True if the persistent store should skip clear on exit rules.
+ bool force_keep_session_state_;
+ // Guard |pending_|, |num_pending_| and |force_keep_session_state_|.
base::Lock lock_;
// Cache of origins we have certificates stored for.
@@ -476,15 +476,12 @@ void SQLiteServerBoundCertStore::Backend::InternalBackgroundClose() {
// Commit any pending operations
Commit();
- if (!clear_local_state_on_exit_ && clear_on_exit_policy_.get() &&
+ if (!force_keep_session_state_ && clear_on_exit_policy_.get() &&
clear_on_exit_policy_->HasClearOnExitOrigins()) {
DeleteCertificatesOnShutdown();
}
db_.reset();
-
- if (clear_local_state_on_exit_)
- file_util::Delete(path_, false);
}
void SQLiteServerBoundCertStore::Backend::DeleteCertificatesOnShutdown() {
@@ -523,10 +520,9 @@ void SQLiteServerBoundCertStore::Backend::DeleteCertificatesOnShutdown() {
LOG(WARNING) << "Unable to delete certificates on shutdown.";
}
-void SQLiteServerBoundCertStore::Backend::SetClearLocalStateOnExit(
- bool clear_local_state) {
+void SQLiteServerBoundCertStore::Backend::SetForceKeepSessionState() {
base::AutoLock locked(lock_);
- clear_local_state_on_exit_ = clear_local_state;
+ force_keep_session_state_ = true;
}
SQLiteServerBoundCertStore::SQLiteServerBoundCertStore(
@@ -552,10 +548,9 @@ void SQLiteServerBoundCertStore::DeleteServerBoundCert(
backend_->DeleteServerBoundCert(cert);
}
-void SQLiteServerBoundCertStore::SetClearLocalStateOnExit(
- bool clear_local_state) {
+void SQLiteServerBoundCertStore::SetForceKeepSessionState() {
if (backend_.get())
- backend_->SetClearLocalStateOnExit(clear_local_state);
+ backend_->SetForceKeepSessionState();
}
void SQLiteServerBoundCertStore::Flush(const base::Closure& completion_task) {

Powered by Google App Engine
This is Rietveld 408576698