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 29 matching lines...) Expand all Loading... |
40 MIDIConnectionEventInit() | 40 MIDIConnectionEventInit() |
41 : port(nullptr) | 41 : port(nullptr) |
42 { | 42 { |
43 }; | 43 }; |
44 | 44 |
45 RefPtr<MIDIPort> port; | 45 RefPtr<MIDIPort> port; |
46 }; | 46 }; |
47 | 47 |
48 class MIDIConnectionEvent FINAL : public Event { | 48 class MIDIConnectionEvent FINAL : public Event { |
49 public: | 49 public: |
50 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create() | 50 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(); |
51 { | 51 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString
&, PassRefPtrWillBeRawPtr<MIDIPort>); |
52 return adoptRefWillBeNoop(new MIDIConnectionEvent()); | 52 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString
&, const MIDIConnectionEventInit&); |
53 } | |
54 | 53 |
55 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString
& type, PassRefPtr<MIDIPort> port) | 54 PassRefPtrWillBeRawPtr<MIDIPort> port() { return m_port; } |
56 { | |
57 return adoptRefWillBeNoop(new MIDIConnectionEvent(type, port)); | |
58 } | |
59 | |
60 static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString
& type, const MIDIConnectionEventInit& initializer) | |
61 { | |
62 return adoptRefWillBeNoop(new MIDIConnectionEvent(type, initializer)); | |
63 } | |
64 | |
65 RefPtr<MIDIPort> port() { return m_port; } | |
66 | 55 |
67 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam
es::MIDIConnectionEvent; } | 56 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam
es::MIDIConnectionEvent; } |
68 | 57 |
69 virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); } | 58 virtual void trace(Visitor*) OVERRIDE; |
70 | 59 |
71 private: | 60 private: |
72 MIDIConnectionEvent() | 61 MIDIConnectionEvent(); |
73 { | 62 MIDIConnectionEvent(const AtomicString&, PassRefPtrWillBeRawPtr<MIDIPort>); |
74 ScriptWrappable::init(this); | 63 MIDIConnectionEvent(const AtomicString&, const MIDIConnectionEventInit&); |
75 } | |
76 | 64 |
77 MIDIConnectionEvent(const AtomicString& type, PassRefPtr<MIDIPort> port) | 65 RefPtrWillBeMember<MIDIPort> m_port; |
78 : Event(type, false, false) | |
79 , m_port(port) | |
80 { | |
81 ScriptWrappable::init(this); | |
82 } | |
83 | |
84 MIDIConnectionEvent(const AtomicString& type, const MIDIConnectionEventInit&
initializer) | |
85 : Event(type, initializer) | |
86 , m_port(initializer.port) | |
87 { | |
88 ScriptWrappable::init(this); | |
89 } | |
90 | |
91 RefPtr<MIDIPort> m_port; | |
92 }; | 66 }; |
93 | 67 |
94 } // namespace WebCore | 68 } // namespace WebCore |
95 | 69 |
96 #endif // MIDIConnectionEvent_h | 70 #endif // MIDIConnectionEvent_h |
OLD | NEW |