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

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

Issue 940963005: Revert of WebAudio: Fix AudioNode leak in a case that AudioNode is not disconnected from the ... (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void AudioNode::dispose() 98 void AudioNode::dispose()
99 { 99 {
100 ASSERT(isMainThread()); 100 ASSERT(isMainThread());
101 ASSERT(context()->isGraphOwner()); 101 ASSERT(context()->isGraphOwner());
102 102
103 context()->removeChangedChannelCountMode(this); 103 context()->removeChangedChannelCountMode(this);
104 context()->removeAutomaticPullNode(this); 104 context()->removeAutomaticPullNode(this);
105 context()->disposeOutputs(*this); 105 context()->disposeOutputs(*this);
106 for (unsigned i = 0; i < m_outputs.size(); ++i) 106 for (unsigned i = 0; i < m_outputs.size(); ++i)
107 output(i)->disconnectAll(); 107 output(i)->disconnectAll();
108
109 if (context()->contextState() != AudioContext::Running)
110 return;
111 ThreadState::current()->markAsZombie(this);
112 context()->setLastZombie(this);
113 } 108 }
114 109
115 String AudioNode::nodeTypeName() const 110 String AudioNode::nodeTypeName() const
116 { 111 {
117 switch (m_nodeType) { 112 switch (m_nodeType) {
118 case NodeTypeDestination: 113 case NodeTypeDestination:
119 return "AudioDestinationNode"; 114 return "AudioDestinationNode";
120 case NodeTypeOscillator: 115 case NodeTypeOscillator:
121 return "OscillatorNode"; 116 return "OscillatorNode";
122 case NodeTypeAudioBufferSource: 117 case NodeTypeAudioBufferSource:
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 603
609 void AudioNode::updateChannelCountMode() 604 void AudioNode::updateChannelCountMode()
610 { 605 {
611 m_channelCountMode = m_newChannelCountMode; 606 m_channelCountMode = m_newChannelCountMode;
612 updateChannelsForInputs(); 607 updateChannelsForInputs();
613 } 608 }
614 609
615 } // namespace blink 610 } // namespace blink
616 611
617 #endif // ENABLE(WEB_AUDIO) 612 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioContext.cpp ('k') | Source/modules/webaudio/AudioSummingJunction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698