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

Unified Diff: content/browser/indexed_db/indexed_db_transaction.cc

Issue 2941353002: Indexed DB: Use BindOnce / OnceCallback / OnceClosure where applicable (Closed)
Patch Set: Created 3 years, 6 months 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: content/browser/indexed_db/indexed_db_transaction.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc
index 4ec78446df46e2de53739b4d3cb6427d2765018a..1f0fce71a72c48f6e7b8cb70474774878ad7e1ce 100644
--- a/content/browser/indexed_db/indexed_db_transaction.cc
+++ b/content/browser/indexed_db/indexed_db_transaction.cc
@@ -145,10 +145,10 @@ void IndexedDBTransaction::ScheduleTask(blink::WebIDBTaskType type,
timeout_timer_.Stop();
used_ = true;
if (type == blink::kWebIDBTaskTypeNormal) {
- task_queue_.push(task);
+ task_queue_.push(std::move(task));
++diagnostics_.tasks_scheduled;
} else {
- preemptive_task_queue_.push(task);
+ preemptive_task_queue_.push(std::move(task));
}
RunTasksIfStarted();
}
@@ -172,8 +172,8 @@ void IndexedDBTransaction::RunTasksIfStarted() {
should_process_queue_ = true;
base::SequencedTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&IndexedDBTransaction::ProcessTaskQueue,
- ptr_factory_.GetWeakPtr()));
+ FROM_HERE, base::BindOnce(&IndexedDBTransaction::ProcessTaskQueue,
+ ptr_factory_.GetWeakPtr()));
}
void IndexedDBTransaction::Abort(const IndexedDBDatabaseError& error) {
@@ -254,7 +254,7 @@ void IndexedDBTransaction::Start() {
// front-end previously requested a commit; do the commit now, but not
// re-entrantly as that may renter the coordinator.
base::SequencedTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&CommitUnused, ptr_factory_.GetWeakPtr()));
+ FROM_HERE, base::BindOnce(&CommitUnused, ptr_factory_.GetWeakPtr()));
}
return;
}
@@ -485,7 +485,7 @@ void IndexedDBTransaction::ProcessTaskQueue() {
while (!task_queue->empty() && state_ != FINISHED) {
DCHECK_EQ(state_, STARTED);
Operation task(task_queue->pop());
- leveldb::Status result = task.Run(this);
+ leveldb::Status result = std::move(task).Run(this);
if (!pending_preemptive_events_) {
DCHECK(diagnostics_.tasks_completed < diagnostics_.tasks_scheduled);
++diagnostics_.tasks_completed;
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction.h ('k') | content/browser/indexed_db/indexed_db_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698