| 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/webmidi/MIDIAccessor.h" | 10 #include "modules/webmidi/MIDIAccessor.h" |
| 11 #include "modules/webmidi/MIDIAccessorClient.h" | 11 #include "modules/webmidi/MIDIAccessorClient.h" |
| 12 #include "modules/webmidi/MIDIPort.h" | 12 #include "modules/webmidi/MIDIPort.h" |
| 13 #include "wtf/OwnPtr.h" | 13 #include "wtf/OwnPtr.h" |
| 14 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class MIDIOptions; | 18 class MIDIOptions; |
| 19 class ScriptState; | 19 class ScriptState; |
| 20 | 20 |
| 21 class MIDIAccessInitializer : public ScriptPromiseResolver, public MIDIAccessorC
lient { | 21 class MIDIAccessInitializer : public ScriptPromiseResolver, public MIDIAccessorC
lient { |
| 22 WILL_BE_USING_PRE_FINALIZER(MIDIAccessInitializer, dispose); | 22 WILL_BE_USING_PRE_FINALIZER(MIDIAccessInitializer, dispose); |
| 23 public: | 23 public: |
| 24 struct PortDescriptor { | 24 struct PortDescriptor { |
| 25 String id; | 25 String id; |
| 26 String manufacturer; | 26 String manufacturer; |
| 27 String name; | 27 String name; |
| 28 MIDIPort::MIDIPortTypeCode type; | 28 MIDIPort::TypeCode type; |
| 29 String version; | 29 String version; |
| 30 MIDIAccessor::MIDIPortState state; | 30 MIDIAccessor::MIDIPortState state; |
| 31 | 31 |
| 32 PortDescriptor(const String& id, const String& manufacturer, const Strin
g& name, MIDIPort::MIDIPortTypeCode type, const String& version, MIDIAccessor::M
IDIPortState state) | 32 PortDescriptor(const String& id, const String& manufacturer, const Strin
g& name, MIDIPort::TypeCode type, const String& version, MIDIAccessor::MIDIPortS
tate state) |
| 33 : id(id) | 33 : id(id) |
| 34 , manufacturer(manufacturer) | 34 , manufacturer(manufacturer) |
| 35 , name(name) | 35 , name(name) |
| 36 , type(type) | 36 , type(type) |
| 37 , version(version) | 37 , version(version) |
| 38 , state(state) { } | 38 , state(state) { } |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 static ScriptPromise start(ScriptState* scriptState, const MIDIOptions& opti
ons) | 41 static ScriptPromise start(ScriptState* scriptState, const MIDIOptions& opti
ons) |
| 42 { | 42 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 71 OwnPtr<MIDIAccessor> m_accessor; | 71 OwnPtr<MIDIAccessor> m_accessor; |
| 72 Vector<PortDescriptor> m_portDescriptors; | 72 Vector<PortDescriptor> m_portDescriptors; |
| 73 bool m_requestSysex; | 73 bool m_requestSysex; |
| 74 bool m_hasBeenDisposed; | 74 bool m_hasBeenDisposed; |
| 75 bool m_sysexPermissionResolved; | 75 bool m_sysexPermissionResolved; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace blink | 78 } // namespace blink |
| 79 | 79 |
| 80 #endif // MIDIAccessInitializer_h | 80 #endif // MIDIAccessInitializer_h |
| OLD | NEW |