• toyoshim's avatar
    Web MIDI: Improve device change monitornig on Windows · 3e47c6db
    toyoshim authored
    Current implementation monitors DBT_DEVICEARRIVAL mesage, but that
    is not a right message to monitor device changes since actual device
    list that OS holds will be updated a little later. Instead, monitor
    DBT_DEVNODES_CHANGES that is delivered after the list being updated.
    
    In Chrome, SystemMessageWindowWin invokes base::SystemMonitor's observer
    with DEVTYPE_UNKNOWN for DBT_DEVNODES_CHANGED, and the SystemMonitor
    provides a way to observe the event on the registered thread.
    Using the monitor must be the right implementation.
    
    BUG=472980
    
    Review URL: https://codereview.chromium.org/1056333002
    
    Cr-Commit-Position: refs/heads/master@{#324031}
    3e47c6db
midi_manager_win.cc 42.8 KB