OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 DECLARE_VIRTUAL_TRACE(); | 79 DECLARE_VIRTUAL_TRACE(); |
80 | 80 |
81 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 81 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
82 | 82 |
83 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 83 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
84 | 84 |
85 // EventTarget | 85 // EventTarget |
86 const AtomicString& interfaceName() const override { return EventTargetNames
::MIDIPort; } | 86 const AtomicString& interfaceName() const override { return EventTargetNames
::MIDIPort; } |
87 ExecutionContext* getExecutionContext() const final; | 87 ExecutionContext* getExecutionContext() const final; |
88 | 88 |
89 // ActiveScriptWrappable | 89 // ScriptWrappable |
90 bool hasPendingActivity() const final; | 90 bool hasPendingActivity() const final; |
91 | 91 |
92 // ActiveDOMObject | 92 // ActiveDOMObject |
93 void stop() override; | 93 void stop() override; |
94 | 94 |
95 protected: | 95 protected: |
96 MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const St
ring& name, TypeCode, const String& version, MIDIAccessor::MIDIPortState); | 96 MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const St
ring& name, TypeCode, const String& version, MIDIAccessor::MIDIPortState); |
97 | 97 |
98 void open(); | 98 void open(); |
99 | 99 |
100 private: | 100 private: |
101 ScriptPromise accept(ScriptState*); | 101 ScriptPromise accept(ScriptState*); |
102 ScriptPromise reject(ScriptState*, ExceptionCode, const String& message); | 102 ScriptPromise reject(ScriptState*, ExceptionCode, const String& message); |
103 | 103 |
104 void setStates(MIDIAccessor::MIDIPortState, ConnectionState); | 104 void setStates(MIDIAccessor::MIDIPortState, ConnectionState); |
105 | 105 |
106 String m_id; | 106 String m_id; |
107 String m_manufacturer; | 107 String m_manufacturer; |
108 String m_name; | 108 String m_name; |
109 TypeCode m_type; | 109 TypeCode m_type; |
110 String m_version; | 110 String m_version; |
111 Member<MIDIAccess> m_access; | 111 Member<MIDIAccess> m_access; |
112 MIDIAccessor::MIDIPortState m_state; | 112 MIDIAccessor::MIDIPortState m_state; |
113 ConnectionState m_connection; | 113 ConnectionState m_connection; |
114 }; | 114 }; |
115 | 115 |
116 } // namespace blink | 116 } // namespace blink |
117 | 117 |
118 #endif // MIDIPort_h | 118 #endif // MIDIPort_h |
OLD | NEW |