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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 static PassRefPtr<MIDIMessageEvent> create(const AtomicString& type, const M
IDIMessageEventInit& initializer) | 61 static PassRefPtr<MIDIMessageEvent> create(const AtomicString& type, const M
IDIMessageEventInit& initializer) |
62 { | 62 { |
63 return adoptRef(new MIDIMessageEvent(type, initializer)); | 63 return adoptRef(new MIDIMessageEvent(type, initializer)); |
64 } | 64 } |
65 | 65 |
66 double receivedTime() { return m_receivedTime; } | 66 double receivedTime() { return m_receivedTime; } |
67 PassRefPtr<Uint8Array> data() { return m_data; } | 67 PassRefPtr<Uint8Array> data() { return m_data; } |
68 | 68 |
| 69 virtual const AtomicString& interfaceName() const OVERRIDE { return eventNam
es().interfaceForMIDIMessageEvent; } |
| 70 |
69 private: | 71 private: |
70 MIDIMessageEvent() | 72 MIDIMessageEvent() |
71 : m_receivedTime(0.0) | 73 : m_receivedTime(0) |
72 { | 74 { |
73 ScriptWrappable::init(this); | 75 ScriptWrappable::init(this); |
74 } | 76 } |
75 | 77 |
76 MIDIMessageEvent(double receivedTime, PassRefPtr<Uint8Array> data) | 78 MIDIMessageEvent(double receivedTime, PassRefPtr<Uint8Array> data) |
77 : m_receivedTime(receivedTime) | 79 : Event(eventNames().midimessageEvent, true, false) |
| 80 , m_receivedTime(receivedTime) |
78 , m_data(data) | 81 , m_data(data) |
79 { | 82 { |
80 ScriptWrappable::init(this); | 83 ScriptWrappable::init(this); |
81 } | 84 } |
82 | 85 |
83 MIDIMessageEvent(const AtomicString& type, const MIDIMessageEventInit& initi
alizer) | 86 MIDIMessageEvent(const AtomicString& type, const MIDIMessageEventInit& initi
alizer) |
84 : Event(type, initializer) | 87 : Event(type, initializer) |
85 , m_receivedTime(initializer.receivedTime) | 88 , m_receivedTime(initializer.receivedTime) |
86 , m_data(initializer.data) | 89 , m_data(initializer.data) |
87 { | 90 { |
88 ScriptWrappable::init(this); | 91 ScriptWrappable::init(this); |
89 } | 92 } |
90 | 93 |
91 double m_receivedTime; | 94 double m_receivedTime; |
92 RefPtr<Uint8Array> m_data; | 95 RefPtr<Uint8Array> m_data; |
93 }; | 96 }; |
94 | 97 |
95 } // namespace WebCore | 98 } // namespace WebCore |
96 | 99 |
97 #endif // MIDIMessageEvent_h | 100 #endif // MIDIMessageEvent_h |
OLD | NEW |