Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2547)

Unified Diff: Source/modules/webmidi/MIDIConnectionEvent.h

Issue 14358032: Web MIDI: implement MIDIConnectionEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: (rebase) Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webmidi/DOMWindowWebMIDI.idl ('k') | Source/modules/webmidi/MIDIConnectionEvent.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webmidi/MIDIConnectionEvent.h
diff --git a/Source/modules/webmidi/MIDIMessageEvent.h b/Source/modules/webmidi/MIDIConnectionEvent.h
similarity index 59%
copy from Source/modules/webmidi/MIDIMessageEvent.h
copy to Source/modules/webmidi/MIDIConnectionEvent.h
index dcc3bd825fbf7abef67e133b23ded2477ca36bb2..4b193ee5df10f863f164b2eabb3a0a41185af54a 100644
--- a/Source/modules/webmidi/MIDIMessageEvent.h
+++ b/Source/modules/webmidi/MIDIConnectionEvent.h
@@ -28,70 +28,67 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MIDIMessageEvent_h
-#define MIDIMessageEvent_h
+#ifndef MIDIConnectionEvent_h
+#define MIDIConnectionEvent_h
#include "core/dom/Event.h"
-#include "wtf/Uint8Array.h"
+#include "modules/webmidi/MIDIPort.h"
namespace WebCore {
-struct MIDIMessageEventInit : public EventInit {
- MIDIMessageEventInit()
- : receivedTime(0.0)
+struct MIDIConnectionEventInit : public EventInit {
+ MIDIConnectionEventInit()
+ : port(0)
{
};
- double receivedTime;
- RefPtr<Uint8Array> data;
+ RefPtr<MIDIPort> port;
};
-class MIDIMessageEvent : public Event {
+class MIDIConnectionEvent : public Event {
public:
- static PassRefPtr<MIDIMessageEvent> create()
+ static PassRefPtr<MIDIConnectionEvent> create()
{
- return adoptRef(new MIDIMessageEvent());
+ return adoptRef(new MIDIConnectionEvent());
}
- static PassRefPtr<MIDIMessageEvent> create(double receivedTime, PassRefPtr<Uint8Array> data)
+ static PassRefPtr<MIDIConnectionEvent> create(const AtomicString& type, PassRefPtr<MIDIPort> port)
{
- return adoptRef(new MIDIMessageEvent(receivedTime, data));
+ return adoptRef(new MIDIConnectionEvent(type, port));
}
- static PassRefPtr<MIDIMessageEvent> create(const AtomicString& type, const MIDIMessageEventInit& initializer)
+ static PassRefPtr<MIDIConnectionEvent> create(const AtomicString& type, const MIDIConnectionEventInit& initializer)
{
- return adoptRef(new MIDIMessageEvent(type, initializer));
+ return adoptRef(new MIDIConnectionEvent(type, initializer));
}
- double receivedTime() { return m_receivedTime; }
- PassRefPtr<Uint8Array> data() { return m_data; }
+ RefPtr<MIDIPort> port() { return m_port; }
+
+ virtual const AtomicString& interfaceName() const OVERRIDE { return eventNames().interfaceForMIDIConnectionEvent; }
private:
- MIDIMessageEvent()
- : m_receivedTime(0.0)
+ MIDIConnectionEvent()
{
ScriptWrappable::init(this);
}
- MIDIMessageEvent(double receivedTime, PassRefPtr<Uint8Array> data)
- : m_receivedTime(receivedTime)
- , m_data(data)
+ MIDIConnectionEvent(const AtomicString& type, PassRefPtr<MIDIPort> port)
+ : Event(type, false, false)
+ , m_port(port)
{
ScriptWrappable::init(this);
}
- MIDIMessageEvent(const AtomicString& type, const MIDIMessageEventInit& initializer)
+ MIDIConnectionEvent(const AtomicString& type, const MIDIConnectionEventInit& initializer)
: Event(type, initializer)
- , m_receivedTime(initializer.receivedTime)
- , m_data(initializer.data)
+ , m_port(initializer.port)
{
ScriptWrappable::init(this);
}
- double m_receivedTime;
- RefPtr<Uint8Array> m_data;
+ RefPtr<MIDIPort> m_port;
};
} // namespace WebCore
-#endif // MIDIMessageEvent_h
+#endif // MIDIConnectionEvent_h
« no previous file with comments | « Source/modules/webmidi/DOMWindowWebMIDI.idl ('k') | Source/modules/webmidi/MIDIConnectionEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698