From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
IPC: aj...@chromium.org
📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).
IPC reviewer(s): aj...@chromium.org
Reviewer source(s):
aj...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
me=>cc since i dont' think i own anything that Dale doesn't.
thanks
-fl
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// Requests the media player to resume playback when authorized by the systemI think you just want to call this something like `UnlockBackgroundPlayback()`
video_locked_when_paused_when_hidden_ = false;This naming has always confused me. We should probably invert and rename this in a follow-up to something like `allow_background_video_playback_`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Requests the media player to resume playback when authorized by the systemI think you just want to call this something like `UnlockBackgroundPlayback()`
Indeed, that's a better name.
video_locked_when_paused_when_hidden_ = false;This naming has always confused me. We should probably invert and rename this in a follow-up to something like `allow_background_video_playback_`.
ACK
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi Daniel, could you please review the changes in the following files:
```
third_party/blink/public/platform/web_media_player.h
third_party/blink/renderer/modules/webaudio/audio_context.h
```
thank you
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
static_cast<media::mojom::blink::MediaPlayer*>(Media())->RequestPlay(I have mixed feelings about these `static_cast`s. I'm not sure how much sense it makes to make the overrides private since anyone can downcast.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
static_cast<media::mojom::blink::MediaPlayer*>(Media())->RequestPlay(I have mixed feelings about these `static_cast`s. I'm not sure how much sense it makes to make the overrides private since anyone can downcast.
Agree that making them private doesn't actually prevent them from being called publicly.
My concern with moving them to public members is that they could be accidentally misused by developers (e.g., showing up in auto-completion where someone might not pay close attention to the differences between Play() and RequestPlay()).
For tests specifically, to avoid the static_cast clutters, I moved it to a helper method.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
static_cast<media::mojom::blink::MediaPlayer*>(Media())->RequestPlay(Phil YanI have mixed feelings about these `static_cast`s. I'm not sure how much sense it makes to make the overrides private since anyone can downcast.
Agree that making them private doesn't actually prevent them from being called publicly.
My concern with moving them to public members is that they could be accidentally misused by developers (e.g., showing up in auto-completion where someone might not pay close attention to the differences between Play() and RequestPlay()).
For tests specifically, to avoid the static_cast clutters, I moved it to a helper method.
Fair enough. It might be worth considering composition rather than inheritance (in the style of LocalFrameMojoHandler) but it is a significant amount of extra plumbing, and is out of scope here anyway.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[Media] Prevent user activation bypass on system audio focus resume
When a system event (like audio focus regain after a notification)
triggered a media playback resume, the browser sent a RequestPlay
IPC to the renderer. HTMLMediaElement::RequestPlay() unconditionally
granted a Transient User Activation token to bypass background
playback restrictions in WebMediaPlayerImpl.
Because the system audio resume was indistinguishable from a user
interaction (like pressing a Bluetooth headset button), a malicious
background page could listen for audio focus events to harvest a
free User Activation token without user interaction.
This CL fixes the vulnerability by:
1. Adding a `triggered_by_user` flag to the `RequestPlay` Mojo IPC.
2. Only granting the Transient User Activation token in
`HTMLMediaElement::RequestPlay` if the request was truly
user-triggered.
3. Adding a new `UnlockBackgroundPlayback` method to the
`WebMediaPlayer` interface so that background media playback
can still resume smoothly without relying on a fake user
activation token.
TODO: although `HTMLMediaElement::RequestPause` already has a
`triggered_by_user`, it's hardcoded to true in
`MediaSessionController::OnSuspend`. We need to set it dynamically by
plumbing the value from `MediaSessionImpl::OnSuspendInternal`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |