| 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 EventListener* MIDIAccess::onstatechange() { | 81 EventListener* MIDIAccess::onstatechange() { |
| 82 return getAttributeEventListener(EventTypeNames::statechange); | 82 return getAttributeEventListener(EventTypeNames::statechange); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void MIDIAccess::setOnstatechange(EventListener* listener) { | 85 void MIDIAccess::setOnstatechange(EventListener* listener) { |
| 86 m_hasPendingActivity = listener; | 86 m_hasPendingActivity = listener; |
| 87 setAttributeEventListener(EventTypeNames::statechange, listener); | 87 setAttributeEventListener(EventTypeNames::statechange, listener); |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool MIDIAccess::hasPendingActivity() const { | 90 bool MIDIAccess::hasPendingActivity() const { |
| 91 return m_hasPendingActivity && getExecutionContext() && | 91 return m_hasPendingActivity && getExecutionContext(); |
| 92 !getExecutionContext()->activeDOMObjectsAreStopped(); | |
| 93 } | 92 } |
| 94 | 93 |
| 95 MIDIInputMap* MIDIAccess::inputs() const { | 94 MIDIInputMap* MIDIAccess::inputs() const { |
| 96 HeapVector<Member<MIDIInput>> inputs; | 95 HeapVector<Member<MIDIInput>> inputs; |
| 97 HashSet<String> ids; | 96 HashSet<String> ids; |
| 98 for (size_t i = 0; i < m_inputs.size(); ++i) { | 97 for (size_t i = 0; i < m_inputs.size(); ++i) { |
| 99 MIDIInput* input = m_inputs[i]; | 98 MIDIInput* input = m_inputs[i]; |
| 100 if (input->getState() != PortState::MIDIPortStateDisconnected) { | 99 if (input->getState() != PortState::MIDIPortStateDisconnected) { |
| 101 inputs.append(input); | 100 inputs.append(input); |
| 102 ids.add(input->id()); | 101 ids.add(input->id()); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 223 } |
| 225 | 224 |
| 226 DEFINE_TRACE(MIDIAccess) { | 225 DEFINE_TRACE(MIDIAccess) { |
| 227 visitor->trace(m_inputs); | 226 visitor->trace(m_inputs); |
| 228 visitor->trace(m_outputs); | 227 visitor->trace(m_outputs); |
| 229 EventTargetWithInlineData::trace(visitor); | 228 EventTargetWithInlineData::trace(visitor); |
| 230 ActiveDOMObject::trace(visitor); | 229 ActiveDOMObject::trace(visitor); |
| 231 } | 230 } |
| 232 | 231 |
| 233 } // namespace blink | 232 } // namespace blink |
| OLD | NEW |