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 23 matching lines...) Expand all Loading... | |
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 DEFINE_INLINE_VIRTUAL_TRACE() |
kouhei (in TOK)
2015/02/23 01:40:41
DECLARE_VIRTUAL_TRACE is recommended over DEFINE_I
Takashi Toyoshima
2015/02/23 11:15:35
Done.
| |
64 { | |
65 visitor->trace(m_port); | |
66 Event::trace(visitor); | |
67 } | |
53 | 68 |
54 private: | 69 private: |
55 MIDIConnectionEvent(); | 70 MIDIConnectionEvent() |
56 MIDIConnectionEvent(const AtomicString&, MIDIPort*); | 71 : Event(EventTypeNames::statechange, false, false) { } |
72 | |
73 MIDIConnectionEvent(MIDIPort* port) | |
74 : Event(EventTypeNames::statechange, false, false) | |
75 , m_port(port) { } | |
76 | |
57 MIDIConnectionEvent(const AtomicString&, const MIDIConnectionEventInit&); | 77 MIDIConnectionEvent(const AtomicString&, const MIDIConnectionEventInit&); |
58 | 78 |
59 PersistentWillBeMember<MIDIPort> m_port; | 79 PersistentWillBeMember<MIDIPort> m_port; |
60 }; | 80 }; |
61 | 81 |
62 } // namespace blink | 82 } // namespace blink |
63 | 83 |
64 #endif // MIDIConnectionEvent_h | 84 #endif // MIDIConnectionEvent_h |
OLD | NEW |