Use base::BindOnce for PostTask callbacks.
TaskRunner::PostTask() takes a OnceCallback. Replace usage of
base::Bind(), which produces a RepeatingCallback, with base::BindOnce()
when the callback is created as a temporary inside of PostTask(). The
following regex was used to find instances that could be replaced:
(Post(?:Delayed)?Task)\((?:\n\s*)?FROM_HERE,(?:\n)?\s*base::Bind\(
Also replace any usage of base::Passed(&var) with std::move(var) for
variables passed to base::BindOnce(). base::Passed() isn't needed for
move-only types with OnceCallbacks.
This CL was uploaded by git cl split.
[email protected]
Bug: 714018
Change-Id: I0006446b31cb38b814e71685ed488e49b476b7ac
Reviewed-on: https://chromium-review.googlesource.com/c/1475640
Auto-Submit: kylechar <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Scott Violet <[email protected]>
Cr-Commit-Position: refs/heads/master@{#632699}
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc
index 17433d1..061c0c2 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -734,7 +734,7 @@
// urgent task.
base::CreateCOMSTATaskRunnerWithTraits(
{base::MayBlock(), base::TaskPriority::BEST_EFFORT})
- ->PostTask(FROM_HERE, base::Bind(&MigrateTaskbarPinsCallback));
+ ->PostTask(FROM_HERE, base::BindOnce(&MigrateTaskbarPinsCallback));
}
void GetIsPinnedToTaskbarState(