| Index: Source/modules/webmidi/MIDIInputMap.cpp
|
| diff --git a/Source/modules/webmidi/MIDIInputMap.cpp b/Source/modules/webmidi/MIDIInputMap.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d5c80d853ec6f38017ed02d7be4ec49d0ae27ef3
|
| --- /dev/null
|
| +++ b/Source/modules/webmidi/MIDIInputMap.cpp
|
| @@ -0,0 +1,28 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "config.h"
|
| +#include "modules/webmidi/MIDIInputMap.h"
|
| +
|
| +#include "bindings/core/v8/ScriptState.h"
|
| +#include "bindings/modules/v8/V8MIDIInput.h"
|
| +
|
| +namespace blink {
|
| +
|
| +MIDIInputMap::MIDIInputMap(const HeapHashMap<String, Member<MIDIInput> >map)
|
| + : MIDIPortMap<MIDIInput>(map)
|
| +{
|
| + ScriptWrappable::init(this);
|
| +}
|
| +
|
| +ScriptValue MIDIInputMap::getForBinding(ScriptState* scriptState, const String& id)
|
| +{
|
| + MIDIInput* result = get(id);
|
| + if (result)
|
| + return ScriptValue(scriptState, toV8(result, scriptState->context()->Global(), scriptState->isolate()));
|
| + return ScriptValue(scriptState, v8::Undefined(scriptState->isolate()));
|
| +}
|
| +
|
| +} // namespace blink
|
| +
|
|
|