Commit dda34cae authored by Jose Lopes's avatar Jose Lopes Committed by Commit Bot

Migrate callbacks in video decode stats reporter.

In the following call chain, a periodic timer invokes the callback,
therefore, it must be a repeating callback:
* https://cs.chromium.org/chromium/src/media/blink/video_decode_stats_reporter.cc?rcl=26a281f509fa5217972a45cae8fff0a32e5a1f44&l=289
* https://cs.chromium.org/chromium/src/media/blink/video_decode_stats_reporter.cc?rcl=26a281f509fa5217972a45cae8fff0a32e5a1f44&l=286
* https://cs.chromium.org/chromium/src/media/blink/video_decode_stats_reporter.cc?rcl=26a281f509fa5217972a45cae8fff0a32e5a1f44&l=126

This is part of the base::Callback migration.

Context: https://cs.chromium.org/chromium/src/docs/callback.md?rcl=9fcc3764aea8f97e9f6de4a9ee61d554e67edcda&l=40

Bug: 714018
Change-Id: I234f6bdf2144e9b25665356873f606693563c996
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035956Reviewed-by: default avatardanakj <danakj@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Jose Lopes <jabolopes@google.com>
Cr-Commit-Position: refs/heads/master@{#742574}
parent 9778b34b
...@@ -32,7 +32,7 @@ namespace media { ...@@ -32,7 +32,7 @@ namespace media {
// finalized at destruction and process tear-down. // finalized at destruction and process tear-down.
class MEDIA_BLINK_EXPORT VideoDecodeStatsReporter { class MEDIA_BLINK_EXPORT VideoDecodeStatsReporter {
public: public:
using GetPipelineStatsCB = base::Callback<PipelineStatistics(void)>; using GetPipelineStatsCB = base::RepeatingCallback<PipelineStatistics(void)>;
VideoDecodeStatsReporter( VideoDecodeStatsReporter(
mojo::PendingRemote<mojom::VideoDecodeStatsRecorder> recorder_remote, mojo::PendingRemote<mojom::VideoDecodeStatsRecorder> recorder_remote,
......
...@@ -189,8 +189,8 @@ class VideoDecodeStatsReporterTest : public ::testing::Test { ...@@ -189,8 +189,8 @@ class VideoDecodeStatsReporterTest : public ::testing::Test {
const base::Optional<CdmConfig> cdm_config = kDefaultCdmConfig) { const base::Optional<CdmConfig> cdm_config = kDefaultCdmConfig) {
reporter_ = std::make_unique<VideoDecodeStatsReporter>( reporter_ = std::make_unique<VideoDecodeStatsReporter>(
SetupRecordInterceptor(&interceptor_), SetupRecordInterceptor(&interceptor_),
base::Bind(&VideoDecodeStatsReporterTest::GetPipelineStatsCB, base::BindRepeating(&VideoDecodeStatsReporterTest::GetPipelineStatsCB,
base::Unretained(this)), base::Unretained(this)),
profile, natural_size, key_system, cdm_config, task_runner_, profile, natural_size, key_system, cdm_config, task_runner_,
task_runner_->GetMockTickClock()); task_runner_->GetMockTickClock());
} }
......
...@@ -1993,8 +1993,8 @@ void WebMediaPlayerImpl::CreateVideoDecodeStatsReporter() { ...@@ -1993,8 +1993,8 @@ void WebMediaPlayerImpl::CreateVideoDecodeStatsReporter() {
// Create capabilities reporter and synchronize its initial state. // Create capabilities reporter and synchronize its initial state.
video_decode_stats_reporter_.reset(new VideoDecodeStatsReporter( video_decode_stats_reporter_.reset(new VideoDecodeStatsReporter(
std::move(recorder), std::move(recorder),
base::Bind(&WebMediaPlayerImpl::GetPipelineStatistics, base::BindRepeating(&WebMediaPlayerImpl::GetPipelineStatistics,
base::Unretained(this)), base::Unretained(this)),
pipeline_metadata_.video_decoder_config.profile(), pipeline_metadata_.video_decoder_config.profile(),
pipeline_metadata_.natural_size, key_system_, cdm_config_, pipeline_metadata_.natural_size, key_system_, cdm_config_,
frame_->GetTaskRunner(blink::TaskType::kInternalMedia))); frame_->GetTaskRunner(blink::TaskType::kInternalMedia)));
......
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