[go: nahoru, domu]

cc: Cleanup callback types (part 1).

Remove usage of deprecated base::Bind, base::Callback, base::Closure and
base::CancelableClosure types from cc/*. Where possible convert to the
corresponding once type. Otherwise replace with the repeating type which
is equivalent to the deprecated type.

This is the first of multiple CLs to cleanup callback types in cc/*.

ImageController::ProcessNextImageDecodeOnWorkerThread() has a slight
implementation change. This is necessary to accomodate
ImageDecodeRequest becoming move-only due to use of OnceCallback. The
implementation change should be a no-op functionality wise.

Bug: 714018
Change-Id: I16c4ad368a4865557406f8a64630ae14b61fecac
Reviewed-on: https://chromium-review.googlesource.com/c/1401368
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622132}
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc
index d0665b2..f0d7d2c 100644
--- a/cc/raster/gpu_raster_buffer_provider.cc
+++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -414,7 +414,7 @@
 
 uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback(
     const std::vector<const ResourcePool::InUsePoolResource*>& resources,
-    const base::Closure& callback,
+    base::OnceClosure callback,
     uint64_t pending_callback_id) const {
   gpu::SyncToken latest_sync_token;
   for (const auto* in_use : resources) {
@@ -433,7 +433,7 @@
     // Use the compositor context because we want this callback on the
     // compositor thread.
     compositor_context_provider_->ContextSupport()->SignalSyncToken(
-        latest_sync_token, callback);
+        latest_sync_token, std::move(callback));
   }
 
   return callback_id;