Commit 4c4e51e7 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Merge blink-specific media_devices typemap into the original (1/2)

This is the first step to unify media_devices.typemap and
media_devices_for_blink.typemap. Basically, the former will be
used as-is from Blink when the work done.

Note that, the approach could have been backwards, ie use
blink.mojom.MediaDeviceTypes throughout the code and remove
blink::MediaDeviceTypes, however that would result in a way
bigger CL (see [1] for reference), since today blink::MediaDeviceTypes
enum item are used mainly for indexing vectors, and
blink::mojom::MediaDeviceTypes class enum items can be implicitly
converted to int, for similar purposes.

[1] https://crrev.com/c/2106015

Since 'blink::mojom::MediaDeviceTypes type' parameter is actually
unused in blink::MediaDevices::OnDevicesChange(), it is possible to
consider removing the parameter and the blink.mojom.MediaDeviceTypes
definition altogether from media_devices.mojom.

BUG=704136
R=guidou@chromium.org

Change-Id: Id3d42c3bbde30a7dd02b92439b867764e4211073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105794Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#750922}
parent f7f9bcfb
......@@ -13,4 +13,7 @@ traits_headers = [
"//third_party/blink/public/common/mediastream/media_devices_mojom_traits.h",
]
type_mappings = [ "blink.mojom.FacingMode=::media::VideoFacingMode" ]
type_mappings = [
"blink.mojom.MediaDeviceType=::blink::MediaDeviceType",
"blink.mojom.FacingMode=::media::VideoFacingMode",
]
......@@ -200,7 +200,7 @@ void MediaDevices::ContextDestroyed() {
}
void MediaDevices::OnDevicesChanged(
mojom::blink::MediaDeviceType type,
blink::MediaDeviceType type,
Vector<mojom::blink::MediaDeviceInfoPtr> device_infos) {
Document* document = Document::From(GetExecutionContext());
DCHECK(document);
......
......@@ -68,7 +68,7 @@ class MODULES_EXPORT MediaDevices final
void ContextDestroyed() override;
// mojom::blink::MediaDevicesListener implementation.
void OnDevicesChanged(mojom::blink::MediaDeviceType,
void OnDevicesChanged(MediaDeviceType,
Vector<mojom::blink::MediaDeviceInfoPtr>) override;
// Callback for testing only.
......
......@@ -184,9 +184,8 @@ class MediaDevicesTest : public testing::Test {
void SimulateDeviceChange() {
DCHECK(listener());
listener()->OnDevicesChanged(
mojom::blink::MediaDeviceType::MEDIA_AUDIO_INPUT,
Vector<MediaDeviceInfoPtr>());
listener()->OnDevicesChanged(MEDIA_DEVICE_TYPE_AUDIO_INPUT,
Vector<MediaDeviceInfoPtr>());
}
void DevicesEnumerated(const MediaDeviceInfoVector& device_infos) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment