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

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

Issue 7058055: create one video capture message filter per renderer process (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: from code review Created 9 years, 6 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
« no previous file with comments | « content/renderer/media/video_capture_impl.h ('k') | content/renderer/media/video_capture_impl_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/video_capture_impl.cc
===================================================================
--- content/renderer/media/video_capture_impl.cc (revision 88354)
+++ content/renderer/media/video_capture_impl.cc (working copy)
@@ -68,7 +68,7 @@
void VideoCaptureImpl::DeInit(Task* task) {
if (state_ == kStarted)
- message_filter_->Send(new VideoCaptureHostMsg_Stop(0, device_id_));
+ Send(new VideoCaptureHostMsg_Stop(0, device_id_));
base::MessageLoopProxy* io_message_loop_proxy =
ChildProcess::current()->io_message_loop_proxy();
@@ -229,8 +229,7 @@
}
if (state_ != kStarted) {
- message_filter_->Send(
- new VideoCaptureHostMsg_BufferReady(0, device_id_, handle));
+ Send(new VideoCaptureHostMsg_BufferReady(0, device_id_, handle));
return;
}
@@ -259,8 +258,7 @@
it->first->OnBufferReady(this, buffer);
}
- message_filter_->Send(
- new VideoCaptureHostMsg_BufferReady(0, device_id_, handle));
+ Send(new VideoCaptureHostMsg_BufferReady(0, device_id_, handle));
}
void VideoCaptureImpl::OnStateChanged(
@@ -342,7 +340,7 @@
if (state_ == kStarted) {
state_ = kStopping;
- message_filter_->Send(new VideoCaptureHostMsg_Stop(0, device_id_));
+ Send(new VideoCaptureHostMsg_Stop(0, device_id_));
width_ = height_ = 0;
}
}
@@ -369,7 +367,7 @@
params.height = height_;
params.session_id = session_id_;
- message_filter_->Send(new VideoCaptureHostMsg_Start(0, device_id_, params));
+ Send(new VideoCaptureHostMsg_Start(0, device_id_, params));
state_ = kStarted;
for (ClientInfo::iterator it = clients_.begin(); it != clients_.end(); it++) {
it->first->OnStarted(this);
@@ -384,3 +382,12 @@
base::ScopedTaskRunner task_runner(task);
message_filter_->RemoveDelegate(this);
}
+
+void VideoCaptureImpl::Send(IPC::Message* message) {
+ base::MessageLoopProxy* io_message_loop_proxy =
+ ChildProcess::current()->io_message_loop_proxy();
+
+ io_message_loop_proxy->PostTask(FROM_HERE,
+ NewRunnableMethod(message_filter_.get(),
+ &VideoCaptureMessageFilter::Send, message));
+}
« no previous file with comments | « content/renderer/media/video_capture_impl.h ('k') | content/renderer/media/video_capture_impl_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698