| 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 24 matching lines...) Expand all Loading... |
| 35 #include "modules/EventModules.h" | 35 #include "modules/EventModules.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class MIDIMessageEventInit; | 39 class MIDIMessageEventInit; |
| 40 class ExecutionContext; | 40 class ExecutionContext; |
| 41 | 41 |
| 42 class MIDIMessageEvent final : public Event { | 42 class MIDIMessageEvent final : public Event { |
| 43 DEFINE_WRAPPERTYPEINFO(); | 43 DEFINE_WRAPPERTYPEINFO(); |
| 44 public: | 44 public: |
| 45 static MIDIMessageEvent* create() | |
| 46 { | |
| 47 return new MIDIMessageEvent(); | |
| 48 } | |
| 49 | |
| 50 static MIDIMessageEvent* create(double receivedTime, DOMUint8Array* data) | 45 static MIDIMessageEvent* create(double receivedTime, DOMUint8Array* data) |
| 51 { | 46 { |
| 52 return new MIDIMessageEvent(receivedTime, data); | 47 return new MIDIMessageEvent(receivedTime, data); |
| 53 } | 48 } |
| 54 | 49 |
| 55 static MIDIMessageEvent* create(ExecutionContext* context, const AtomicStrin
g& type, const MIDIMessageEventInit& initializer) | 50 static MIDIMessageEvent* create(ExecutionContext* context, const AtomicStrin
g& type, const MIDIMessageEventInit& initializer) |
| 56 { | 51 { |
| 57 return new MIDIMessageEvent(context, type, initializer); | 52 return new MIDIMessageEvent(context, type, initializer); |
| 58 } | 53 } |
| 59 | 54 |
| 60 double receivedTime() { return m_receivedTime; } | 55 double receivedTime() { return m_receivedTime; } |
| 61 DOMUint8Array* data() { return m_data; } | 56 DOMUint8Array* data() { return m_data; } |
| 62 | 57 |
| 63 const AtomicString& interfaceName() const override { return EventNames::MIDI
MessageEvent; } | 58 const AtomicString& interfaceName() const override { return EventNames::MIDI
MessageEvent; } |
| 64 | 59 |
| 65 DEFINE_INLINE_VIRTUAL_TRACE() | 60 DEFINE_INLINE_VIRTUAL_TRACE() |
| 66 { | 61 { |
| 67 visitor->trace(m_data); | 62 visitor->trace(m_data); |
| 68 Event::trace(visitor); | 63 Event::trace(visitor); |
| 69 } | 64 } |
| 70 | 65 |
| 71 private: | 66 private: |
| 72 MIDIMessageEvent() | |
| 73 : m_receivedTime(0) { } | |
| 74 | |
| 75 MIDIMessageEvent(double receivedTime, DOMUint8Array* data) | 67 MIDIMessageEvent(double receivedTime, DOMUint8Array* data) |
| 76 : Event(EventTypeNames::midimessage, true, false) | 68 : Event(EventTypeNames::midimessage, true, false) |
| 77 , m_receivedTime(receivedTime) | 69 , m_receivedTime(receivedTime) |
| 78 , m_data(data) { } | 70 , m_data(data) { } |
| 79 | 71 |
| 80 MIDIMessageEvent(ExecutionContext*, const AtomicString& type, const MIDIMess
ageEventInit& initializer); | 72 MIDIMessageEvent(ExecutionContext*, const AtomicString& type, const MIDIMess
ageEventInit& initializer); |
| 81 | 73 |
| 82 double m_receivedTime; | 74 double m_receivedTime; |
| 83 Member<DOMUint8Array> m_data; | 75 Member<DOMUint8Array> m_data; |
| 84 }; | 76 }; |
| 85 | 77 |
| 86 } // namespace blink | 78 } // namespace blink |
| 87 | 79 |
| 88 #endif // MIDIMessageEvent_h | 80 #endif // MIDIMessageEvent_h |
| OLD | NEW |