diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-05 00:31:12 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-05 00:31:12 +0000 |
commit | 41ec4391675b6a93865433a4b46278f35807d24c (patch) | |
tree | 4f3ab0f62a54e772ab24eca624b5dd6cd4f3bff0 /chrome/browser/net | |
parent | 72d5300177e5d1e75289bafd39cd1a73240d327d (diff) | |
download | chromium_src-41ec4391675b6a93865433a4b46278f35807d24c.zip chromium_src-41ec4391675b6a93865433a4b46278f35807d24c.tar.gz chromium_src-41ec4391675b6a93865433a4b46278f35807d24c.tar.bz2 |
Remove unnecessary backend_ tests in SQLiteServerBoundCertStore and SQLitePersistentCookieStore.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/11748024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r-- | chrome/browser/net/sqlite_persistent_cookie_store.cc | 26 | ||||
-rw-r--r-- | chrome/browser/net/sqlite_server_bound_cert_store.cc | 23 |
2 files changed, 15 insertions, 34 deletions
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.cc b/chrome/browser/net/sqlite_persistent_cookie_store.cc index 370a9ef..42a34dc 100644 --- a/chrome/browser/net/sqlite_persistent_cookie_store.cc +++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc @@ -1082,38 +1082,28 @@ void SQLitePersistentCookieStore::LoadCookiesForKey( } void SQLitePersistentCookieStore::AddCookie(const net::CanonicalCookie& cc) { - if (backend_.get()) - backend_->AddCookie(cc); + backend_->AddCookie(cc); } void SQLitePersistentCookieStore::UpdateCookieAccessTime( const net::CanonicalCookie& cc) { - if (backend_.get()) - backend_->UpdateCookieAccessTime(cc); + backend_->UpdateCookieAccessTime(cc); } void SQLitePersistentCookieStore::DeleteCookie(const net::CanonicalCookie& cc) { - if (backend_.get()) - backend_->DeleteCookie(cc); + backend_->DeleteCookie(cc); } void SQLitePersistentCookieStore::SetForceKeepSessionState() { - if (backend_.get()) - backend_->SetForceKeepSessionState(); + backend_->SetForceKeepSessionState(); } void SQLitePersistentCookieStore::Flush(const base::Closure& callback) { - if (backend_.get()) - backend_->Flush(callback); - else if (!callback.is_null()) - MessageLoop::current()->PostTask(FROM_HERE, callback); + backend_->Flush(callback); } SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { - if (backend_.get()) { - backend_->Close(); - // Release our reference, it will probably still have a reference if the - // background thread has not run Close() yet. - backend_ = NULL; - } + backend_->Close(); + // We release our reference to the Backend, though it will probably still have + // a reference if the background thread has not run Close() yet. } diff --git a/chrome/browser/net/sqlite_server_bound_cert_store.cc b/chrome/browser/net/sqlite_server_bound_cert_store.cc index fb6ab57..b85e939 100644 --- a/chrome/browser/net/sqlite_server_bound_cert_store.cc +++ b/chrome/browser/net/sqlite_server_bound_cert_store.cc @@ -551,33 +551,24 @@ bool SQLiteServerBoundCertStore::Load( void SQLiteServerBoundCertStore::AddServerBoundCert( const net::DefaultServerBoundCertStore::ServerBoundCert& cert) { - if (backend_.get()) - backend_->AddServerBoundCert(cert); + backend_->AddServerBoundCert(cert); } void SQLiteServerBoundCertStore::DeleteServerBoundCert( const net::DefaultServerBoundCertStore::ServerBoundCert& cert) { - if (backend_.get()) - backend_->DeleteServerBoundCert(cert); + backend_->DeleteServerBoundCert(cert); } void SQLiteServerBoundCertStore::SetForceKeepSessionState() { - if (backend_.get()) - backend_->SetForceKeepSessionState(); + backend_->SetForceKeepSessionState(); } void SQLiteServerBoundCertStore::Flush(const base::Closure& completion_task) { - if (backend_.get()) - backend_->Flush(completion_task); - else if (!completion_task.is_null()) - MessageLoop::current()->PostTask(FROM_HERE, completion_task); + backend_->Flush(completion_task); } SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { - if (backend_.get()) { - backend_->Close(); - // Release our reference, it will probably still have a reference if the - // background thread has not run Close() yet. - backend_ = NULL; - } + backend_->Close(); + // We release our reference to the Backend, though it will probably still have + // a reference if the background thread has not run Close() yet. } |