Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: media/midi/midi_manager_win.cc

Issue 1061893002: Web MIDI: use GetVendorName() result only if it is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_manager_win.cc
diff --git a/media/midi/midi_manager_win.cc b/media/midi/midi_manager_win.cc
index 926fe291483348d45310b2b285b90c9c2b8198ab..44110f2c6e3d0ce4c10c68821a222309bd05ecbd 100644
--- a/media/midi/midi_manager_win.cc
+++ b/media/midi/midi_manager_win.cc
@@ -291,8 +291,11 @@ struct MidiDeviceInfo final {
};
std::string GetManufacturerName(const MidiDeviceInfo& info) {
- if (info.is_usb_device)
- return device::UsbIds::GetVendorName(info.usb_vendor_id);
+ if (info.is_usb_device) {
+ const char* name = device::UsbIds::GetVendorName(info.usb_vendor_id);
+ if (name)
yukawa 2015/04/06 17:24:55 Probably return std::string(name ? name : ""); m
+ return name;
+ }
switch (info.manufacturer_id) {
case MM_MICROSOFT:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698