| Index: content/renderer/media/video_capture_impl_manager.cc
|
| diff --git a/content/renderer/media/video_capture_impl_manager.cc b/content/renderer/media/video_capture_impl_manager.cc
|
| index 1c052d70415517084a8a689cf3e868421d39d8fe..1293df831d4b6ff62e08fe8c524fa9f37a2c412c 100644
|
| --- a/content/renderer/media/video_capture_impl_manager.cc
|
| +++ b/content/renderer/media/video_capture_impl_manager.cc
|
| @@ -48,9 +48,6 @@ VideoCaptureImplManager::~VideoCaptureImplManager() {
|
| // Forcibly release all video capture resources.
|
| for (const auto& device : devices_) {
|
| VideoCaptureImpl* const impl = device.second.second;
|
| - ChildProcess::current()->io_task_runner()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&VideoCaptureImpl::DeInit, base::Unretained(impl)));
|
| ChildProcess::current()->io_task_runner()->DeleteSoon(FROM_HERE, impl);
|
| }
|
| devices_.clear();
|
| @@ -63,11 +60,11 @@ base::Closure VideoCaptureImplManager::UseDevice(
|
| const VideoCaptureDeviceMap::iterator it = devices_.find(id);
|
| if (it == devices_.end()) {
|
| impl = CreateVideoCaptureImplForTesting(id, filter_.get());
|
| - if (!impl)
|
| - impl = new VideoCaptureImpl(id, filter_.get());
|
| + if (!impl) {
|
| + impl = new VideoCaptureImpl(id, filter_.get(),
|
| + ChildProcess::current()->io_task_runner());
|
| + }
|
| devices_[id] = std::make_pair(1, impl);
|
| - ChildProcess::current()->io_task_runner()->PostTask(
|
| - FROM_HERE, base::Bind(&VideoCaptureImpl::Init, base::Unretained(impl)));
|
| } else {
|
| ++it->second.first;
|
| }
|
| @@ -162,9 +159,6 @@ void VideoCaptureImplManager::UnrefDevice(
|
| --it->second.first;
|
| if (!it->second.first) {
|
| devices_.erase(id);
|
| - ChildProcess::current()->io_task_runner()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&VideoCaptureImpl::DeInit, base::Unretained(impl)));
|
| ChildProcess::current()->io_task_runner()->DeleteSoon(FROM_HERE, impl);
|
| }
|
| }
|
|
|