| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "platform/AsyncMethodRunner.h" | 46 #include "platform/AsyncMethodRunner.h" |
| 47 #include <v8.h> | 47 #include <v8.h> |
| 48 | 48 |
| 49 namespace blink { | 49 namespace blink { |
| 50 | 50 |
| 51 MIDIAccess::MIDIAccess(PassOwnPtr<MIDIAccessor> accessor, bool sysexEnabled, con
st Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* execu
tionContext) | 51 MIDIAccess::MIDIAccess(PassOwnPtr<MIDIAccessor> accessor, bool sysexEnabled, con
st Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* execu
tionContext) |
| 52 : ActiveDOMObject(executionContext) | 52 : ActiveDOMObject(executionContext) |
| 53 , m_accessor(accessor) | 53 , m_accessor(accessor) |
| 54 , m_sysexEnabled(sysexEnabled) | 54 , m_sysexEnabled(sysexEnabled) |
| 55 { | 55 { |
| 56 ScriptWrappable::init(this); | |
| 57 m_accessor->setClient(this); | 56 m_accessor->setClient(this); |
| 58 for (size_t i = 0; i < ports.size(); ++i) { | 57 for (size_t i = 0; i < ports.size(); ++i) { |
| 59 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; | 58 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; |
| 60 if (port.type == MIDIPort::MIDIPortTypeInput) { | 59 if (port.type == MIDIPort::MIDIPortTypeInput) { |
| 61 m_inputs.append(MIDIInput::create(this, port.id, port.manufacturer,
port.name, port.version)); | 60 m_inputs.append(MIDIInput::create(this, port.id, port.manufacturer,
port.name, port.version)); |
| 62 } else { | 61 } else { |
| 63 m_outputs.append(MIDIOutput::create(this, m_outputs.size(), port.id,
port.manufacturer, port.name, port.version)); | 62 m_outputs.append(MIDIOutput::create(this, m_outputs.size(), port.id,
port.manufacturer, port.name, port.version)); |
| 64 } | 63 } |
| 65 } | 64 } |
| 66 } | 65 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 154 } |
| 156 | 155 |
| 157 void MIDIAccess::trace(Visitor* visitor) | 156 void MIDIAccess::trace(Visitor* visitor) |
| 158 { | 157 { |
| 159 visitor->trace(m_inputs); | 158 visitor->trace(m_inputs); |
| 160 visitor->trace(m_outputs); | 159 visitor->trace(m_outputs); |
| 161 EventTargetWithInlineData::trace(visitor); | 160 EventTargetWithInlineData::trace(visitor); |
| 162 } | 161 } |
| 163 | 162 |
| 164 } // namespace blink | 163 } // namespace blink |
| OLD | NEW |