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 30 matching lines...) Expand all Loading... |
41 #include "modules/webmidi/MIDIOutput.h" | 41 #include "modules/webmidi/MIDIOutput.h" |
42 #include "modules/webmidi/MIDIOutputMap.h" | 42 #include "modules/webmidi/MIDIOutputMap.h" |
43 #include "modules/webmidi/MIDIPort.h" | 43 #include "modules/webmidi/MIDIPort.h" |
44 #include "platform/AsyncMethodRunner.h" | 44 #include "platform/AsyncMethodRunner.h" |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 using PortState = MIDIAccessor::MIDIPortState; | 48 using PortState = MIDIAccessor::MIDIPortState; |
49 | 49 |
50 MIDIAccess::MIDIAccess(PassOwnPtr<MIDIAccessor> accessor, bool sysexEnabled, con
st Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* execu
tionContext) | 50 MIDIAccess::MIDIAccess(PassOwnPtr<MIDIAccessor> accessor, bool sysexEnabled, con
st Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* execu
tionContext) |
51 : ActiveDOMObject(executionContext) | 51 : ActiveScriptWrappable(this) |
| 52 , ActiveDOMObject(executionContext) |
52 , m_accessor(accessor) | 53 , m_accessor(accessor) |
53 , m_sysexEnabled(sysexEnabled) | 54 , m_sysexEnabled(sysexEnabled) |
54 , m_hasPendingActivity(false) | 55 , m_hasPendingActivity(false) |
55 { | 56 { |
56 m_accessor->setClient(this); | 57 m_accessor->setClient(this); |
57 for (size_t i = 0; i < ports.size(); ++i) { | 58 for (size_t i = 0; i < ports.size(); ++i) { |
58 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; | 59 const MIDIAccessInitializer::PortDescriptor& port = ports[i]; |
59 if (port.type == MIDIPort::TypeInput) { | 60 if (port.type == MIDIPort::TypeInput) { |
60 m_inputs.append(MIDIInput::create(this, port.id, port.manufacturer,
port.name, port.version, port.state)); | 61 m_inputs.append(MIDIInput::create(this, port.id, port.manufacturer,
port.name, port.version, port.state)); |
61 } else { | 62 } else { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 202 |
202 DEFINE_TRACE(MIDIAccess) | 203 DEFINE_TRACE(MIDIAccess) |
203 { | 204 { |
204 visitor->trace(m_inputs); | 205 visitor->trace(m_inputs); |
205 visitor->trace(m_outputs); | 206 visitor->trace(m_outputs); |
206 RefCountedGarbageCollectedEventTargetWithInlineData<MIDIAccess>::trace(visit
or); | 207 RefCountedGarbageCollectedEventTargetWithInlineData<MIDIAccess>::trace(visit
or); |
207 ActiveDOMObject::trace(visitor); | 208 ActiveDOMObject::trace(visitor); |
208 } | 209 } |
209 | 210 |
210 } // namespace blink | 211 } // namespace blink |
OLD | NEW |