Second CL in the devicechange migration series.
PTAL. Thank you.
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 3:Commit-Queue +1
1 comment:
File content/browser/renderer_host/media/media_devices_dispatcher_host.cc:
After recent changes in https://crrev.com/c/790119/844303/, MDM handles |listener| subscriptions directly and no longer notifies MDDH of device changes. So, how do we handle this permission check for the device type now?
Can we perform this check at the time of subscription itself in MDDH::AddMediaDevicesListener?
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
After recent changes in https://crrev. […]
The permission check is necessary and must be performed on each notification because permissions can change over time. Will comment further on the other CL.
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
This CL is now ready for review. PTAL. Thank you.
Patch set 5:Commit-Queue +1
guidou@: The other two CLs in the device change migration series are ready to be merged after the branch cut.
In the meantime, can you please review this CL?
Very nice work. Just a few minor comments.
9 comments:
Patch Set #6, Line 14: https
I think you meant two separate links.
crrev.com/c/790119
crrev.com/c/844303
File content/browser/renderer_host/media/media_devices_dispatcher_host.cc:
nit: Since subscription_id is a uint32_t, you can use "auto" instead of "auto&"
File content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc:
You can remove the loop and have a single listener.
The old test had one subscriber per type because each subscription had to be for a single type.
Alternatively, instead of having all subscribers listen to all event types, you can have the same behavior as the old test by replacing "true, true, true" with "i == MEDIA_DEVICE_TYPE_AUDIO_INPUT, ... "
File content/browser/renderer_host/media/media_devices_manager.h:
Patch Set #6, Line 249: current_subscription_id_
nit: I think we should rename this variable to |last_subscription_id|, since current kind of suggests that there is a special subscription that is the "current" one.
File content/browser/renderer_host/media/media_devices_manager_unittest.cc:
Patch Set #6, Line 519: MockMediaDevicesListener device_change_listener;
To maintain the functionality of the test, you should keep the single-type subscribers.
File content/renderer/pepper/pepper_media_device_manager.cc:
Patch Set #6, Line 142: uint32_t
This cast can be problematic since BindingId is size_t is 64 bits in many platforms. I think it's safer to change everything to size_t (or even mojo::BindingId), including in PepperDeviceEnumerationHostHelper, which is the only place where these IDs are used.
If you change to size_t, maybe you will need to replace this with 0U.
Patch Set #6, Line 151: uint32_t
no need to cast to uint32_t if it's already uint32_t.
Anyway, as stated above, I suggest that you switch to size_t or mojo::BindingId.
Patch Set #6, Line 154: find_if
consider using base::Erase, which would result in simpler code.
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
Chandan Padhi uploaded patch set #7 to this change.
Make Pepper subscribe and handle device change event on its own
Currently, device change subscription and event handling are done in
MediaDevicesEventDispatcher. After [1] and [2], Pepper can itself inherit
mojom::MediaDevicesListener to listen to device change notifications and
directly call AddMediaDevicesListener() for subscription.
[1] https://crrev.com/c/790119/790119/
[2] https://crrev.com/c/790119/844303/
Bug: 793297
Change-Id: I68336592cc71d6cbefbb3be1b9005586d3aaa450
---
M content/browser/renderer_host/media/media_devices_dispatcher_host.cc
M content/browser/renderer_host/media/media_devices_dispatcher_host.h
M content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
M content/browser/renderer_host/media/media_devices_manager.cc
M content/browser/renderer_host/media/media_devices_manager.h
M content/browser/renderer_host/media/media_devices_manager_unittest.cc
M content/renderer/BUILD.gn
D content/renderer/media/media_devices_event_dispatcher.cc
D content/renderer/media/media_devices_event_dispatcher.h
D content/renderer/media/media_devices_event_dispatcher_unittest.cc
D content/renderer/media/media_devices_listener_impl.cc
D content/renderer/media/media_devices_listener_impl.h
M content/renderer/media/user_media_client_impl_unittest.cc
M content/renderer/pepper/pepper_media_device_manager.cc
M content/renderer/pepper/pepper_media_device_manager.h
M content/renderer/render_frame_impl.cc
M content/test/BUILD.gn
M third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp
M third_party/WebKit/Source/modules/mediastream/MediaDevices.h
M third_party/WebKit/Source/modules/mediastream/MediaDevicesTest.cpp
M third_party/WebKit/public/platform/modules/mediastream/media_devices.mojom
21 files changed, 224 insertions(+), 894 deletions(-)
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
PTAL. Thanks!
9 comments:
Patch Set #6, Line 14: https
I think you meant two separate links. […]
Done
File content/browser/renderer_host/media/media_devices_dispatcher_host.cc:
nit: Since subscription_id is a uint32_t, you can use "auto" instead of "auto&"
You can remove the loop and have a single listener. […]
Done
File content/browser/renderer_host/media/media_devices_manager.h:
Patch Set #6, Line 249: last_subscription_id_ =
nit: I think we should rename this variable to |last_subscription_id|, since current kind of suggest […]
Done
File content/browser/renderer_host/media/media_devices_manager_unittest.cc:
Patch Set #6, Line 519: // Subscribe to device-change events.
To maintain the functionality of the test, you should keep the single-type subscribers.
Done
File content/renderer/pepper/pepper_media_device_manager.cc:
Patch Set #6, Line 142: back(Sub
This cast can be problematic since BindingId is size_t is 64 bits in many platforms. […]
Done
If you change to size_t, maybe you will need to replace this with 0U.
Done
no need to cast to uint32_t if it's already uint32_t. […]
Done
Patch Set #6, Line 154: ge_subs
consider using base::Erase, which would result in simpler code.
Done
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
File content/browser/renderer_host/media/media_devices_manager_unittest.cc:
The original test has four subscribers. 1 subscribed to all devices, and 3 that subscribe each to one different device type.
The new version of the test only has the latter 3 and simulates the events 3 times. Please rewrite to match the original test with 4 subscribers.
Also, no need to simulate the device changes inside a loop. You just need four MockMediaDevicesListener variables like the original test, and a single round of device-change simulations as in the original test.
The reason to have the test that way is that it is similar to having one subscriber like MediaDevices (subscribes to everything) and 3 subscribers for each event type (like Pepper).
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
PTAL
Patch set 9:Commit-Queue +1
1 comment:
The original test has four subscribers. […]
Sorry, I think I misunderstood your comment here in the previous patchset.
Modified the test accordingly. Thanks.
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
Thanks a lot. Great work!
Patch set 9:Code-Review +1
Chandan Padhi would like Tom Sepez and Kentaro Hara to review this change.
Make Pepper subscribe and handle device change event on its own
Currently, device change subscription and event handling are done in
MediaDevicesEventDispatcher. After [1] and [2], Pepper can itself inherit
mojom::MediaDevicesListener to listen to device change notifications and
directly call AddMediaDevicesListener() for subscription.
[1] https://crrev.com/c/790119/790119/
[2] https://crrev.com/c/790119/844303/
Bug: 793297
Change-Id: I68336592cc71d6cbefbb3be1b9005586d3aaa450
---
M content/browser/renderer_host/media/media_devices_dispatcher_host.cc
M content/browser/renderer_host/media/media_devices_dispatcher_host.h
M content/browser/renderer_host/media/media_devices_dispatcher_host_unittest.cc
M content/browser/renderer_host/media/media_devices_manager.cc
M content/browser/renderer_host/media/media_devices_manager.h
M content/browser/renderer_host/media/media_devices_manager_unittest.cc
M content/renderer/BUILD.gn
D content/renderer/media/media_devices_event_dispatcher.cc
D content/renderer/media/media_devices_event_dispatcher.h
D content/renderer/media/media_devices_event_dispatcher_unittest.cc
D content/renderer/media/media_devices_listener_impl.cc
D content/renderer/media/media_devices_listener_impl.h
M content/renderer/media/user_media_client_impl_unittest.cc
M content/renderer/pepper/pepper_device_enumeration_host_helper.cc
M content/renderer/pepper/pepper_device_enumeration_host_helper.h
M content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc
M content/renderer/pepper/pepper_media_device_manager.cc
M content/renderer/pepper/pepper_media_device_manager.h
M content/renderer/render_frame_impl.cc
M content/test/BUILD.gn
M third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp
M third_party/WebKit/Source/modules/mediastream/MediaDevices.h
M third_party/WebKit/Source/modules/mediastream/MediaDevicesTest.cpp
M third_party/WebKit/public/platform/modules/mediastream/media_devices.mojom
24 files changed, 277 insertions(+), 896 deletions(-)
Patch Set 9: Code-Review+1
Thanks a lot. Great work!
Thank you :)
haraken@ Please
Patch Set 9:
Patch Set 9: Code-Review+1
Thanks a lot. Great work!
Thank you :)
bbudge@ PTAL at //content/renderer/pepper
haraken@ //WebKit
tsepez@ media_devices.mojom
Please RS.
WebKit LGTM
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
content/renderer/pepper LGTM
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
OWNER stamp for deleting mojom.
To view, visit change 844534. To unsubscribe, or for help writing mail filters, visit settings.
Patch set 10:Commit-Queue +2
CQ is trying the patch.
Note: The patchset sent to CQ was uploaded after this CL was approved.
"Rebase" https://chromium-review.googlesource.com/c/844534/10
Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/chromium-review.googlesource.com/844534/10
Bot data: {"action": "start", "triggered_at": "2018-01-20T04:09:25.0Z", "cq_cfg_revision": "a668b5363cd374a29ca0f46124c226e2e2aa21d9", "revision": "689268871e3e067055cd5c94212e949dee7bfaa0"}
Commit Bot merged this change.
Make Pepper subscribe and handle device change event on its own
Currently, device change subscription and event handling are done in
MediaDevicesEventDispatcher. After [1] and [2], Pepper can itself inherit
mojom::MediaDevicesListener to listen to device change notifications and
directly call AddMediaDevicesListener() for subscription.
[1] https://crrev.com/c/790119/790119/
[2] https://crrev.com/c/790119/844303/
Bug: 793297
Change-Id: I68336592cc71d6cbefbb3be1b9005586d3aaa450
Reviewed-on: https://chromium-review.googlesource.com/844534
Commit-Queue: Chandan Padhi <c.p...@samsung.com>
Reviewed-by: Guido Urdaneta <gui...@chromium.org>
Reviewed-by: Kentaro Hara <har...@chromium.org>
Reviewed-by: Bill Budge <bbu...@chromium.org>
Reviewed-by: Tom Sepez <tse...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530755}