Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: content/renderer/media/video_capture_impl_manager.cc

Issue 1142063003: content/child: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f72f3138e9768aed811af2116efef0784e17dd73..3b687ec91b2339a6768c3777a2aa2196c01134e8 100644
--- a/content/renderer/media/video_capture_impl_manager.cc
+++ b/content/renderer/media/video_capture_impl_manager.cc
@@ -47,12 +47,10 @@ VideoCaptureImplManager::~VideoCaptureImplManager() {
// Forcibly release all video capture resources.
for (const auto& device : devices_) {
VideoCaptureImpl* const impl = device.second.second;
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
+ ChildProcess::current()->io_task_runner()->PostTask(
FROM_HERE,
- base::Bind(&VideoCaptureImpl::DeInit,
- base::Unretained(impl)));
- ChildProcess::current()->io_message_loop_proxy()->DeleteSoon(FROM_HERE,
- impl);
+ base::Bind(&VideoCaptureImpl::DeInit, base::Unretained(impl)));
+ ChildProcess::current()->io_task_runner()->DeleteSoon(FROM_HERE, impl);
}
devices_.clear();
}
@@ -68,10 +66,8 @@ base::Closure VideoCaptureImplManager::UseDevice(
if (!impl)
impl = new VideoCaptureImpl(id, filter_.get());
devices_[id] = std::make_pair(1, impl);
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&VideoCaptureImpl::Init,
- base::Unretained(impl)));
+ ChildProcess::current()->io_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&VideoCaptureImpl::Init, base::Unretained(impl)));
} else {
++it->second.first;
}
@@ -92,14 +88,10 @@ base::Closure VideoCaptureImplManager::StartCapture(
// This ID is used to identify a client of VideoCaptureImpl.
const int client_id = ++next_client_id_;
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
+ ChildProcess::current()->io_task_runner()->PostTask(
FROM_HERE,
- base::Bind(&VideoCaptureImpl::StartCapture,
- base::Unretained(impl),
- client_id,
- params,
- state_update_cb,
- deliver_frame_cb));
+ base::Bind(&VideoCaptureImpl::StartCapture, base::Unretained(impl),
+ client_id, params, state_update_cb, deliver_frame_cb));
return base::Bind(&VideoCaptureImplManager::StopCapture,
weak_factory_.GetWeakPtr(),
client_id, id);
@@ -112,10 +104,9 @@ void VideoCaptureImplManager::GetDeviceSupportedFormats(
const VideoCaptureDeviceMap::const_iterator it = devices_.find(id);
DCHECK(it != devices_.end());
VideoCaptureImpl* const impl = it->second.second;
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&VideoCaptureImpl::GetDeviceSupportedFormats,
- base::Unretained(impl), callback));
+ ChildProcess::current()->io_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&VideoCaptureImpl::GetDeviceSupportedFormats,
+ base::Unretained(impl), callback));
}
void VideoCaptureImplManager::GetDeviceFormatsInUse(
@@ -125,10 +116,9 @@ void VideoCaptureImplManager::GetDeviceFormatsInUse(
const VideoCaptureDeviceMap::const_iterator it = devices_.find(id);
DCHECK(it != devices_.end());
VideoCaptureImpl* const impl = it->second.second;
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&VideoCaptureImpl::GetDeviceFormatsInUse,
- base::Unretained(impl), callback));
+ ChildProcess::current()->io_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&VideoCaptureImpl::GetDeviceFormatsInUse,
+ base::Unretained(impl), callback));
}
VideoCaptureImpl*
@@ -144,10 +134,9 @@ void VideoCaptureImplManager::StopCapture(int client_id,
const VideoCaptureDeviceMap::const_iterator it = devices_.find(id);
DCHECK(it != devices_.end());
VideoCaptureImpl* const impl = it->second.second;
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&VideoCaptureImpl::StopCapture,
- base::Unretained(impl), client_id));
+ ChildProcess::current()->io_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&VideoCaptureImpl::StopCapture,
+ base::Unretained(impl), client_id));
}
void VideoCaptureImplManager::UnrefDevice(
@@ -162,12 +151,10 @@ void VideoCaptureImplManager::UnrefDevice(
--it->second.first;
if (!it->second.first) {
devices_.erase(id);
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
+ ChildProcess::current()->io_task_runner()->PostTask(
FROM_HERE,
- base::Bind(&VideoCaptureImpl::DeInit,
- base::Unretained(impl)));
- ChildProcess::current()->io_message_loop_proxy()->DeleteSoon(FROM_HERE,
- impl);
+ base::Bind(&VideoCaptureImpl::DeInit, base::Unretained(impl)));
+ ChildProcess::current()->io_task_runner()->DeleteSoon(FROM_HERE, impl);
}
}
@@ -175,7 +162,7 @@ void VideoCaptureImplManager::SuspendDevices(bool suspend) {
DCHECK(render_main_message_loop_->BelongsToCurrentThread());
for (const auto& device : devices_) {
VideoCaptureImpl* const impl = device.second.second;
- ChildProcess::current()->io_message_loop_proxy()->PostTask(
+ ChildProcess::current()->io_task_runner()->PostTask(
FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture,
base::Unretained(impl), suspend));
}

Powered by Google App Engine
This is Rietveld 408576698