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

Unified Diff: media/midi/midi_manager_alsa.h

Issue 2673423002: Web MIDI: add dynamic MidiManager instantiation support for Linux (Closed)
Patch Set: rebase again Created 3 years, 10 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 | « media/midi/midi_manager.cc ('k') | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_manager_alsa.h
diff --git a/media/midi/midi_manager_alsa.h b/media/midi/midi_manager_alsa.h
index 0ff58a76c10dcf3805e0ed2e1093a79caa2313bc..d1af6f1f623e64be4dfa691601033c4ef9ae7039 100644
--- a/media/midi/midi_manager_alsa.h
+++ b/media/midi/midi_manager_alsa.h
@@ -31,7 +31,7 @@ namespace midi {
class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
public:
- MidiManagerAlsa();
+ explicit MidiManagerAlsa(MidiService* service);
~MidiManagerAlsa() override;
// MidiManager implementation.
@@ -373,10 +373,12 @@ class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
std::unique_ptr<snd_midi_event_t, SndMidiEventDeleter>;
// An internal callback that runs on MidiSendThread.
- void SendMidiData(uint32_t port_index, const std::vector<uint8_t>& data);
+ void SendMidiData(int instance_id,
+ MidiManagerClient* client,
+ uint32_t port_index,
+ const std::vector<uint8_t>& data);
- void ScheduleEventLoop();
- void EventLoop();
+ void EventLoop(int instance_id);
void ProcessSingleEvent(snd_seq_event_t* event, double timestamp);
void ProcessClientStartEvent(int client_id);
void ProcessPortStartEvent(const snd_seq_addr_t& addr);
@@ -420,9 +422,6 @@ class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
// wait for our information from ALSA and udev to get back in sync.
int alsa_card_midi_count_ = 0;
- base::Lock shutdown_lock_; // guards event_thread_shutdown_
- bool event_thread_shutdown_ = false; // guarded by shutdown_lock_
-
// This lock is needed to ensure that members destroyed in Finalize
// will be visibly destroyed before the destructor is run in the
// other thread. Otherwise, the same objects may have their destructors
@@ -447,10 +446,7 @@ class MIDI_EXPORT MidiManagerAlsa final : public MidiManager {
device::ScopedUdevPtr udev_;
device::ScopedUdevMonitorPtr udev_monitor_;
- // Threads for sending and receiving. These are initialized in the
- // constructor, but are started at the end of StartInitialization.
- base::Thread event_thread_;
- base::Thread send_thread_;
+ int instance_id_;
DISALLOW_COPY_AND_ASSIGN(MidiManagerAlsa);
};
« no previous file with comments | « media/midi/midi_manager.cc ('k') | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698