| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // there's no reason other nodes should ever call this function. | 511 // there's no reason other nodes should ever call this function. |
| 512 ASSERT_WITH_MESSAGE(1, "numberOfOutputChannels() not valid for node type %d"
, nodeType()); | 512 ASSERT_WITH_MESSAGE(1, "numberOfOutputChannels() not valid for node type %d"
, nodeType()); |
| 513 return 1; | 513 return 1; |
| 514 } | 514 } |
| 515 // ---------------------------------------------------------------- | 515 // ---------------------------------------------------------------- |
| 516 | 516 |
| 517 AudioNode::AudioNode(AudioContext& context) | 517 AudioNode::AudioNode(AudioContext& context) |
| 518 : m_context(context) | 518 : m_context(context) |
| 519 , m_handler(nullptr) | 519 , m_handler(nullptr) |
| 520 { | 520 { |
| 521 ThreadState::current()->registerPreFinalizer(*this); | 521 ThreadState::current()->registerPreFinalizer(this); |
| 522 } | 522 } |
| 523 | 523 |
| 524 void AudioNode::dispose() | 524 void AudioNode::dispose() |
| 525 { | 525 { |
| 526 ASSERT(isMainThread()); | 526 ASSERT(isMainThread()); |
| 527 AudioContext::AutoLocker locker(context()); | 527 AudioContext::AutoLocker locker(context()); |
| 528 handler().dispose(); | 528 handler().dispose(); |
| 529 if (context()->contextState() == AudioContext::Running) | 529 if (context()->contextState() == AudioContext::Running) |
| 530 context()->deferredTaskHandler().addRenderingOrphanHandler(m_handler.rel
ease()); | 530 context()->deferredTaskHandler().addRenderingOrphanHandler(m_handler.rel
ease()); |
| 531 } | 531 } |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 { | 930 { |
| 931 m_connectedNodes.append(nullptr); | 931 m_connectedNodes.append(nullptr); |
| 932 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size()); | 932 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedNodes.size()); |
| 933 m_connectedParams.append(nullptr); | 933 m_connectedParams.append(nullptr); |
| 934 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size()); | 934 ASSERT_UNUSED(numberOfOutputs, numberOfOutputs == m_connectedParams.size()); |
| 935 } | 935 } |
| 936 | 936 |
| 937 } // namespace blink | 937 } // namespace blink |
| 938 | 938 |
| 939 #endif // ENABLE(WEB_AUDIO) | 939 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |