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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 void MIDIAccess::setOnstatechange(EventListener* listener) | 83 void MIDIAccess::setOnstatechange(EventListener* listener) |
84 { | 84 { |
85 m_hasPendingActivity = listener; | 85 m_hasPendingActivity = listener; |
86 setAttributeEventListener(EventTypeNames::statechange, listener); | 86 setAttributeEventListener(EventTypeNames::statechange, listener); |
87 } | 87 } |
88 | 88 |
89 bool MIDIAccess::hasPendingActivity() const | 89 bool MIDIAccess::hasPendingActivity() const |
90 { | 90 { |
91 return m_hasPendingActivity && !getExecutionContext()->activeDOMObjectsAreSt
opped(); | 91 return m_hasPendingActivity && getExecutionContext() && !getExecutionContext
()->activeDOMObjectsAreStopped(); |
92 } | 92 } |
93 | 93 |
94 MIDIInputMap* MIDIAccess::inputs() const | 94 MIDIInputMap* MIDIAccess::inputs() const |
95 { | 95 { |
96 HeapVector<Member<MIDIInput>> inputs; | 96 HeapVector<Member<MIDIInput>> inputs; |
97 HashSet<String> ids; | 97 HashSet<String> ids; |
98 for (size_t i = 0; i < m_inputs.size(); ++i) { | 98 for (size_t i = 0; i < m_inputs.size(); ++i) { |
99 MIDIInput* input = m_inputs[i]; | 99 MIDIInput* input = m_inputs[i]; |
100 if (input->getState() != PortState::MIDIPortStateDisconnected) { | 100 if (input->getState() != PortState::MIDIPortStateDisconnected) { |
101 inputs.append(input); | 101 inputs.append(input); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 DEFINE_TRACE(MIDIAccess) | 209 DEFINE_TRACE(MIDIAccess) |
210 { | 210 { |
211 visitor->trace(m_inputs); | 211 visitor->trace(m_inputs); |
212 visitor->trace(m_outputs); | 212 visitor->trace(m_outputs); |
213 EventTargetWithInlineData::trace(visitor); | 213 EventTargetWithInlineData::trace(visitor); |
214 ActiveDOMObject::trace(visitor); | 214 ActiveDOMObject::trace(visitor); |
215 } | 215 } |
216 | 216 |
217 } // namespace blink | 217 } // namespace blink |
OLD | NEW |