midi: Refactor Mac MIDI manager to use platform-neutral UMP utility [chromium/src : main]

0 views
Skip to first unread message

Takashi Toyoshima (Gerrit)

unread,
Jun 28, 2026, 11:58:40 PMJun 28
to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
Attention needed from Michael Wilson

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Wilson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
Gerrit-Change-Number: 8016282
Gerrit-PatchSet: 6
Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Attention: Michael Wilson <mjwi...@chromium.org>
Gerrit-Comment-Date: Mon, 29 Jun 2026 03:58:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hongchan Choi (Gerrit)

unread,
Jun 30, 2026, 6:26:22 PMJun 30
to Takashi Toyoshima, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
Attention needed from Takashi Toyoshima

Hongchan Choi added 4 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Hongchan Choi . unresolved

I am not super familiar with these changes, but I also understand we don't have other experts who can review this.

It'll be slow, but we (the WebAudio) will try to complete the review. Thanks for your patience!

File media/midi/midi_manager_mac.cc
Line 365, Patchset 6 (Latest): size_t chunk_size = std::min(words_to_send, static_cast<size_t>(256));
Hongchan Choi . unresolved

I am not familiar with the UMP packets in general. Why 256 is used here?

File media/midi/ump_message_util.h
Line 78, Patchset 6 (Latest):// Returns the number of bytes from `data` successfully translated.
Hongchan Choi . unresolved

This method seems to return the size of `data`. (not "successfully translated bytes")

File media/midi/ump_message_util.cc
Line 112, Patchset 6 (Latest): while (idx < data.size() && data[idx] != 0xF7 && data[idx] < 0x80) {
idx++;
}
Hongchan Choi . unresolved

From Gemini:

Legacy MIDI 1.0 permits 1-byte System Real-Time messages (status bytes 0xF8 to 0xFF) to be interleaved at any point in the stream, including inside a SysEx message.

However, the SysEx parsing loop here terminates immediately upon encountering an interleaved status byte (since data[idx] >= 0x80). This causes the SysEx message to be truncated (treated as complete or end prematurely). Furthermore, the remaining data bytes of the SysEx in the subsequent loop iterations are skipped because they are < 0x80 but do not start with a status byte.

---
Does this look reasonable?

Open in Gerrit

Related details

Attention is currently required from:
  • Takashi Toyoshima
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
    Gerrit-Change-Number: 8016282
    Gerrit-PatchSet: 6
    Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Comment-Date: Tue, 30 Jun 2026 22:26:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Toyoshima (Gerrit)

    unread,
    Jul 14, 2026, 2:56:34 AM (7 days ago) Jul 14
    to Hongchan Choi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
    Attention needed from Hongchan Choi

    Takashi Toyoshima added 4 comments

    Patchset-level comments
    Hongchan Choi . unresolved

    I am not super familiar with these changes, but I also understand we don't have other experts who can review this.

    It'll be slow, but we (the WebAudio) will try to complete the review. Thanks for your patience!

    Takashi Toyoshima

    Thank you!
    I'm also sorry about slow updates. I originally thought this was a simple API migration to drop unexpected dependencies to the legacy API, but the reality is that this is the exact macOS level MIDI 2.0 support, and migration requires much more complicated changes than I assumed.

    File media/midi/midi_manager_mac.cc
    Line 365, Patchset 6: size_t chunk_size = std::min(words_to_send, static_cast<size_t>(256));
    Hongchan Choi . unresolved

    I am not familiar with the UMP packets in general. Why 256 is used here?

    Takashi Toyoshima

    Oh, you are right. This is an unnecessary internal limit.
    Now the logic was rewritten, and the legacy code was also kept just in case behind a kill-switch.
    This is because I noticed that the interleaved realtime messages were pre-existing bug, and I`m not sure if any existing service relies on it.

    File media/midi/ump_message_util.h
    Line 78, Patchset 6:// Returns the number of bytes from `data` successfully translated.
    Hongchan Choi . unresolved

    This method seems to return the size of `data`. (not "successfully translated bytes")

    Takashi Toyoshima

    Let me drop the returning value as we didn't need it, or even it might be misleading.

    File media/midi/ump_message_util.cc
    Line 112, Patchset 6: while (idx < data.size() && data[idx] != 0xF7 && data[idx] < 0x80) {
    idx++;
    }
    Hongchan Choi . unresolved

    From Gemini:

    Legacy MIDI 1.0 permits 1-byte System Real-Time messages (status bytes 0xF8 to 0xFF) to be interleaved at any point in the stream, including inside a SysEx message.

    However, the SysEx parsing loop here terminates immediately upon encountering an interleaved status byte (since data[idx] >= 0x80). This causes the SysEx message to be truncated (treated as complete or end prematurely). Furthermore, the remaining data bytes of the SysEx in the subsequent loop iterations are skipped because they are < 0x80 but do not start with a status byte.

    ---
    Does this look reasonable?

    Takashi Toyoshima

    This is called only for a message that is delivered from Web MIDI to OS.

    Web MIDI defines that the output.send accepts only one or multiple *complete* messages, and explicitly disallows running status, and if we read the spec straight and forward, it's reasonable to interpret that we disallow such interleaved realtime messages.

    Actually, IIRC, they are a kind of legacy transport layer's spec, and USB and Bluetooth don't allow them, and on some platforms, even for the legacy transport, OS reorder them so that we do not have to handle such complicated sequences in the application layer.

    On the other hand, it seems our Blink side validator overlooked this exceptional case unfortunately. So, can we keep this logic as-is with a fallback switch to the legacy API for a few milestones?

    I will also send another patch for the Blink side, to validate it correctly, but behind yet another feature flag.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hongchan Choi
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
    Gerrit-Change-Number: 8016282
    Gerrit-PatchSet: 8
    Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
    Gerrit-Attention: Hongchan Choi <hong...@chromium.org>
    Gerrit-Comment-Date: Tue, 14 Jul 2026 06:56:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hongchan Choi <hong...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hongchan Choi (Gerrit)

    unread,
    Jul 14, 2026, 12:07:23 PM (7 days ago) Jul 14
    to Takashi Toyoshima, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
    Attention needed from Takashi Toyoshima

    Hongchan Choi added 5 comments

    Patchset-level comments
    File-level comment, Patchset 6:
    Hongchan Choi . resolved

    I am not super familiar with these changes, but I also understand we don't have other experts who can review this.

    It'll be slow, but we (the WebAudio) will try to complete the review. Thanks for your patience!

    Takashi Toyoshima

    Thank you!
    I'm also sorry about slow updates. I originally thought this was a simple API migration to drop unexpected dependencies to the legacy API, but the reality is that this is the exact macOS level MIDI 2.0 support, and migration requires much more complicated changes than I assumed.

    Hongchan Choi

    Acknowledged

    File-level comment, Patchset 11 (Latest):
    Hongchan Choi . resolved

    I assume you'll be addressing some comments from the previous PS; turning off my attention bit.

    File media/midi/midi_manager_mac.cc
    Line 365, Patchset 6: size_t chunk_size = std::min(words_to_send, static_cast<size_t>(256));
    Hongchan Choi . resolved

    I am not familiar with the UMP packets in general. Why 256 is used here?

    Takashi Toyoshima

    Oh, you are right. This is an unnecessary internal limit.
    Now the logic was rewritten, and the legacy code was also kept just in case behind a kill-switch.
    This is because I noticed that the interleaved realtime messages were pre-existing bug, and I`m not sure if any existing service relies on it.

    Hongchan Choi

    Acknowledged

    File media/midi/ump_message_util.h
    Line 78, Patchset 6:// Returns the number of bytes from `data` successfully translated.
    Hongchan Choi . resolved

    This method seems to return the size of `data`. (not "successfully translated bytes")

    Takashi Toyoshima

    Let me drop the returning value as we didn't need it, or even it might be misleading.

    Hongchan Choi

    Acknowledged

    File media/midi/ump_message_util.cc
    Line 112, Patchset 6: while (idx < data.size() && data[idx] != 0xF7 && data[idx] < 0x80) {
    idx++;
    }
    Hongchan Choi . resolved

    From Gemini:

    Legacy MIDI 1.0 permits 1-byte System Real-Time messages (status bytes 0xF8 to 0xFF) to be interleaved at any point in the stream, including inside a SysEx message.

    However, the SysEx parsing loop here terminates immediately upon encountering an interleaved status byte (since data[idx] >= 0x80). This causes the SysEx message to be truncated (treated as complete or end prematurely). Furthermore, the remaining data bytes of the SysEx in the subsequent loop iterations are skipped because they are < 0x80 but do not start with a status byte.

    ---
    Does this look reasonable?

    Takashi Toyoshima

    This is called only for a message that is delivered from Web MIDI to OS.

    Web MIDI defines that the output.send accepts only one or multiple *complete* messages, and explicitly disallows running status, and if we read the spec straight and forward, it's reasonable to interpret that we disallow such interleaved realtime messages.

    Actually, IIRC, they are a kind of legacy transport layer's spec, and USB and Bluetooth don't allow them, and on some platforms, even for the legacy transport, OS reorder them so that we do not have to handle such complicated sequences in the application layer.

    On the other hand, it seems our Blink side validator overlooked this exceptional case unfortunately. So, can we keep this logic as-is with a fallback switch to the legacy API for a few milestones?

    I will also send another patch for the Blink side, to validate it correctly, but behind yet another feature flag.

    Hongchan Choi

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Takashi Toyoshima
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
      Gerrit-Change-Number: 8016282
      Gerrit-PatchSet: 11
      Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
      Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
      Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
      Gerrit-Comment-Date: Tue, 14 Jul 2026 16:07:04 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
      Comment-In-Reply-To: Hongchan Choi <hong...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Takashi Toyoshima (Gerrit)

      unread,
      Jul 14, 2026, 9:34:07 PM (6 days ago) Jul 14
      to Hongchan Choi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
      Attention needed from Hongchan Choi

      Takashi Toyoshima added 1 comment

      Patchset-level comments
      Hongchan Choi . unresolved

      I assume you'll be addressing some comments from the previous PS; turning off my attention bit.

      Takashi Toyoshima

      Ah, my changes from ps8 were for fixing build issue that was caused by the last change, midi_switches.h's renaming to midi_features.h.
      So, the current patchset is ready for the final review on my side.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hongchan Choi
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
        Gerrit-Change-Number: 8016282
        Gerrit-PatchSet: 11
        Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
        Gerrit-Attention: Hongchan Choi <hong...@chromium.org>
        Gerrit-Comment-Date: Wed, 15 Jul 2026 01:33:44 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Hongchan Choi <hong...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Takashi Toyoshima (Gerrit)

        unread,
        Jul 15, 2026, 5:40:42 AM (6 days ago) Jul 15
        to Hongchan Choi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
        Attention needed from Takashi Toyoshima

        Takashi Toyoshima added 2 comments

        Patchset-level comments
        Takashi Toyoshima . unresolved

        I will make one more change for the following reason.
        I will set attention bit again once the CL gets ready again.

        File media/midi/ump_message_util.cc
        Line 112, Patchset 6: while (idx < data.size() && data[idx] != 0xF7 && data[idx] < 0x80) {
        idx++;
        }
        Hongchan Choi . unresolved

        From Gemini:

        Legacy MIDI 1.0 permits 1-byte System Real-Time messages (status bytes 0xF8 to 0xFF) to be interleaved at any point in the stream, including inside a SysEx message.

        However, the SysEx parsing loop here terminates immediately upon encountering an interleaved status byte (since data[idx] >= 0x80). This causes the SysEx message to be truncated (treated as complete or end prematurely). Furthermore, the remaining data bytes of the SysEx in the subsequent loop iterations are skipped because they are < 0x80 but do not start with a status byte.

        ---
        Does this look reasonable?

        Takashi Toyoshima

        This is called only for a message that is delivered from Web MIDI to OS.

        Web MIDI defines that the output.send accepts only one or multiple *complete* messages, and explicitly disallows running status, and if we read the spec straight and forward, it's reasonable to interpret that we disallow such interleaved realtime messages.

        Actually, IIRC, they are a kind of legacy transport layer's spec, and USB and Bluetooth don't allow them, and on some platforms, even for the legacy transport, OS reorder them so that we do not have to handle such complicated sequences in the application layer.

        On the other hand, it seems our Blink side validator overlooked this exceptional case unfortunately. So, can we keep this logic as-is with a fallback switch to the legacy API for a few milestones?

        I will also send another patch for the Blink side, to validate it correctly, but behind yet another feature flag.

        Hongchan Choi

        Acknowledged

        Takashi Toyoshima

        Well... it seems Firefox also accepts the realtime message interruption within the sysex and also in usual channel messages. So, I will change this backend to handle it correctly here.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Takashi Toyoshima
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
        Gerrit-Change-Number: 8016282
        Gerrit-PatchSet: 11
        Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
        Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Comment-Date: Wed, 15 Jul 2026 09:40:11 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Takashi Toyoshima (Gerrit)

        unread,
        Jul 17, 2026, 3:35:27 AM (4 days ago) Jul 17
        to Hongchan Choi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
        Attention needed from Hongchan Choi

        Takashi Toyoshima voted and added 1 comment

        Votes added by Takashi Toyoshima

        Commit-Queue+1

        1 comment

        File media/midi/ump_message_util.cc
        Line 112, Patchset 6: while (idx < data.size() && data[idx] != 0xF7 && data[idx] < 0x80) {
        idx++;
        }
        Hongchan Choi . unresolved

        From Gemini:

        Legacy MIDI 1.0 permits 1-byte System Real-Time messages (status bytes 0xF8 to 0xFF) to be interleaved at any point in the stream, including inside a SysEx message.

        However, the SysEx parsing loop here terminates immediately upon encountering an interleaved status byte (since data[idx] >= 0x80). This causes the SysEx message to be truncated (treated as complete or end prematurely). Furthermore, the remaining data bytes of the SysEx in the subsequent loop iterations are skipped because they are < 0x80 but do not start with a status byte.

        ---
        Does this look reasonable?

        Takashi Toyoshima

        This is called only for a message that is delivered from Web MIDI to OS.

        Web MIDI defines that the output.send accepts only one or multiple *complete* messages, and explicitly disallows running status, and if we read the spec straight and forward, it's reasonable to interpret that we disallow such interleaved realtime messages.

        Actually, IIRC, they are a kind of legacy transport layer's spec, and USB and Bluetooth don't allow them, and on some platforms, even for the legacy transport, OS reorder them so that we do not have to handle such complicated sequences in the application layer.

        On the other hand, it seems our Blink side validator overlooked this exceptional case unfortunately. So, can we keep this logic as-is with a fallback switch to the legacy API for a few milestones?

        I will also send another patch for the Blink side, to validate it correctly, but behind yet another feature flag.

        Hongchan Choi

        Acknowledged

        Takashi Toyoshima

        Well... it seems Firefox also accepts the realtime message interruption within the sysex and also in usual channel messages. So, I will change this backend to handle it correctly here.

        Takashi Toyoshima

        Firefox and Blink accepts interleaved realtime messages, and backends parse it again to reconstruct non-interleaved complete messages. This was done in message_util and midi_message_queue in Chrome. Unfortunately, macOS port didn't use it as it has own scheduler inside CoreMIDI. So, only macOS port had a potential issue that will drop interleaved messages as CoreMIDI didn't permit it.
        Now, the ump_message_util supports it. So, once this is enabled, interleaved messages will work correctly among all the platforms.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Hongchan Choi
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
        Gerrit-Change-Number: 8016282
        Gerrit-PatchSet: 12
        Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
        Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
        Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
        Gerrit-Attention: Hongchan Choi <hong...@chromium.org>
        Gerrit-Comment-Date: Fri, 17 Jul 2026 07:34:58 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Hongchan Choi (Gerrit)

        unread,
        Jul 20, 2026, 1:42:18 PM (19 hours ago) Jul 20
        to Takashi Toyoshima, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
        Attention needed from Takashi Toyoshima

        Hongchan Choi voted and added 2 comments

        Votes added by Hongchan Choi

        Code-Review+1
        Commit-Queue+1

        2 comments

        Patchset-level comments
        File-level comment, Patchset 12 (Latest):
        Hongchan Choi . resolved

        LGTM

        File media/midi/ump_message_util.cc
        Line 112, Patchset 6: while (idx < data.size() && data[idx] != 0xF7 && data[idx] < 0x80) {
        idx++;
        }
        Hongchan Choi . resolved

        From Gemini:

        Legacy MIDI 1.0 permits 1-byte System Real-Time messages (status bytes 0xF8 to 0xFF) to be interleaved at any point in the stream, including inside a SysEx message.

        However, the SysEx parsing loop here terminates immediately upon encountering an interleaved status byte (since data[idx] >= 0x80). This causes the SysEx message to be truncated (treated as complete or end prematurely). Furthermore, the remaining data bytes of the SysEx in the subsequent loop iterations are skipped because they are < 0x80 but do not start with a status byte.

        ---
        Does this look reasonable?

        Takashi Toyoshima

        This is called only for a message that is delivered from Web MIDI to OS.

        Web MIDI defines that the output.send accepts only one or multiple *complete* messages, and explicitly disallows running status, and if we read the spec straight and forward, it's reasonable to interpret that we disallow such interleaved realtime messages.

        Actually, IIRC, they are a kind of legacy transport layer's spec, and USB and Bluetooth don't allow them, and on some platforms, even for the legacy transport, OS reorder them so that we do not have to handle such complicated sequences in the application layer.

        On the other hand, it seems our Blink side validator overlooked this exceptional case unfortunately. So, can we keep this logic as-is with a fallback switch to the legacy API for a few milestones?

        I will also send another patch for the Blink side, to validate it correctly, but behind yet another feature flag.

        Hongchan Choi

        Acknowledged

        Takashi Toyoshima

        Well... it seems Firefox also accepts the realtime message interruption within the sysex and also in usual channel messages. So, I will change this backend to handle it correctly here.

        Takashi Toyoshima

        Firefox and Blink accepts interleaved realtime messages, and backends parse it again to reconstruct non-interleaved complete messages. This was done in message_util and midi_message_queue in Chrome. Unfortunately, macOS port didn't use it as it has own scheduler inside CoreMIDI. So, only macOS port had a potential issue that will drop interleaved messages as CoreMIDI didn't permit it.
        Now, the ump_message_util supports it. So, once this is enabled, interleaved messages will work correctly among all the platforms.

        Hongchan Choi

        Thanks. Acknolwedged.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Takashi Toyoshima
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
          Gerrit-Change-Number: 8016282
          Gerrit-PatchSet: 12
          Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
          Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
          Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
          Gerrit-Comment-Date: Mon, 20 Jul 2026 17:42:01 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Hongchan Choi (Gerrit)

          unread,
          Jul 20, 2026, 1:46:30 PM (19 hours ago) Jul 20
          to Takashi Toyoshima, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
          Attention needed from Takashi Toyoshima

          Hongchan Choi voted and added 3 comments

          Votes added by Hongchan Choi

          Code-Review+0

          3 comments

          Patchset-level comments
          File-level comment, Patchset 11:
          Hongchan Choi . resolved

          I assume you'll be addressing some comments from the previous PS; turning off my attention bit.

          Takashi Toyoshima

          Ah, my changes from ps8 were for fixing build issue that was caused by the last change, midi_switches.h's renaming to midi_features.h.
          So, the current patchset is ready for the final review on my side.

          Hongchan Choi

          Acknowledged

          File-level comment, Patchset 11:
          Takashi Toyoshima . resolved

          I will make one more change for the following reason.
          I will set attention bit again once the CL gets ready again.

          Hongchan Choi

          Acknowledged

          Hongchan Choi . resolved

          To resolve outstanding comment threads.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Takashi Toyoshima
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
            Gerrit-Change-Number: 8016282
            Gerrit-PatchSet: 12
            Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
            Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
            Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
            Gerrit-Comment-Date: Mon, 20 Jul 2026 17:46:20 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Giovanni Ortuno Urquidi (Gerrit)

            unread,
            Jul 20, 2026, 2:55:27 PM (18 hours ago) Jul 20
            to Takashi Toyoshima, Giovanni Ortuno Urquidi, Hongchan Choi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
            Attention needed from Takashi Toyoshima

            Giovanni Ortuno Urquidi added 1 comment

            File media/midi/ump_message_util_encoder_fuzzer.cc
            Line 13, Patchset 12 (Latest):DEFINE_LLVM_FUZZER_TEST_ONE_INPUT_SPAN(const base::span<const uint8_t> data) {
            Giovanni Ortuno Urquidi . unresolved

            LLVM-style fuzzers are deprecated and will need migrating. Please write a FUZZ_TEST instead. You can add it to ump_message_util_unittest.cc directly: https://chromium.googlesource.com/chromium/src/+/HEAD/testing/libfuzzer/README.md#libFuzzer-deprecated

            Same for the other fuzzer.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Takashi Toyoshima
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
              Gerrit-Change-Number: 8016282
              Gerrit-PatchSet: 12
              Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
              Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
              Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
              Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
              Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
              Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
              Gerrit-Comment-Date: Mon, 20 Jul 2026 18:55:17 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Takashi Toyoshima (Gerrit)

              unread,
              2:03 AM (7 hours ago) 2:03 AM
              to Giovanni Ortuno Urquidi, Hongchan Choi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, toyosh...@chromium.org
              Attention needed from Giovanni Ortuno Urquidi

              Takashi Toyoshima added 1 comment

              File media/midi/ump_message_util_encoder_fuzzer.cc
              Line 13, Patchset 12:DEFINE_LLVM_FUZZER_TEST_ONE_INPUT_SPAN(const base::span<const uint8_t> data) {
              Giovanni Ortuno Urquidi . unresolved

              LLVM-style fuzzers are deprecated and will need migrating. Please write a FUZZ_TEST instead. You can add it to ump_message_util_unittest.cc directly: https://chromium.googlesource.com/chromium/src/+/HEAD/testing/libfuzzer/README.md#libFuzzer-deprecated

              Same for the other fuzzer.

              Takashi Toyoshima

              Ok, rewritten in the new style!

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Giovanni Ortuno Urquidi
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: Iad3b9b3635a76fe8c31cdd161b4027cd102f87cd
              Gerrit-Change-Number: 8016282
              Gerrit-PatchSet: 13
              Gerrit-Owner: Takashi Toyoshima <toyo...@chromium.org>
              Gerrit-Reviewer: Hongchan Choi <hong...@chromium.org>
              Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
              Gerrit-CC: Giovanni Ortuno Urquidi <ort...@chromium.org>
              Gerrit-CC: Michael Wilson <mjwi...@chromium.org>
              Gerrit-Attention: Giovanni Ortuno Urquidi <ort...@chromium.org>
              Gerrit-Comment-Date: Tue, 21 Jul 2026 06:02:43 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Giovanni Ortuno Urquidi <ort...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy
              Reply all
              Reply to author
              Forward
              0 new messages