Commit 16067772 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Remove unnecessary base::Passed() with base::BindOnce()

The documentation on base::Callback<...> (src/docs/callback.md)
recommends against using base::Passed(...) with base::BindOnce.

> Avoid using `base::Passed()` with `base::BindOnce()`, as `std::move()`
> does the same thing and is more familiar.

This CL was uploaded by git cl split.

Bug: none
Change-Id: I5acc8f5c20d32b09780dac376fa92be0395257ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611886Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659504}
parent cd076b21
...@@ -23,8 +23,7 @@ namespace { ...@@ -23,8 +23,7 @@ namespace {
base::OnceClosure RunOnDestruction(base::OnceClosure task) { base::OnceClosure RunOnDestruction(base::OnceClosure task) {
return base::BindOnce( return base::BindOnce(
[](std::unique_ptr<base::ScopedClosureRunner>) {}, [](std::unique_ptr<base::ScopedClosureRunner>) {},
base::Passed( std::make_unique<base::ScopedClosureRunner>(std::move(task)));
std::make_unique<base::ScopedClosureRunner>(std::move(task))));
} }
base::OnceClosure PostOnDestruction( base::OnceClosure PostOnDestruction(
...@@ -35,7 +34,7 @@ base::OnceClosure PostOnDestruction( ...@@ -35,7 +34,7 @@ base::OnceClosure PostOnDestruction(
scoped_refptr<base::SingleThreadTaskRunner> task_queue) { scoped_refptr<base::SingleThreadTaskRunner> task_queue) {
task_queue->PostTask(FROM_HERE, std::move(task)); task_queue->PostTask(FROM_HERE, std::move(task));
}, },
base::Passed(std::move(task)), task_queue)); std::move(task), task_queue));
} }
TEST(BrowserUIThreadSchedulerTest, DestructorPostChainDuringShutdown) { TEST(BrowserUIThreadSchedulerTest, DestructorPostChainDuringShutdown) {
......
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