Fix misuses of CrossThreadBind in AnimationWorkletMutatorDispatcherImpl

Straightforward replacement. CrossThreadBind was being used for passing
callback instances to functions that were expecting "Once callbacks".

BUG=963574
R=haraken@chromium.org, hiroshige@chromium.org

Change-Id: I9769928fca124d890163bd0c464b5a0b92ae7fca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621390
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#661898}
diff --git a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc
index fcb34a4b..d9f1f1e 100644
--- a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc
+++ b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc
@@ -123,7 +123,7 @@
     return;
 
   base::WaitableEvent event;
-  WTF::CrossThreadClosure on_done = CrossThreadBind(
+  CrossThreadOnceClosure on_done = CrossThreadBindOnce(
       &base::WaitableEvent::Signal, WTF::CrossThreadUnretained(&event));
   RequestMutations(std::move(on_done));
   event.Wait();
@@ -188,7 +188,7 @@
                            "AnimationWorkletMutatorDispatcherImpl::MutateAsync",
                            next_async_mutation_id);
 
-  WTF::CrossThreadClosure on_done = CrossThreadBind(
+  CrossThreadOnceClosure on_done = CrossThreadBindOnce(
       [](scoped_refptr<base::SingleThreadTaskRunner> host_queue,
          base::WeakPtr<AnimationWorkletMutatorDispatcherImpl> dispatcher,
          int next_async_mutation_id) {
@@ -278,7 +278,7 @@
 }
 
 void AnimationWorkletMutatorDispatcherImpl::RequestMutations(
-    WTF::CrossThreadClosure done_callback) {
+    CrossThreadOnceClosure done_callback) {
   DCHECK(client_);
   DCHECK(outputs_->get().IsEmpty());
 
@@ -291,7 +291,7 @@
   int next_request_index = 0;
   outputs_->get().Grow(num_requests);
   base::RepeatingClosure on_mutator_done = base::BarrierClosure(
-      num_requests, ConvertToBaseCallback(std::move(done_callback)));
+      num_requests, ConvertToBaseOnceCallback(std::move(done_callback)));
 
   for (const auto& pair : mutator_map_) {
     AnimationWorkletMutator* mutator = pair.key;
diff --git a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.h b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.h
index 25fba54..ab7eb71 100644
--- a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.h
+++ b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.h
@@ -96,7 +96,7 @@
   // Dispatches mutation update requests. The callback is triggered once all
   // mutation updates have been computed and it runs on the animation worklet
   // thread associated with the last mutation to complete.
-  void RequestMutations(WTF::CrossThreadClosure done_callback);
+  void RequestMutations(CrossThreadOnceClosure done_callback);
 
   void MutateAsynchronouslyInternal(AsyncMutationCompleteCallback);
 
diff --git a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc
index 4bade23..dd88330 100644
--- a/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc
+++ b/third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl_test.cc
@@ -360,26 +360,28 @@
  public:
   AnimationWorkletMutatorDispatcher::AsyncMutationCompleteCallback
   CreateIntermediateResultCallback(MutateStatus expected_result) {
-    return ConvertToBaseCallback(
-        CrossThreadBind(&AnimationWorkletMutatorDispatcherImplAsyncTest ::
-                            VerifyExpectedMutationResult,
-                        CrossThreadUnretained(this), expected_result));
+    return ConvertToBaseOnceCallback(
+        CrossThreadBindOnce(&AnimationWorkletMutatorDispatcherImplAsyncTest ::
+                                VerifyExpectedMutationResult,
+                            CrossThreadUnretained(this), expected_result));
   }
 
   AnimationWorkletMutatorDispatcher::AsyncMutationCompleteCallback
   CreateNotReachedCallback() {
-    return ConvertToBaseCallback(CrossThreadBind([](MutateStatus unused) {
-      NOTREACHED() << "Mutate complete callback should not have been triggered";
-    }));
+    return ConvertToBaseOnceCallback(
+        CrossThreadBindOnce([](MutateStatus unused) {
+          NOTREACHED()
+              << "Mutate complete callback should not have been triggered";
+        }));
   }
 
   AnimationWorkletMutatorDispatcher::AsyncMutationCompleteCallback
   CreateTestCompleteCallback(
       MutateStatus expected_result = MutateStatus::kCompletedWithUpdate) {
-    return ConvertToBaseCallback(
-        CrossThreadBind(&AnimationWorkletMutatorDispatcherImplAsyncTest ::
-                            VerifyCompletedMutationResultAndFinish,
-                        CrossThreadUnretained(this), expected_result));
+    return ConvertToBaseOnceCallback(
+        CrossThreadBindOnce(&AnimationWorkletMutatorDispatcherImplAsyncTest ::
+                                VerifyCompletedMutationResultAndFinish,
+                            CrossThreadUnretained(this), expected_result));
   }
 
   // Executes run loop until quit closure is called.