| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 // have at least one output channel, so there's no reason other nodes should | 521 // have at least one output channel, so there's no reason other nodes should |
| 522 // ever call this function. | 522 // ever call this function. |
| 523 DCHECK(0) << "numberOfOutputChannels() not valid for node type " | 523 DCHECK(0) << "numberOfOutputChannels() not valid for node type " |
| 524 << getNodeType(); | 524 << getNodeType(); |
| 525 return 1; | 525 return 1; |
| 526 } | 526 } |
| 527 // ---------------------------------------------------------------- | 527 // ---------------------------------------------------------------- |
| 528 | 528 |
| 529 AudioNode::AudioNode(BaseAudioContext& context) | 529 AudioNode::AudioNode(BaseAudioContext& context) |
| 530 : m_context(context), m_handler(nullptr) { | 530 : m_context(context), m_handler(nullptr) { |
| 531 ThreadState::current()->registerPreFinalizer(this); | |
| 532 } | 531 } |
| 533 | 532 |
| 534 void AudioNode::dispose() { | 533 void AudioNode::dispose() { |
| 535 DCHECK(isMainThread()); | 534 DCHECK(isMainThread()); |
| 536 #if DEBUG_AUDIONODE_REFERENCES | 535 #if DEBUG_AUDIONODE_REFERENCES |
| 537 fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::dispose %16p\n", context(), | 536 fprintf(stderr, "[%16p]: %16p: %2d: AudioNode::dispose %16p\n", context(), |
| 538 this, handler().getNodeType(), m_handler.get()); | 537 this, handler().getNodeType(), m_handler.get()); |
| 539 #endif | 538 #endif |
| 540 BaseAudioContext::AutoLocker locker(context()); | 539 BaseAudioContext::AutoLocker locker(context()); |
| 541 handler().dispose(); | 540 handler().dispose(); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 } | 943 } |
| 945 | 944 |
| 946 void AudioNode::didAddOutput(unsigned numberOfOutputs) { | 945 void AudioNode::didAddOutput(unsigned numberOfOutputs) { |
| 947 m_connectedNodes.append(nullptr); | 946 m_connectedNodes.append(nullptr); |
| 948 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size()); | 947 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size()); |
| 949 m_connectedParams.append(nullptr); | 948 m_connectedParams.append(nullptr); |
| 950 DCHECK_EQ(numberOfOutputs, m_connectedParams.size()); | 949 DCHECK_EQ(numberOfOutputs, m_connectedParams.size()); |
| 951 } | 950 } |
| 952 | 951 |
| 953 } // namespace blink | 952 } // namespace blink |
| OLD | NEW |