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

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

Issue 2483413002: Revert of Use mojo support for Blink devicechange event. (Closed)
Patch Set: Created 4 years, 1 month 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/user_media_client_impl.cc
diff --git a/content/renderer/media/user_media_client_impl.cc b/content/renderer/media/user_media_client_impl.cc
index c3fdcac03d9a95739e8dc2772a858074b57b66f2..29a9819980bc895ab2c2134a6ef8bf686e400dab 100644
--- a/content/renderer/media/user_media_client_impl.cc
+++ b/content/renderer/media/user_media_client_impl.cc
@@ -287,26 +287,13 @@
const blink::WebMediaDeviceChangeObserver& observer) {
media_device_change_observer_ = observer;
- // Do nothing if setting a valid observer while already subscribed or setting
- // no observer while unsubscribed.
- if (media_device_change_observer_.isNull() ==
- device_change_subscription_ids_.empty())
- return;
-
- base::WeakPtr<MediaDevicesEventDispatcher> event_dispatcher =
- MediaDevicesEventDispatcher::GetForRenderFrame(render_frame());
if (media_device_change_observer_.isNull()) {
- event_dispatcher->UnsubscribeDeviceChangeNotifications(
- device_change_subscription_ids_);
- device_change_subscription_ids_.clear();
+ media_stream_dispatcher_->CancelDeviceChangeNotifications(
+ weak_factory_.GetWeakPtr());
} else {
- DCHECK(device_change_subscription_ids_.empty());
- url::Origin security_origin =
- media_device_change_observer_.getSecurityOrigin();
- device_change_subscription_ids_ =
- event_dispatcher->SubscribeDeviceChangeNotifications(
- security_origin, base::Bind(&UserMediaClientImpl::DevicesChanged,
- weak_factory_.GetWeakPtr()));
+ url::Origin origin = observer.getSecurityOrigin();
+ media_stream_dispatcher_->SubscribeToDeviceChangeNotifications(
+ weak_factory_.GetWeakPtr(), origin);
}
}
@@ -612,8 +599,6 @@
DeleteUserMediaRequestInfo(request);
}
-// TODO(guidou): Remove once this method is removed from the
-// MediaStreamDispatcherEventHandler interface. http://648183.
void UserMediaClientImpl::OnDevicesEnumerated(
int request_id,
const StreamDeviceInfoArray& device_array) {
@@ -635,15 +620,8 @@
NOTIMPLEMENTED();
}
-// TODO(guidou): Remove once this method is removed from the
-// MediaStreamDispatcherEventHandler interface. http://648183.
void UserMediaClientImpl::OnDevicesChanged() {
- NOTREACHED();
-}
-
-void UserMediaClientImpl::DevicesChanged(
- MediaDeviceType type,
- const MediaDeviceInfoArray& device_infos) {
+ DVLOG(1) << "UserMediaClientImpl::OnDevicesChanged()";
if (!media_device_change_observer_.isNull())
media_device_change_observer_.didChangeMediaDevices();
}
« no previous file with comments | « content/renderer/media/user_media_client_impl.h ('k') | content/renderer/media/user_media_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698