| Index: content/renderer/media/video_capture_impl.cc
|
| diff --git a/content/renderer/media/video_capture_impl.cc b/content/renderer/media/video_capture_impl.cc
|
| index 43d59930d052fecb3d8a48834a2b76c55e060d7e..583fb97bb9e68b9fffc02977cecb96879447632e 100644
|
| --- a/content/renderer/media/video_capture_impl.cc
|
| +++ b/content/renderer/media/video_capture_impl.cc
|
| @@ -105,33 +105,24 @@ VideoCaptureImpl::ClientInfo::ClientInfo(const ClientInfo& other) = default;
|
| VideoCaptureImpl::ClientInfo::~ClientInfo() {}
|
|
|
| VideoCaptureImpl::VideoCaptureImpl(
|
| - const media::VideoCaptureSessionId session_id,
|
| - VideoCaptureMessageFilter* filter)
|
| + media::VideoCaptureSessionId session_id,
|
| + VideoCaptureMessageFilter* filter,
|
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
|
| : message_filter_(filter),
|
| device_id_(0),
|
| session_id_(session_id),
|
| suspended_(false),
|
| state_(VIDEO_CAPTURE_STATE_STOPPED),
|
| + io_task_runner_(std::move(io_task_runner)),
|
| weak_factory_(this) {
|
| DCHECK(filter);
|
| + io_task_runner_->PostTask(FROM_HERE,
|
| + base::Bind(&VideoCaptureMessageFilter::AddDelegate,
|
| + message_filter_, this));
|
| }
|
|
|
| VideoCaptureImpl::~VideoCaptureImpl() {
|
| DCHECK(io_task_runner_->BelongsToCurrentThread());
|
| -}
|
| -
|
| -void VideoCaptureImpl::Init() {
|
| - // For creating callbacks in unittest, this class may be constructed from a
|
| - // different thread than the IO thread, e.g. wherever unittest runs on.
|
| - // Therefore, this function should define the thread ownership.
|
| -#if DCHECK_IS_ON()
|
| - io_task_runner_ = base::ThreadTaskRunnerHandle::Get();
|
| -#endif
|
| - message_filter_->AddDelegate(this);
|
| -}
|
| -
|
| -void VideoCaptureImpl::DeInit() {
|
| - DCHECK(io_task_runner_->BelongsToCurrentThread());
|
| if (state_ == VIDEO_CAPTURE_STATE_STARTED)
|
| Send(new VideoCaptureHostMsg_Stop(device_id_));
|
| message_filter_->RemoveDelegate(this);
|
|
|