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

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

Issue 2923163003: Web MIDI: use midi::TaskService in MidiManagerAlsa (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SERVICE_H_ 5 #ifndef MEDIA_MIDI_MIDI_SERVICE_H_
6 #define MEDIA_MIDI_MIDI_SERVICE_H_ 6 #define MEDIA_MIDI_MIDI_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // TaskRunner will be constructed on demand. 53 // TaskRunner will be constructed on demand.
54 // MidiManager that supports the dynamic instantiation feature will use this 54 // MidiManager that supports the dynamic instantiation feature will use this
55 // method to post tasks that should not run on I/O. Since TaskRunners outlive 55 // method to post tasks that should not run on I/O. Since TaskRunners outlive
56 // MidiManager, each task should ensure that MidiManager that posted the task 56 // MidiManager, each task should ensure that MidiManager that posted the task
57 // is still alive while accessing |this|. TaskRunners will be reused when 57 // is still alive while accessing |this|. TaskRunners will be reused when
58 // another MidiManager is instantiated. 58 // another MidiManager is instantiated.
59 // TODO(toyoshim): Remove this interface. 59 // TODO(toyoshim): Remove this interface.
60 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(size_t runner_id); 60 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(size_t runner_id);
61 61
62 // Obtains a TaskService that lives with MidiService. 62 // Obtains a TaskService that lives with MidiService.
63 TaskService* task() { return task_service_.get(); } 63 TaskService* task_service() { return task_service_.get(); }
64 64
65 private: 65 private:
66 // Holds MidiManager instance. If the dynamic instantiation feature is 66 // Holds MidiManager instance. If the dynamic instantiation feature is
67 // enabled, the MidiManager would be constructed and destructed on the I/O 67 // enabled, the MidiManager would be constructed and destructed on the I/O
68 // thread, and all MidiManager methods would be called on the I/O thread. 68 // thread, and all MidiManager methods would be called on the I/O thread.
69 std::unique_ptr<MidiManager> manager_; 69 std::unique_ptr<MidiManager> manager_;
70 70
71 // Holds TaskService instance. 71 // Holds TaskService instance.
72 std::unique_ptr<TaskService> task_service_; 72 std::unique_ptr<TaskService> task_service_;
73 73
(...skipping 15 matching lines...) Expand all
89 89
90 // Protects |threads_|. 90 // Protects |threads_|.
91 base::Lock threads_lock_; 91 base::Lock threads_lock_;
92 92
93 DISALLOW_COPY_AND_ASSIGN(MidiService); 93 DISALLOW_COPY_AND_ASSIGN(MidiService);
94 }; 94 };
95 95
96 } // namespace midi 96 } // namespace midi
97 97
98 #endif // MEDIA_MIDI_MIDI_SERVICE_H_ 98 #endif // MEDIA_MIDI_MIDI_SERVICE_H_
OLDNEW
« media/midi/midi_manager_alsa.cc ('K') | « media/midi/midi_manager_alsa.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698