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

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

Issue 2489033005: Web MIDI: deprecate MIDIMessageEvent.receivedTime (Closed)
Patch Set: expectation for virtual Created 4 years, 1 month 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;
41 40
42 class MIDIMessageEvent final : public Event { 41 class MIDIMessageEvent final : public Event {
43 DEFINE_WRAPPERTYPEINFO(); 42 DEFINE_WRAPPERTYPEINFO();
44 43
45 public: 44 public:
46 static MIDIMessageEvent* create(double receivedTime, DOMUint8Array* data) { 45 static MIDIMessageEvent* create(double timeStamp, DOMUint8Array* data) {
47 return new MIDIMessageEvent(receivedTime, data); 46 return new MIDIMessageEvent(timeStamp, data);
48 } 47 }
49 48
50 static MIDIMessageEvent* create(ExecutionContext* context, 49 static MIDIMessageEvent* create(const AtomicString& type,
51 const AtomicString& type,
52 const MIDIMessageEventInit& initializer) { 50 const MIDIMessageEventInit& initializer) {
53 return new MIDIMessageEvent(context, type, initializer); 51 return new MIDIMessageEvent(type, initializer);
54 } 52 }
55 53
56 double receivedTime() { return m_receivedTime; }
57 DOMUint8Array* data() { return m_data; } 54 DOMUint8Array* data() { return m_data; }
58 55
59 const AtomicString& interfaceName() const override { 56 const AtomicString& interfaceName() const override {
60 return EventNames::MIDIMessageEvent; 57 return EventNames::MIDIMessageEvent;
61 } 58 }
62 59
63 DEFINE_INLINE_VIRTUAL_TRACE() { 60 DEFINE_INLINE_VIRTUAL_TRACE() {
64 visitor->trace(m_data); 61 visitor->trace(m_data);
65 Event::trace(visitor); 62 Event::trace(visitor);
66 } 63 }
67 64
68 private: 65 private:
69 MIDIMessageEvent(double receivedTime, DOMUint8Array* data) 66 MIDIMessageEvent(double timeStamp, DOMUint8Array* data)
70 : Event(EventTypeNames::midimessage, true, false), 67 : Event(EventTypeNames::midimessage, true, false, timeStamp),
71 m_receivedTime(receivedTime),
72 m_data(data) {} 68 m_data(data) {}
73 69
74 MIDIMessageEvent(ExecutionContext*, 70 MIDIMessageEvent(const AtomicString& type,
75 const AtomicString& type,
76 const MIDIMessageEventInit& initializer); 71 const MIDIMessageEventInit& initializer);
77 72
78 double m_receivedTime;
79 Member<DOMUint8Array> m_data; 73 Member<DOMUint8Array> m_data;
80 }; 74 };
81 75
82 } // namespace blink 76 } // namespace blink
83 77
84 #endif // MIDIMessageEvent_h 78 #endif // MIDIMessageEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698