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

Unified Diff: Source/bindings/v8/Dictionary.cpp

Issue 14358032: Web MIDI: implement MIDIConnectionEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: (rebase) Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/core/dom/EventNames.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/Dictionary.cpp
diff --git a/Source/bindings/v8/Dictionary.cpp b/Source/bindings/v8/Dictionary.cpp
index b4cde415c32ba171a1639b1c2f6716dcca3bd696..e42a5687b921d05e3006b909ddd64a449d8a5504 100644
--- a/Source/bindings/v8/Dictionary.cpp
+++ b/Source/bindings/v8/Dictionary.cpp
@@ -31,6 +31,7 @@
#include "V8DOMWindow.h"
#include "V8EventTarget.h"
#include "V8IDBKeyRange.h"
+#include "V8MIDIPort.h"
#include "V8SpeechRecognitionError.h"
#include "V8SpeechRecognitionResult.h"
#include "V8SpeechRecognitionResultList.h"
@@ -331,6 +332,18 @@ bool Dictionary::get(const String& key, RefPtr<Uint8Array>& value) const
return true;
}
+bool Dictionary::get(const String& key, RefPtr<MIDIPort>& value) const
+{
+ v8::Local<v8::Value> v8Value;
+ if (!getKey(key, v8Value))
+ return false;
+
+ value = 0;
+ if (V8MIDIPort::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
+ value = V8MIDIPort::toNative(v8::Handle<v8::Object>::Cast(v8Value));
+ return true;
+}
+
#if ENABLE(ENCRYPTED_MEDIA)
bool Dictionary::get(const String& key, RefPtr<MediaKeyError>& value) const
{
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/core/dom/EventNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698