Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: Source/modules/webaudio/AudioNode.cpp

Issue 467683002: AudioNodeOutput::disconnectAll() should be called in AudioNode::dispose() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698