Commit aa5272de authored by toyoshim@chromium.org's avatar toyoshim@chromium.org

Web MIDI: implement right sysex handling for received messages.

I missed to apply ChildProcessSecurityPolicy to receive side. Blink
needs additional sysex filter per MIDIAccess object.

BUG=163795
TEST=none

Review URL: https://chromiumcodereview.appspot.com/23983004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221662 0039d316-1c4b-4281-b951-d872f2087c98
parent 4e494871
...@@ -136,13 +136,16 @@ void MIDIHost::ReceiveMIDIData( ...@@ -136,13 +136,16 @@ void MIDIHost::ReceiveMIDIData(
double timestamp) { double timestamp) {
TRACE_EVENT0("midi", "MIDIHost::ReceiveMIDIData"); TRACE_EVENT0("midi", "MIDIHost::ReceiveMIDIData");
// For now disallow all System Exclusive messages even if we // Check a process security policy to receive a system exclusive message.
// have permission. if (length > 0 && data[0] >= kSysExMessage) {
// TODO(toyoshim): allow System Exclusive if browser has granted if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanSendMIDISysExMessage(
// this client access. We'll likely need to pass a GURL renderer_process_id_)) {
// here to compare against our permissions. // MIDI devices may send a system exclusive messages even if the renderer
if (length > 0 && data[0] >= kSysExMessage) // doesn't have a permission to receive it. Don't kill the renderer as
// OnSendData() does.
return; return;
}
}
// Send to the renderer. // Send to the renderer.
std::vector<uint8> v(data, data + length); std::vector<uint8> v(data, data + length);
......
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