Commit 41ec4391 authored by mattm@chromium.org's avatar mattm@chromium.org

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
parent 72d53001
......@@ -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.
}
......@@ -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.
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment