OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ |
6 #define CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ | 6 #define CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/public/browser/browser_message_filter.h" | 20 #include "content/public/browser/browser_message_filter.h" |
21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
22 #include "media/midi/midi_manager.h" | 22 #include "media/midi/midi_manager.h" |
23 #include "media/midi/midi_port_info.h" | 23 #include "media/midi/midi_port_info.h" |
yhirano
2016/10/17 05:23:27
+media/midi/midi_service.mojom.h
Takashi Toyoshima
2016/10/17 06:38:57
Done.
| |
24 | 24 |
25 namespace midi { | 25 namespace midi { |
26 class MidiManager; | 26 class MidiManager; |
27 class MidiMessageQueue; | 27 class MidiMessageQueue; |
28 } // namespace midi | 28 } // namespace midi |
29 | 29 |
30 namespace content { | 30 namespace content { |
31 | 31 |
32 class CONTENT_EXPORT MidiHost : public BrowserMessageFilter, | 32 class CONTENT_EXPORT MidiHost : public BrowserMessageFilter, |
33 public midi::MidiManagerClient { | 33 public midi::MidiManagerClient { |
34 public: | 34 public: |
35 // Called from UI thread from the owner of this object. | 35 // Called from UI thread from the owner of this object. |
36 MidiHost(int renderer_process_id, midi::MidiManager* midi_manager); | 36 MidiHost(int renderer_process_id, midi::MidiManager* midi_manager); |
37 | 37 |
38 // BrowserMessageFilter implementation. | 38 // BrowserMessageFilter implementation. |
39 void OnChannelClosing() override; | 39 void OnChannelClosing() override; |
40 void OnDestruct() const override; | 40 void OnDestruct() const override; |
41 bool OnMessageReceived(const IPC::Message& message) override; | 41 bool OnMessageReceived(const IPC::Message& message) override; |
42 | 42 |
43 // MidiManagerClient implementation. | 43 // MidiManagerClient implementation. |
44 void CompleteStartSession(midi::Result result) override; | 44 void CompleteStartSession(midi::mojom::Result result) override; |
45 void AddInputPort(const midi::MidiPortInfo& info) override; | 45 void AddInputPort(const midi::MidiPortInfo& info) override; |
46 void AddOutputPort(const midi::MidiPortInfo& info) override; | 46 void AddOutputPort(const midi::MidiPortInfo& info) override; |
47 void SetInputPortState(uint32_t port, | 47 void SetInputPortState(uint32_t port, |
48 midi::MidiPortState state) override; | 48 midi::MidiPortState state) override; |
49 void SetOutputPortState(uint32_t port, | 49 void SetOutputPortState(uint32_t port, |
50 midi::MidiPortState state) override; | 50 midi::MidiPortState state) override; |
51 void ReceiveMidiData(uint32_t port, | 51 void ReceiveMidiData(uint32_t port, |
52 const uint8_t* data, | 52 const uint8_t* data, |
53 size_t length, | 53 size_t length, |
54 double timestamp) override; | 54 double timestamp) override; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 | 118 |
119 // Protects access to |output_port_count_|. | 119 // Protects access to |output_port_count_|. |
120 base::Lock output_port_count_lock_; | 120 base::Lock output_port_count_lock_; |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(MidiHost); | 122 DISALLOW_COPY_AND_ASSIGN(MidiHost); |
123 }; | 123 }; |
124 | 124 |
125 } // namespace content | 125 } // namespace content |
126 | 126 |
127 #endif // CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ | 127 #endif // CONTENT_BROWSER_MEDIA_MIDI_HOST_H_ |
OLD | NEW |