Index: third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp |
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp |
index 7de4f5131b364bb3453e0b5a9beff5be125aad36..3b8cc2d9e526be7d94f55675fe521b05795cc36d 100644 |
--- a/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp |
+++ b/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.cpp |
@@ -4,18 +4,37 @@ |
#include "modules/webmidi/MIDIMessageEvent.h" |
+#include "core/dom/ExecutionContext.h" |
+#include "core/inspector/ConsoleMessage.h" |
#include "modules/webmidi/MIDIMessageEventInit.h" |
namespace blink { |
-MIDIMessageEvent::MIDIMessageEvent(const AtomicString& type, const MIDIMessageEventInit& initializer) |
+namespace { |
+ |
+void showDeprecateMessage(ScriptState* state) |
+{ |
+ state->getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, InfoMessageLevel, "receivedTime is deprecated and will be removed from MIDIMessageEvent soon. Use timeStamp instead.")); |
kouhei (in TOK)
2016/06/29 05:25:32
Please use Deprecation.h infra
https://cs.chromium
Takashi Toyoshima
2016/06/30 10:12:18
Done.
|
+} |
+ |
+} // namespace |
+ |
+MIDIMessageEvent::MIDIMessageEvent(ScriptState* state, const AtomicString& type, const MIDIMessageEventInit& initializer) |
: Event(type, initializer) |
, m_receivedTime(0.0) |
{ |
- if (initializer.hasReceivedTime()) |
+ if (initializer.hasReceivedTime()) { |
+ showDeprecateMessage(state); |
m_receivedTime = initializer.receivedTime(); |
+ } |
if (initializer.hasData()) |
m_data = initializer.data(); |
} |
+double MIDIMessageEvent::receivedTime(ScriptState* state) |
+{ |
+ showDeprecateMessage(state); |
+ return m_receivedTime; |
+} |
+ |
} // namespace blink |