summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Harris <wfh@chromium.org>2015-06-18 11:14:40 -0700
committerWill Harris <wfh@chromium.org>2015-06-18 18:15:35 +0000
commitb30110acb142ab5f2d57b85cdf8dcde32d2ce022 (patch)
treee3d059cc24f582d1ff83c90893e38f74817ad6b6
parent0cd3d359602747b174d1c7a22427e62335f6cc9f (diff)
downloadchromium_src-b30110acb142ab5f2d57b85cdf8dcde32d2ce022.zip
chromium_src-b30110acb142ab5f2d57b85cdf8dcde32d2ce022.tar.gz
chromium_src-b30110acb142ab5f2d57b85cdf8dcde32d2ce022.tar.bz2
Merge M43: Web MIDI: disable unsupported devices on Windows
BUG=499279 R=yukawa@chromium.org Review URL: https://codereview.chromium.org/1178793007. Cr-Commit-Position: refs/heads/master@{#334994} (cherry picked from commit 133b995ac61440832fe1b91d2180eb0da182aced) Review URL: https://codereview.chromium.org/1182913007. Cr-Commit-Position: refs/branch-heads/2357@{#476} Cr-Branched-From: 59d4494849b405682265ed5d3f5164573b9a939b-refs/heads/master@{#323860}
-rw-r--r--media/midi/midi_manager_win.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/media/midi/midi_manager_win.cc b/media/midi/midi_manager_win.cc
index 1d140c3..e7cb8f3 100644
--- a/media/midi/midi_manager_win.cc
+++ b/media/midi/midi_manager_win.cc
@@ -305,6 +305,12 @@ std::string GetManufacturerName(const MidiDeviceInfo& info) {
}
}
+bool IsUnsupportedDevice(const MidiDeviceInfo& info) {
+ return info.manufacturer_id == MM_MICROSOFT &&
+ (info.product_id == MM_MSFT_WDMAUDIO_MIDIOUT ||
+ info.product_id == MM_MSFT_GENERIC_MIDISYNTH);
+}
+
using PortNumberCache = base::hash_map<
MidiDeviceInfo,
std::priority_queue<uint32, std::vector<uint32>, std::greater<uint32>>,
@@ -828,6 +834,8 @@ class MidiServiceWinImpl : public MidiServiceWin {
make_scoped_refptr(new MidiOutputDeviceState(MidiDeviceInfo(caps)));
state->midi_handle = midi_out_handle;
const auto& state_device_info = state->device_info;
+ if (IsUnsupportedDevice(state_device_info))
+ return;
bool add_new_port = false;
uint32 port_number = 0;
{