| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 return getAttributeEventListener(EventTypeNames::statechange); | 95 return getAttributeEventListener(EventTypeNames::statechange); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void MIDIAccess::setOnstatechange(EventListener* listener) { | 98 void MIDIAccess::setOnstatechange(EventListener* listener) { |
| 99 m_hasPendingActivity = listener; | 99 m_hasPendingActivity = listener; |
| 100 setAttributeEventListener(EventTypeNames::statechange, listener); | 100 setAttributeEventListener(EventTypeNames::statechange, listener); |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool MIDIAccess::hasPendingActivity() const { | 103 bool MIDIAccess::hasPendingActivity() const { |
| 104 return m_hasPendingActivity && getExecutionContext() && | 104 return m_hasPendingActivity && getExecutionContext() && |
| 105 !getExecutionContext()->activeDOMObjectsAreStopped(); | 105 !getExecutionContext()->isContextDestroyed(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 MIDIInputMap* MIDIAccess::inputs() const { | 108 MIDIInputMap* MIDIAccess::inputs() const { |
| 109 HeapVector<Member<MIDIInput>> inputs; | 109 HeapVector<Member<MIDIInput>> inputs; |
| 110 HashSet<String> ids; | 110 HashSet<String> ids; |
| 111 for (size_t i = 0; i < m_inputs.size(); ++i) { | 111 for (size_t i = 0; i < m_inputs.size(); ++i) { |
| 112 MIDIInput* input = m_inputs[i]; | 112 MIDIInput* input = m_inputs[i]; |
| 113 if (input->getState() != PortState::DISCONNECTED) { | 113 if (input->getState() != PortState::DISCONNECTED) { |
| 114 inputs.append(input); | 114 inputs.append(input); |
| 115 ids.add(input->id()); | 115 ids.add(input->id()); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 227 } |
| 228 | 228 |
| 229 DEFINE_TRACE(MIDIAccess) { | 229 DEFINE_TRACE(MIDIAccess) { |
| 230 visitor->trace(m_inputs); | 230 visitor->trace(m_inputs); |
| 231 visitor->trace(m_outputs); | 231 visitor->trace(m_outputs); |
| 232 EventTargetWithInlineData::trace(visitor); | 232 EventTargetWithInlineData::trace(visitor); |
| 233 ActiveDOMObject::trace(visitor); | 233 ActiveDOMObject::trace(visitor); |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace blink | 236 } // namespace blink |
| OLD | NEW |