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

Side by Side Diff: Source/modules/webmidi/MIDIConnectionEvent.h

Issue 943173002: Web MIDI: dispatch MIDIConnectionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review #3 Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « Source/modules/webmidi/MIDIAccess.idl ('k') | Source/modules/webmidi/MIDIConnectionEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
34 #include "modules/EventModules.h" 34 #include "modules/EventModules.h"
35 #include "modules/webmidi/MIDIPort.h" 35 #include "modules/webmidi/MIDIPort.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class MIDIConnectionEventInit; 39 class MIDIConnectionEventInit;
40 40
41 class MIDIConnectionEvent final : public Event { 41 class MIDIConnectionEvent final : public Event {
42 DEFINE_WRAPPERTYPEINFO(); 42 DEFINE_WRAPPERTYPEINFO();
43 public: 43 public:
44 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(); 44 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create()
45 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString &, MIDIPort*); 45 {
46 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString &, const MIDIConnectionEventInit&); 46 return adoptRefWillBeNoop(new MIDIConnectionEvent());
47 }
48
49 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(MIDIPort* port)
50 {
51 return adoptRefWillBeNoop(new MIDIConnectionEvent(port));
52 }
53
54 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString & type, const MIDIConnectionEventInit& initializer)
55 {
56 return adoptRefWillBeNoop(new MIDIConnectionEvent(type, initializer));
57 }
47 58
48 MIDIPort* port() { return m_port; } 59 MIDIPort* port() { return m_port; }
49 60
50 virtual const AtomicString& interfaceName() const override { return EventNam es::MIDIConnectionEvent; } 61 virtual const AtomicString& interfaceName() const override { return EventNam es::MIDIConnectionEvent; }
51 62
52 DECLARE_VIRTUAL_TRACE(); 63 DECLARE_VIRTUAL_TRACE();
53 64
54 private: 65 private:
55 MIDIConnectionEvent(); 66 MIDIConnectionEvent()
56 MIDIConnectionEvent(const AtomicString&, MIDIPort*); 67 : Event(EventTypeNames::statechange, false, false) { }
68
69 MIDIConnectionEvent(MIDIPort* port)
70 : Event(EventTypeNames::statechange, false, false)
71 , m_port(port) { }
72
57 MIDIConnectionEvent(const AtomicString&, const MIDIConnectionEventInit&); 73 MIDIConnectionEvent(const AtomicString&, const MIDIConnectionEventInit&);
58 74
59 PersistentWillBeMember<MIDIPort> m_port; 75 PersistentWillBeMember<MIDIPort> m_port;
60 }; 76 };
61 77
62 } // namespace blink 78 } // namespace blink
63 79
64 #endif // MIDIConnectionEvent_h 80 #endif // MIDIConnectionEvent_h
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccess.idl ('k') | Source/modules/webmidi/MIDIConnectionEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698