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

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: 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 3818c92f3c4320e42a33ad7c00a17b75e9e0bf29..f101f36d8ef5909ca352cf34ed339f6b96cee0d7 100644
--- a/chrome/browser/net/sqlite_server_bound_cert_store.cc
+++ b/chrome/browser/net/sqlite_server_bound_cert_store.cc
@@ -35,7 +35,7 @@ class SQLiteServerBoundCertStore::Backend
: path_(path),
db_(NULL),
num_pending_(0),
- clear_local_state_on_exit_(false),
+ save_session_state_(false),
clear_on_exit_policy_(clear_on_exit_policy) {
}
@@ -58,7 +58,7 @@ class SQLiteServerBoundCertStore::Backend
// before the object is destructed.
void Close();
- void SetClearLocalStateOnExit(bool clear_local_state);
+ void SaveSessionState();
private:
friend class base::RefCountedThreadSafe<SQLiteServerBoundCertStore::Backend>;
@@ -113,9 +113,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 save_session_state_;
mattm 2012/05/31 21:57:12 This variable name (and function that sets it) is
+ // Guard |pending_|, |num_pending_| and |save_session_state_|.
base::Lock lock_;
scoped_refptr<ClearOnExitPolicy> clear_on_exit_policy_;
@@ -469,15 +469,12 @@ void SQLiteServerBoundCertStore::Backend::InternalBackgroundClose() {
// Commit any pending operations
Commit();
- if (!clear_local_state_on_exit_ && clear_on_exit_policy_.get() &&
+ if (!save_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() {
@@ -528,10 +525,9 @@ void SQLiteServerBoundCertStore::Backend::DeleteCertificatesOnShutdown() {
LOG(WARNING) << "Unable to delete certificates on shutdown.";
}
-void SQLiteServerBoundCertStore::Backend::SetClearLocalStateOnExit(
- bool clear_local_state) {
+void SQLiteServerBoundCertStore::Backend::SaveSessionState() {
base::AutoLock locked(lock_);
- clear_local_state_on_exit_ = clear_local_state;
+ save_session_state_ = true;
}
SQLiteServerBoundCertStore::SQLiteServerBoundCertStore(
@@ -557,10 +553,9 @@ void SQLiteServerBoundCertStore::DeleteServerBoundCert(
backend_->DeleteServerBoundCert(cert);
}
-void SQLiteServerBoundCertStore::SetClearLocalStateOnExit(
- bool clear_local_state) {
+void SQLiteServerBoundCertStore::SaveSessionState() {
if (backend_.get())
- backend_->SetClearLocalStateOnExit(clear_local_state);
+ backend_->SaveSessionState();
}
void SQLiteServerBoundCertStore::Flush(const base::Closure& completion_task) {

Powered by Google App Engine
This is Rietveld 408576698