Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MIDIOutputMap_h | |
| 6 #define MIDIOutputMap_h | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | |
| 9 #include "bindings/core/v8/V8Binding.h" | |
| 10 #include "modules/webmidi/MIDIOutput.h" | |
| 11 #include "modules/webmidi/MIDIPortMap.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 class MIDIOutputMap : public MIDIPortMap<MIDIOutput>, public ScriptWrappable { | |
| 16 public: | |
| 17 MIDIOutputMap(HeapHashMap<String, Member<MIDIOutput> > map) | |
| 18 : MIDIPortMap<MIDIOutput>(map) { ScriptWrappable::init(this); } | |
| 19 | |
| 20 ScriptValue getPublic(ScriptState* scriptState, const String& id) | |
| 21 { | |
| 22 MIDIOutput* result = get(id); | |
| 23 if (result) | |
| 24 return ScriptValue(scriptState, V8ValueTraits<MIDIOutput*>::toV8Valu e(result, scriptState->context()->Global(), scriptState->isolate())); | |
|
haraken
2014/08/29 06:19:42
Why can't we just call toV8() instead of V8ValueTr
yhirano
2014/08/29 07:29:13
That's because we don't include V8MIDIOutput.h.
I
yhirano
2014/08/29 07:31:50
Sorry for the poor English. I meant "Because we do
haraken
2014/08/31 07:18:57
It's confusing to have multiple ways to convert a
yhirano
2014/09/01 02:22:10
OK, I understand including bindings/{core, modules
haraken
2014/09/01 07:17:47
That's technically possible, but in what cases do
yhirano
2014/09/01 07:31:35
I am reviewing a CL doing it and I want to underst
| |
| 25 return ScriptValue(scriptState, v8::Undefined(scriptState->isolate())); | |
| 26 } | |
| 27 }; | |
| 28 | |
| 29 } // namespace blink | |
| 30 | |
| 31 #endif | |
| OLD | NEW |