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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 { | 103 { |
104 m_isInitialized = false; | 104 m_isInitialized = false; |
105 } | 105 } |
106 | 106 |
107 void AudioNode::dispose() | 107 void AudioNode::dispose() |
108 { | 108 { |
109 ASSERT(isMainThread()); | 109 ASSERT(isMainThread()); |
110 ASSERT(context()->isGraphOwner()); | 110 ASSERT(context()->isGraphOwner()); |
111 | 111 |
112 context()->removeAutomaticPullNode(this); | 112 context()->removeAutomaticPullNode(this); |
113 #if ENABLE(OILPAN) | |
114 for (unsigned i = 0; i < m_outputs.size(); ++i) | 113 for (unsigned i = 0; i < m_outputs.size(); ++i) |
115 output(i)->disconnectAll(); | 114 output(i)->disconnectAll(); |
116 #endif | |
117 context()->unmarkDirtyNode(*this); | 115 context()->unmarkDirtyNode(*this); |
118 #if ENABLE(ASSERT) | 116 #if ENABLE(ASSERT) |
119 m_didCallDispose = true; | 117 m_didCallDispose = true; |
120 #endif | 118 #endif |
121 } | 119 } |
122 | 120 |
123 String AudioNode::nodeTypeName() const | 121 String AudioNode::nodeTypeName() const |
124 { | 122 { |
125 switch (m_nodeType) { | 123 switch (m_nodeType) { |
126 case NodeTypeDestination: | 124 case NodeTypeDestination: |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 ASSERT(context()->isGraphOwner()); | 599 ASSERT(context()->isGraphOwner()); |
602 | 600 |
603 ASSERT(m_normalRefCount > 0); | 601 ASSERT(m_normalRefCount > 0); |
604 atomicDecrement(&m_normalRefCount); | 602 atomicDecrement(&m_normalRefCount); |
605 | 603 |
606 #if DEBUG_AUDIONODE_REFERENCES | 604 #if DEBUG_AUDIONODE_REFERENCES |
607 fprintf(stderr, "%p: %d: AudioNode::deref() %d %d\n", this, nodeType(), m_no
rmalRefCount, m_connectionRefCount); | 605 fprintf(stderr, "%p: %d: AudioNode::deref() %d %d\n", this, nodeType(), m_no
rmalRefCount, m_connectionRefCount); |
608 #endif | 606 #endif |
609 | 607 |
610 if (!m_normalRefCount && !m_isMarkedForDeletion) { | 608 if (!m_normalRefCount && !m_isMarkedForDeletion) { |
611 // All references are gone - we need to go away. | |
612 for (unsigned i = 0; i < m_outputs.size(); ++i) | |
613 output(i)->disconnectAll(); // This will deref() nodes we're connect
ed to. | |
614 | |
615 // Mark for deletion at end of each render quantum or when context shuts | 609 // Mark for deletion at end of each render quantum or when context shuts |
616 // down. | 610 // down. |
617 context()->markForDeletion(this); | 611 context()->markForDeletion(this); |
618 m_isMarkedForDeletion = true; | 612 m_isMarkedForDeletion = true; |
619 } | 613 } |
620 } | 614 } |
621 #endif | 615 #endif |
622 | 616 |
623 #if DEBUG_AUDIONODE_REFERENCES | 617 #if DEBUG_AUDIONODE_REFERENCES |
624 | 618 |
(...skipping 19 matching lines...) Expand all Loading... |
644 { | 638 { |
645 visitor->trace(m_context); | 639 visitor->trace(m_context); |
646 visitor->trace(m_inputs); | 640 visitor->trace(m_inputs); |
647 visitor->trace(m_outputs); | 641 visitor->trace(m_outputs); |
648 EventTargetWithInlineData::trace(visitor); | 642 EventTargetWithInlineData::trace(visitor); |
649 } | 643 } |
650 | 644 |
651 } // namespace blink | 645 } // namespace blink |
652 | 646 |
653 #endif // ENABLE(WEB_AUDIO) | 647 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |