toyoshim@ Could you take a look at the general direction of this patch?
(I am not super familiar with this code base, so this work is assisted by AI)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[WebMIDI] Sync ChildProcessSecurityPolicy with DevTools overrides
DevTools permission overrides only update PermissionController but
fail to update ChildProcessSecurityPolicy for the renderer process.
This creates a capability mismatch when Headless/Automation tests
grant MIDI permissions via CDP, but subsequent SysEx actions are
rejected by MidiHost checks on the IO thread.
This patch resolves the issue by:
- Introducing a `BindMidiSessionProvider` helper on the UI thread.
- Intercepting MidiSessionProvider Mojo bindings to check the frame's
overridden permission status via PermissionController.
- Dynamically calling GrantSendMidiMessage and/or
GrantSendMidiSysExMessage on ChildProcessSecurityPolicyImpl to
authorize the process.
- Post-forwarding the Mojo binding to MidiHost on the IO thread.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
PTAL
Re-uploading the patch to address the Android Automotive CI failure on the previous CL (https://crrev.com/c/7879619).
Since system MIDI is not available on Android test emulators, I've updated the browser test to use GTEST_SKIP() on devices/emulators without MIDI support, matching standard WebMIDI test behavior.
#if BUILDFLAG(IS_ANDROID)
if (!midi::HasSystemFeatureMidiForTesting()) {
GTEST_SKIP() << "MIDI service is not available on this device.";
}
#endif // BUILDFLAG(IS_ANDROID)This is what we missed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
#include "content/browser/child_process_security_policy_impl.h"include order is slightly broken here, maybe after the line 33.
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/permissions/permission_controller_impl.h"
#include "third_party/blink/public/common/permissions/permission_utils.h"
#include "url/origin.h"include order seems broken. `cl format`?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |