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

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

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webmidi/MIDIInputMap.cpp ('k') | Source/modules/webmidi/MIDIOutput.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 20 matching lines...) Expand all
31 #ifndef MIDIMessageEvent_h 31 #ifndef MIDIMessageEvent_h
32 #define MIDIMessageEvent_h 32 #define MIDIMessageEvent_h
33 33
34 #include "modules/EventModules.h" 34 #include "modules/EventModules.h"
35 #include "wtf/Uint8Array.h" 35 #include "wtf/Uint8Array.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 struct MIDIMessageEventInit : public EventInit { 39 struct MIDIMessageEventInit : public EventInit {
40 MIDIMessageEventInit() 40 MIDIMessageEventInit()
41 : receivedTime(0.0) 41 : receivedTime(0.0) { }
42 {
43 };
44 42
45 double receivedTime; 43 double receivedTime;
46 RefPtr<Uint8Array> data; 44 RefPtr<Uint8Array> data;
47 }; 45 };
48 46
49 class MIDIMessageEvent FINAL : public Event { 47 class MIDIMessageEvent FINAL : public Event {
50 DEFINE_WRAPPERTYPEINFO(); 48 DEFINE_WRAPPERTYPEINFO();
51 public: 49 public:
52 static PassRefPtrWillBeRawPtr<MIDIMessageEvent> create() 50 static PassRefPtrWillBeRawPtr<MIDIMessageEvent> create()
53 { 51 {
(...skipping 12 matching lines...) Expand all
66 64
67 double receivedTime() { return m_receivedTime; } 65 double receivedTime() { return m_receivedTime; }
68 PassRefPtr<Uint8Array> data() { return m_data; } 66 PassRefPtr<Uint8Array> data() { return m_data; }
69 67
70 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam es::MIDIMessageEvent; } 68 virtual const AtomicString& interfaceName() const OVERRIDE { return EventNam es::MIDIMessageEvent; }
71 69
72 virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); } 70 virtual void trace(Visitor* visitor) OVERRIDE { Event::trace(visitor); }
73 71
74 private: 72 private:
75 MIDIMessageEvent() 73 MIDIMessageEvent()
76 : m_receivedTime(0) 74 : m_receivedTime(0) { }
77 {
78 ScriptWrappable::init(this);
79 }
80 75
81 MIDIMessageEvent(double receivedTime, PassRefPtr<Uint8Array> data) 76 MIDIMessageEvent(double receivedTime, PassRefPtr<Uint8Array> data)
82 : Event(EventTypeNames::midimessage, true, false) 77 : Event(EventTypeNames::midimessage, true, false)
83 , m_receivedTime(receivedTime) 78 , m_receivedTime(receivedTime)
84 , m_data(data) 79 , m_data(data) { }
85 {
86 ScriptWrappable::init(this);
87 }
88 80
89 MIDIMessageEvent(const AtomicString& type, const MIDIMessageEventInit& initi alizer) 81 MIDIMessageEvent(const AtomicString& type, const MIDIMessageEventInit& initi alizer)
90 : Event(type, initializer) 82 : Event(type, initializer)
91 , m_receivedTime(initializer.receivedTime) 83 , m_receivedTime(initializer.receivedTime)
92 , m_data(initializer.data) 84 , m_data(initializer.data) { }
93 {
94 ScriptWrappable::init(this);
95 }
96 85
97 double m_receivedTime; 86 double m_receivedTime;
98 RefPtr<Uint8Array> m_data; 87 RefPtr<Uint8Array> m_data;
99 }; 88 };
100 89
101 } // namespace blink 90 } // namespace blink
102 91
103 #endif // MIDIMessageEvent_h 92 #endif // MIDIMessageEvent_h
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIInputMap.cpp ('k') | Source/modules/webmidi/MIDIOutput.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698