Commit 7b018da2 authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Commit Bot

[base] Apply BindOnceRewriter in //media

This change applies the BindOnceRewriter in //media.
This rewriter replaces calls to base::Bind and base::BindRepeating with
calls to base::BindOnce, in case the result is immediately assigned to a
base::OnceCallback. Given that base::RepeatingCallback is implicitly
convertible to base::OnceCallback, there is no change in functionality.

Steps:
  1. run_tool.py --tool base_bind_rewriters \
                 --tool-arg='--rewriter=bind_to_bind_once'
  2. git cl format

This CL was uploaded by git cl split.

R=jcliang@chromium.org

Bug: 714018
Change-Id: I51100250f1323f6a5fdc55060fb41d6fcb4dbf04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132450
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarRicky Liang <jcliang@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760410}
parent 906e52a6
...@@ -215,9 +215,8 @@ void VideoCaptureJpegDecoderImpl::FinishInitialization() { ...@@ -215,9 +215,8 @@ void VideoCaptureJpegDecoderImpl::FinishInitialization() {
decoder_task_runner_, std::move(remote_decoder)); decoder_task_runner_, std::move(remote_decoder));
decoder_->InitializeAsync( decoder_->InitializeAsync(
this, this, base::BindOnce(&VideoCaptureJpegDecoderImpl::OnInitializationDone,
base::BindRepeating(&VideoCaptureJpegDecoderImpl::OnInitializationDone, weak_ptr_factory_.GetWeakPtr()));
weak_ptr_factory_.GetWeakPtr()));
} }
void VideoCaptureJpegDecoderImpl::OnInitializationDone(bool success) { void VideoCaptureJpegDecoderImpl::OnInitializationDone(bool success) {
......
...@@ -1136,8 +1136,8 @@ void VideoFrameQualityValidator::Initialize(const gfx::Size& coded_size, ...@@ -1136,8 +1136,8 @@ void VideoFrameQualityValidator::Initialize(const gfx::Size& coded_size,
decoder_->Initialize( decoder_->Initialize(
config, false, nullptr, config, false, nullptr,
base::BindRepeating(&VideoFrameQualityValidator::InitializeCB, base::BindOnce(&VideoFrameQualityValidator::InitializeCB,
base::Unretained(this)), base::Unretained(this)),
base::BindRepeating(&VideoFrameQualityValidator::VerifyOutputFrame, base::BindRepeating(&VideoFrameQualityValidator::VerifyOutputFrame,
base::Unretained(this)), base::Unretained(this)),
base::NullCallback()); base::NullCallback());
...@@ -2567,8 +2567,8 @@ void VEANoInputClient::RequireBitstreamBuffers( ...@@ -2567,8 +2567,8 @@ void VEANoInputClient::RequireBitstreamBuffers(
// Timer is used to make sure there is no output frame in 100ms. // Timer is used to make sure there is no output frame in 100ms.
timer_.reset(new base::OneShotTimer()); timer_.reset(new base::OneShotTimer());
timer_->Start(FROM_HERE, base::TimeDelta::FromMilliseconds(100), timer_->Start(FROM_HERE, base::TimeDelta::FromMilliseconds(100),
base::Bind(&VEANoInputClient::SetState, base::Unretained(this), base::BindOnce(&VEANoInputClient::SetState,
CS_FINISHED)); base::Unretained(this), CS_FINISHED));
} }
void VEANoInputClient::BitstreamBufferReady( void VEANoInputClient::BitstreamBufferReady(
......
...@@ -216,8 +216,8 @@ class D3D11VideoDecoderTest : public ::testing::Test { ...@@ -216,8 +216,8 @@ class D3D11VideoDecoderTest : public ::testing::Test {
} }
decoder_->Initialize( decoder_->Initialize(
config, low_delay, cdm_context, config, low_delay, cdm_context,
base::BindRepeating(&D3D11VideoDecoderTest::CheckExpectedStatus, base::BindOnce(&D3D11VideoDecoderTest::CheckExpectedStatus,
base::Unretained(this), expectation), base::Unretained(this), expectation),
base::DoNothing(), base::DoNothing()); base::DoNothing(), base::DoNothing());
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
......
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