| Index: chrome/browser/net/sqlite_origin_bound_cert_store.cc
|
| diff --git a/chrome/browser/net/sqlite_origin_bound_cert_store.cc b/chrome/browser/net/sqlite_origin_bound_cert_store.cc
|
| index 83d07bd335db5fa1ae5e705682d3eeed7093ec74..6c1d5192cafa616c55ac37fa8d6fa8ba59861999 100644
|
| --- a/chrome/browser/net/sqlite_origin_bound_cert_store.cc
|
| +++ b/chrome/browser/net/sqlite_origin_bound_cert_store.cc
|
| @@ -7,6 +7,7 @@
|
| #include <list>
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/bind.h"
|
| #include "base/file_path.h"
|
| #include "base/file_util.h"
|
| #include "base/logging.h"
|
| @@ -47,7 +48,7 @@ class SQLiteOriginBoundCertStore::Backend
|
| const net::DefaultOriginBoundCertStore::OriginBoundCert& cert);
|
|
|
| // Commit pending operations as soon as possible.
|
| - void Flush(Task* completion_task);
|
| + void Flush(const base::Closure& completion_task);
|
|
|
| // Commit any pending operations and close the database. This must be called
|
| // before the object is destructed.
|
| @@ -322,11 +323,12 @@ void SQLiteOriginBoundCertStore::Backend::Commit() {
|
| transaction.Commit();
|
| }
|
|
|
| -void SQLiteOriginBoundCertStore::Backend::Flush(Task* completion_task) {
|
| +void SQLiteOriginBoundCertStore::Backend::Flush(
|
| + const base::Closure& completion_task) {
|
| DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::DB));
|
| BrowserThread::PostTask(
|
| - BrowserThread::DB, FROM_HERE, NewRunnableMethod(this, &Backend::Commit));
|
| - if (completion_task) {
|
| + BrowserThread::DB, FROM_HERE, base::Bind(&Backend::Commit, this));
|
| + if (!completion_task.is_null()) {
|
| // We want the completion task to run immediately after Commit() returns.
|
| // Posting it from here means there is less chance of another task getting
|
| // onto the message queue first, than if we posted it from Commit() itself.
|
| @@ -398,9 +400,9 @@ void SQLiteOriginBoundCertStore::SetClearLocalStateOnExit(
|
| backend_->SetClearLocalStateOnExit(clear_local_state);
|
| }
|
|
|
| -void SQLiteOriginBoundCertStore::Flush(Task* completion_task) {
|
| +void SQLiteOriginBoundCertStore::Flush(const base::Closure& completion_task) {
|
| if (backend_.get())
|
| backend_->Flush(completion_task);
|
| - else if (completion_task)
|
| + else if (!completion_task.is_null())
|
| MessageLoop::current()->PostTask(FROM_HERE, completion_task);
|
| }
|
|
|