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

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

Issue 14358032: Web MIDI: implement MIDIConnectionEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: layout test 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
Index: Source/bindings/v8/Dictionary.cpp
diff --git a/Source/bindings/v8/Dictionary.cpp b/Source/bindings/v8/Dictionary.cpp
index b4cde415c32ba171a1639b1c2f6716dcca3bd696..7e0c890aea991d685d1c5681e58ab80312cc9086 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 (V8MediaKeyError::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
haraken 2013/04/25 06:33:00 I don't think this works. V8MediaKeyError => V8MID
Takashi Toyoshima 2013/04/25 07:20:27 Oops. Sorry, I missed to rename it.
+ 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
{

Powered by Google App Engine
This is Rietveld 408576698