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

Side by Side Diff: media/midi/midi_manager_alsa.h

Issue 989913002: Move UdevDecodeString from media/midi to device/udev_linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@seq3
Patch Set: Fix unit tests Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « device/udev_linux/udev_unittest.cc ('k') | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_MIDI_MIDI_MANAGER_ALSA_H_ 5 #ifndef MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
6 #define MEDIA_MIDI_MIDI_MANAGER_ALSA_H_ 6 #define MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
7 7
8 #include <alsa/asoundlib.h> 8 #include <alsa/asoundlib.h>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 const std::string alsa_driver() const; 50 const std::string alsa_driver() const;
51 const std::string udev_id_path() const; 51 const std::string udev_id_path() const;
52 const std::string udev_id_id() const; 52 const std::string udev_id_id() const;
53 53
54 private: 54 private:
55 FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ExtractManufacturer); 55 FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ExtractManufacturer);
56 FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, UdevEscape); 56 FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, UdevEscape);
57 57
58 // Extracts the manufacturer using heuristics and a variety of sources. 58 // Extracts the manufacturer using heuristics and a variety of sources.
59 static std::string ExtractManufacturerString( 59 static std::string ExtractManufacturerString(
60 const std::string& udev_id_vendor_enc, 60 const std::string& udev_id_vendor,
61 const std::string& udev_id_vendor_id, 61 const std::string& udev_id_vendor_id,
62 const std::string& udev_id_vendor_from_database, 62 const std::string& udev_id_vendor_from_database,
63 const std::string& alsa_name, 63 const std::string& alsa_name,
64 const std::string& alsa_longname); 64 const std::string& alsa_longname);
65 65
66 // TODO(agoode): Move this into a common place. Maybe device/udev_linux?
67 // Decodes just \xXX in strings.
68 static std::string UnescapeUdev(const std::string& s);
69
70 std::string alsa_name_; 66 std::string alsa_name_;
71 std::string manufacturer_; 67 std::string manufacturer_;
72 std::string alsa_driver_; 68 std::string alsa_driver_;
73 std::string udev_id_path_; 69 std::string udev_id_path_;
74 std::string udev_id_id_; 70 std::string udev_id_id_;
75 }; 71 };
76 72
77 // An internal callback that runs on MidiSendThread. 73 // An internal callback that runs on MidiSendThread.
78 void SendMidiData(uint32 port_index, 74 void SendMidiData(uint32 port_index,
79 const std::vector<uint8>& data); 75 const std::vector<uint8>& data);
(...skipping 29 matching lines...) Expand all
109 105
110 bool event_thread_shutdown_; // guarded by shutdown_lock_ 106 bool event_thread_shutdown_; // guarded by shutdown_lock_
111 base::Lock shutdown_lock_; // guards event_thread_shutdown_ 107 base::Lock shutdown_lock_; // guards event_thread_shutdown_
112 108
113 DISALLOW_COPY_AND_ASSIGN(MidiManagerAlsa); 109 DISALLOW_COPY_AND_ASSIGN(MidiManagerAlsa);
114 }; 110 };
115 111
116 } // namespace media 112 } // namespace media
117 113
118 #endif // MEDIA_MIDI_MIDI_MANAGER_ALSA_H_ 114 #endif // MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
OLDNEW
« no previous file with comments | « device/udev_linux/udev_unittest.cc ('k') | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698