Commit 4682927e authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Use CrossThreadBindOnce in MockMediaStreamVideoSource

... when posting tasks. A task posted runs once, so
CrossThreadBindRepeating is not strictly correct.

This is now possible, after [1].

[1] crrev.com/c/1750043

R=jbroman@chromium.org

Change-Id: I3d783e09b91aa4b0fa4274d83600d401873fb45f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1752075
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686554}
parent 3bca4920
...@@ -55,10 +55,9 @@ void MockMediaStreamVideoSource::RequestRefreshFrame() { ...@@ -55,10 +55,9 @@ void MockMediaStreamVideoSource::RequestRefreshFrame() {
const scoped_refptr<media::VideoFrame> frame = const scoped_refptr<media::VideoFrame> frame =
media::VideoFrame::CreateColorFrame(format_.frame_size, 0, 0, 0, media::VideoFrame::CreateColorFrame(format_.frame_size, 0, 0, 0,
base::TimeDelta()); base::TimeDelta());
// TODO(crbug.com/964947): Remove the rebind of |frame_callback_|.
PostCrossThreadTask( PostCrossThreadTask(
*io_task_runner(), FROM_HERE, *io_task_runner(), FROM_HERE,
CrossThreadBindRepeating(frame_callback_, frame, base::TimeTicks())); CrossThreadBindOnce(frame_callback_, frame, base::TimeTicks()));
} }
} }
...@@ -97,11 +96,9 @@ void MockMediaStreamVideoSource::DeliverVideoFrame( ...@@ -97,11 +96,9 @@ void MockMediaStreamVideoSource::DeliverVideoFrame(
scoped_refptr<media::VideoFrame> frame) { scoped_refptr<media::VideoFrame> frame) {
DCHECK(!is_stopped_for_restart_); DCHECK(!is_stopped_for_restart_);
DCHECK(!frame_callback_.is_null()); DCHECK(!frame_callback_.is_null());
// TODO(crbug.com/964947): Remove the rebind of |frame_callback_|. PostCrossThreadTask(*io_task_runner(), FROM_HERE,
PostCrossThreadTask( CrossThreadBindOnce(frame_callback_, std::move(frame),
*io_task_runner(), FROM_HERE, base::TimeTicks()));
CrossThreadBindRepeating(frame_callback_, std::move(frame),
base::TimeTicks()));
} }
void MockMediaStreamVideoSource::StopSourceForRestartImpl() { void MockMediaStreamVideoSource::StopSourceForRestartImpl() {
......
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