summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/sqlite_server_bound_cert_store.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 08:31:43 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 08:31:43 +0000
commitbf510ed89ae0469951d8a9d39ca40e6c171db663 (patch)
tree781235082dd354a4731d32ac9322aff8ff30c73f /chrome/browser/net/sqlite_server_bound_cert_store.cc
parent52d213e0e78f33a43364913c1328cac0bac42299 (diff)
downloadchromium_src-bf510ed89ae0469951d8a9d39ca40e6c171db663.zip
chromium_src-bf510ed89ae0469951d8a9d39ca40e6c171db663.tar.gz
chromium_src-bf510ed89ae0469951d8a9d39ca40e6c171db663.tar.bz2
Unwire the clear on exit preference from the storage systems.
The "session only" rules should cover the functionality now UI changes and migration code will follow BUG=129349 TEST=added unit tests for the chrome/browser/net/sqlite* classes Review URL: https://chromiumcodereview.appspot.com/10447117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/sqlite_server_bound_cert_store.cc')
-rw-r--r--chrome/browser/net/sqlite_server_bound_cert_store.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/chrome/browser/net/sqlite_server_bound_cert_store.cc b/chrome/browser/net/sqlite_server_bound_cert_store.cc
index acf8ba9..0a297ee 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) {