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

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

Issue 2099213002: Web MIDI: prepare to deprecate MIDIMessageEvent::receivedTime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
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 19 matching lines...) Expand all
30 30
31 #ifndef MIDIMessageEvent_h 31 #ifndef MIDIMessageEvent_h
32 #define MIDIMessageEvent_h 32 #define MIDIMessageEvent_h
33 33
34 #include "core/dom/DOMTypedArray.h" 34 #include "core/dom/DOMTypedArray.h"
35 #include "modules/EventModules.h" 35 #include "modules/EventModules.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class MIDIMessageEventInit; 39 class MIDIMessageEventInit;
40 class ExecutionContext;
40 41
41 class MIDIMessageEvent final : public Event { 42 class MIDIMessageEvent final : public Event {
42 DEFINE_WRAPPERTYPEINFO(); 43 DEFINE_WRAPPERTYPEINFO();
43 public: 44 public:
44 static MIDIMessageEvent* create() 45 static MIDIMessageEvent* create()
45 { 46 {
46 return new MIDIMessageEvent(); 47 return new MIDIMessageEvent();
47 } 48 }
48 49
49 static MIDIMessageEvent* create(double receivedTime, DOMUint8Array* data) 50 static MIDIMessageEvent* create(double receivedTime, DOMUint8Array* data)
50 { 51 {
51 return new MIDIMessageEvent(receivedTime, data); 52 return new MIDIMessageEvent(receivedTime, data);
52 } 53 }
53 54
54 static MIDIMessageEvent* create(const AtomicString& type, const MIDIMessageE ventInit& initializer) 55 static MIDIMessageEvent* create(ExecutionContext* context, const AtomicStrin g& type, const MIDIMessageEventInit& initializer)
55 { 56 {
56 return new MIDIMessageEvent(type, initializer); 57 return new MIDIMessageEvent(context, type, initializer);
57 } 58 }
58 59
59 double receivedTime() { return m_receivedTime; } 60 double receivedTime() { return m_receivedTime; }
60 DOMUint8Array* data() { return m_data; } 61 DOMUint8Array* data() { return m_data; }
61 62
62 const AtomicString& interfaceName() const override { return EventNames::MIDI MessageEvent; } 63 const AtomicString& interfaceName() const override { return EventNames::MIDI MessageEvent; }
63 64
64 DEFINE_INLINE_VIRTUAL_TRACE() 65 DEFINE_INLINE_VIRTUAL_TRACE()
65 { 66 {
66 visitor->trace(m_data); 67 visitor->trace(m_data);
67 Event::trace(visitor); 68 Event::trace(visitor);
68 } 69 }
69 70
70 private: 71 private:
71 MIDIMessageEvent() 72 MIDIMessageEvent()
72 : m_receivedTime(0) { } 73 : m_receivedTime(0) { }
73 74
74 MIDIMessageEvent(double receivedTime, DOMUint8Array* data) 75 MIDIMessageEvent(double receivedTime, DOMUint8Array* data)
75 : Event(EventTypeNames::midimessage, true, false) 76 : Event(EventTypeNames::midimessage, true, false)
76 , m_receivedTime(receivedTime) 77 , m_receivedTime(receivedTime)
77 , m_data(data) { } 78 , m_data(data) { }
78 79
79 MIDIMessageEvent(const AtomicString& type, const MIDIMessageEventInit& initi alizer); 80 MIDIMessageEvent(ExecutionContext*, const AtomicString& type, const MIDIMess ageEventInit& initializer);
80 81
81 double m_receivedTime; 82 double m_receivedTime;
82 Member<DOMUint8Array> m_data; 83 Member<DOMUint8Array> m_data;
83 }; 84 };
84 85
85 } // namespace blink 86 } // namespace blink
86 87
87 #endif // MIDIMessageEvent_h 88 #endif // MIDIMessageEvent_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698