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

Unified Diff: chrome/browser/net/sqlite_origin_bound_cert_store.cc

Issue 8573031: base::Bind fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed net_unittest Created 9 years, 1 month 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_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);
}

Powered by Google App Engine
This is Rietveld 408576698