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

Unified Diff: media/midi/midi_service.h

Issue 2741713002: Web MIDI: implement TaskService (Closed)
Patch Set: review #35 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/midi/BUILD.gn ('k') | media/midi/midi_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_service.h
diff --git a/media/midi/midi_service.h b/media/midi/midi_service.h
index 3017b862239c6b61081ca0b1e872ebb44b10a86e..fb84e0a668a70dabfb628ac968bff743cd594c8e 100644
--- a/media/midi/midi_service.h
+++ b/media/midi/midi_service.h
@@ -20,6 +20,8 @@
namespace midi {
+class TaskService;
+
// Manages MidiManager backends. This class expects to be constructed and
// destructed on the browser main thread, but methods can be called on both
// the main thread and the I/O thread.
@@ -54,14 +56,21 @@ class MIDI_EXPORT MidiService final {
// MidiManager, each task should ensure that MidiManager that posted the task
// is still alive while accessing |this|. TaskRunners will be reused when
// another MidiManager is instantiated.
+ // TODO(toyoshim): Remove this interface.
scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(size_t runner_id);
+ // Obtains a TaskService that lives with MidiService.
+ TaskService* task_service() { return task_service_.get(); }
+
private:
// Holds MidiManager instance. If the dynamic instantiation feature is
// enabled, the MidiManager would be constructed and destructed on the I/O
// thread, and all MidiManager methods would be called on the I/O thread.
std::unique_ptr<MidiManager> manager_;
+ // Holds TaskService instance.
+ std::unique_ptr<TaskService> task_service_;
+
// TaskRunner to destruct |manager_| on the right thread.
scoped_refptr<base::SingleThreadTaskRunner> manager_destructor_runner_;
« no previous file with comments | « media/midi/BUILD.gn ('k') | media/midi/midi_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698