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

Unified Diff: content/common/media/media_devices.mojom

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 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
« no previous file with comments | « content/common/input_messages.h ('k') | content/common/media/media_player_messages_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/media/media_devices.mojom
diff --git a/content/common/media/media_devices.mojom b/content/common/media/media_devices.mojom
index 97d11854a1a453fc3ac22bef39f9905f93606802..d53232e580266f2337d724cee50c8786666f33b9 100644
--- a/content/common/media/media_devices.mojom
+++ b/content/common/media/media_devices.mojom
@@ -13,8 +13,8 @@ enum MediaDeviceType;
struct MediaDeviceInfo;
// This object lives in the browser and is responsible for processing device
-// enumeration requests.
-// TODO(guidou): Add support for device-change notifications.
+// enumeration requests and managing subscriptions for device-change
+// notifications.
interface MediaDevicesDispatcherHost {
// The reply always contains NUM_MEDIA_DEVICE_TYPES elements.
// The result is indexed by device type as defined in
@@ -24,4 +24,32 @@ interface MediaDevicesDispatcherHost {
bool request_audio_output,
url.mojom.Origin security_origin)
=> (array<array<MediaDeviceInfo>> enumeration);
+
+ // Creates a subscription for device-change notifications for the calling
+ // frame/security origin. It is the responsibility of the caller to send
+ // |subscription_id| values that are unique per device type.
+ // Requests to create a subscription with an ID that already exists for type
+ // |type| are invalid and result in a renderer crash.
+ SubscribeDeviceChangeNotifications(MediaDeviceType type,
+ uint32 subscription_id,
+ url.mojom.Origin security_origin);
+
+ // Removes a subscription to device-change notifications for the calling
+ // frame. The caller is responsible for sending |subscription_id| values that
+ // that refer to existing subscriptions for type |type|. Requests to remove
+ // a nonexisting subscription with are invalid and result in a renderer crash.
+ UnsubscribeDeviceChangeNotifications(MediaDeviceType type,
+ uint32 subscription_id);
+};
+
+// This object lives in the renderer process and is used by the browser process
+// to pass device-change notifications to the renderer.
+interface MediaDevicesListener {
+ // Called to notify a change in the set of devices of type |type| for
+ // subscription |subscription_id|. |device_infos| contains the new list of
+ // devices of type |type|, with device and group IDs obfuscated according to
+ // the subscription's security origin.
+ OnDevicesChanged(MediaDeviceType type,
+ uint32 subscription_id,
+ array<MediaDeviceInfo> device_infos);
};
« no previous file with comments | « content/common/input_messages.h ('k') | content/common/media/media_player_messages_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698