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

Unified Diff: content/renderer/video_capture_message_filter.cc

Issue 7071002: Revert "Add VideoCaptureImpl and VideoCaptureImplManager" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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/video_capture_message_filter.cc
diff --git a/content/renderer/video_capture_message_filter.cc b/content/renderer/video_capture_message_filter.cc
index f9db7e51a30b0904cef1538053d594d346afb203..c679e2b83e65442f91fdb6954e532b56c53b3e32 100644
--- a/content/renderer/video_capture_message_filter.cc
+++ b/content/renderer/video_capture_message_filter.cc
@@ -54,13 +54,6 @@ void VideoCaptureMessageFilter::OnFilterAdded(IPC::Channel* channel) {
// Captures the message loop proxy for IPC.
message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread();
channel_ = channel;
-
- for (Delegates::iterator it = pending_delegates_.begin();
- it != pending_delegates_.end(); it++) {
- it->second->OnDelegateAdded(it->first);
- delegates_[it->first] = it->second;
- }
- pending_delegates_.clear();
}
void VideoCaptureMessageFilter::OnFilterRemoved() {
@@ -121,18 +114,14 @@ void VideoCaptureMessageFilter::OnDeviceInfoReceived(
delegate->OnDeviceInfoReceived(params);
}
-void VideoCaptureMessageFilter::AddDelegate(Delegate* delegate) {
+int32 VideoCaptureMessageFilter::AddDelegate(Delegate* delegate) {
if (++last_device_id_ <= 0)
last_device_id_ = 1;
while (delegates_.find(last_device_id_) != delegates_.end())
last_device_id_++;
- if (channel_) {
- delegates_[last_device_id_] = delegate;
- delegate->OnDelegateAdded(last_device_id_);
- } else {
- pending_delegates_[last_device_id_] = delegate;
- }
+ delegates_[last_device_id_] = delegate;
+ return last_device_id_;
}
void VideoCaptureMessageFilter::RemoveDelegate(Delegate* delegate) {
@@ -143,13 +132,6 @@ void VideoCaptureMessageFilter::RemoveDelegate(Delegate* delegate) {
break;
}
}
- for (Delegates::iterator it = pending_delegates_.begin();
- it != pending_delegates_.end(); it++) {
- if (it->second == delegate) {
- pending_delegates_.erase(it);
- break;
- }
- }
}
void VideoCaptureMessageFilter::AddFilter() {
« no previous file with comments | « content/renderer/video_capture_message_filter.h ('k') | content/renderer/video_capture_message_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698