| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef MIDIPort_h | 31 #ifndef MIDIPort_h |
| 32 #define MIDIPort_h | 32 #define MIDIPort_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ActiveScriptWrappable.h" | 34 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 35 #include "bindings/core/v8/ScriptPromise.h" | 35 #include "bindings/core/v8/ScriptPromise.h" |
| 36 #include "bindings/core/v8/TraceWrapperMember.h" | 36 #include "bindings/core/v8/TraceWrapperMember.h" |
| 37 #include "core/dom/ActiveDOMObject.h" | |
| 38 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
| 38 #include "core/dom/SuspendableObject.h" |
| 39 #include "media/midi/midi_service.mojom-blink.h" | 39 #include "media/midi/midi_service.mojom-blink.h" |
| 40 #include "modules/EventTargetModules.h" | 40 #include "modules/EventTargetModules.h" |
| 41 #include "modules/webmidi/MIDIAccessor.h" | 41 #include "modules/webmidi/MIDIAccessor.h" |
| 42 #include "platform/heap/Handle.h" | 42 #include "platform/heap/Handle.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 class MIDIAccess; | 46 class MIDIAccess; |
| 47 | 47 |
| 48 class MIDIPort : public EventTargetWithInlineData, | 48 class MIDIPort : public EventTargetWithInlineData, |
| 49 public ActiveScriptWrappable, | 49 public ActiveScriptWrappable, |
| 50 public ActiveDOMObject { | 50 public SuspendableObject { |
| 51 DEFINE_WRAPPERTYPEINFO(); | 51 DEFINE_WRAPPERTYPEINFO(); |
| 52 USING_GARBAGE_COLLECTED_MIXIN(MIDIPort); | 52 USING_GARBAGE_COLLECTED_MIXIN(MIDIPort); |
| 53 | 53 |
| 54 public: | 54 public: |
| 55 enum ConnectionState { | 55 enum ConnectionState { |
| 56 ConnectionStateOpen, | 56 ConnectionStateOpen, |
| 57 ConnectionStateClosed, | 57 ConnectionStateClosed, |
| 58 ConnectionStatePending | 58 ConnectionStatePending |
| 59 }; | 59 }; |
| 60 | 60 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 // EventTarget | 87 // EventTarget |
| 88 const AtomicString& interfaceName() const override { | 88 const AtomicString& interfaceName() const override { |
| 89 return EventTargetNames::MIDIPort; | 89 return EventTargetNames::MIDIPort; |
| 90 } | 90 } |
| 91 ExecutionContext* getExecutionContext() const final; | 91 ExecutionContext* getExecutionContext() const final; |
| 92 | 92 |
| 93 // ScriptWrappable | 93 // ScriptWrappable |
| 94 bool hasPendingActivity() const final; | 94 bool hasPendingActivity() const final; |
| 95 | 95 |
| 96 // ActiveDOMObject | 96 // SuspendableObject |
| 97 void contextDestroyed() override; | 97 void contextDestroyed() override; |
| 98 | 98 |
| 99 protected: | 99 protected: |
| 100 MIDIPort(MIDIAccess*, | 100 MIDIPort(MIDIAccess*, |
| 101 const String& id, | 101 const String& id, |
| 102 const String& manufacturer, | 102 const String& manufacturer, |
| 103 const String& name, | 103 const String& name, |
| 104 TypeCode, | 104 TypeCode, |
| 105 const String& version, | 105 const String& version, |
| 106 midi::mojom::PortState); | 106 midi::mojom::PortState); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 119 TypeCode m_type; | 119 TypeCode m_type; |
| 120 String m_version; | 120 String m_version; |
| 121 TraceWrapperMember<MIDIAccess> m_access; | 121 TraceWrapperMember<MIDIAccess> m_access; |
| 122 midi::mojom::PortState m_state; | 122 midi::mojom::PortState m_state; |
| 123 ConnectionState m_connection; | 123 ConnectionState m_connection; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| 127 | 127 |
| 128 #endif // MIDIPort_h | 128 #endif // MIDIPort_h |
| OLD | NEW |