OLD | NEW |
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 MIDIAccessInitializer_h | 5 #ifndef MIDIAccessInitializer_h |
6 #define MIDIAccessInitializer_h | 6 #define MIDIAccessInitializer_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "modules/webmidi/MIDIAccessor.h" | 11 #include "modules/webmidi/MIDIAccessor.h" |
12 #include "modules/webmidi/MIDIAccessorClient.h" | 12 #include "modules/webmidi/MIDIAccessorClient.h" |
13 #include "modules/webmidi/MIDIOptions.h" | 13 #include "modules/webmidi/MIDIOptions.h" |
14 #include "modules/webmidi/MIDIPort.h" | 14 #include "modules/webmidi/MIDIPort.h" |
| 15 #include "wtf/OwnPtr.h" |
15 #include "wtf/Vector.h" | 16 #include "wtf/Vector.h" |
16 #include <memory> | |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class ScriptState; | 20 class ScriptState; |
21 | 21 |
22 class MODULES_EXPORT MIDIAccessInitializer : public ScriptPromiseResolver, publi
c MIDIAccessorClient { | 22 class MODULES_EXPORT MIDIAccessInitializer : public ScriptPromiseResolver, publi
c MIDIAccessorClient { |
23 public: | 23 public: |
24 struct PortDescriptor { | 24 struct PortDescriptor { |
25 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 25 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
26 String id; | 26 String id; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 private: | 67 private: |
68 MIDIAccessInitializer(ScriptState*, const MIDIOptions&); | 68 MIDIAccessInitializer(ScriptState*, const MIDIOptions&); |
69 | 69 |
70 ExecutionContext* getExecutionContext() const; | 70 ExecutionContext* getExecutionContext() const; |
71 ScriptPromise start(); | 71 ScriptPromise start(); |
72 void dispose(); | 72 void dispose(); |
73 | 73 |
74 void contextDestroyed() override; | 74 void contextDestroyed() override; |
75 | 75 |
76 std::unique_ptr<MIDIAccessor> m_accessor; | 76 OwnPtr<MIDIAccessor> m_accessor; |
77 Vector<PortDescriptor> m_portDescriptors; | 77 Vector<PortDescriptor> m_portDescriptors; |
78 MIDIOptions m_options; | 78 MIDIOptions m_options; |
79 bool m_hasBeenDisposed; | 79 bool m_hasBeenDisposed; |
80 bool m_permissionResolved; | 80 bool m_permissionResolved; |
81 }; | 81 }; |
82 | 82 |
83 } // namespace blink | 83 } // namespace blink |
84 | 84 |
85 #endif // MIDIAccessInitializer_h | 85 #endif // MIDIAccessInitializer_h |
OLD | NEW |