Changeset 146033 in webkit
- Timestamp:
- Mar 17, 2013 10:51:43 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r146032 r146033 1 2013-03-17 Russell McClellan <russell.mcclellan@gmail.com> 2 3 ScriptProcessorNode is garbage collected while still active if unreachable 4 https://bugs.webkit.org/show_bug.cgi?id=112521 5 6 Reviewed by Kentaro Hara. 7 8 * webaudio/javascriptaudionode-expected.txt: 9 * webaudio/javascriptaudionode.html: 10 1 11 2013-03-17 Kunihiko Sakamoto <ksakamoto@chromium.org> 2 12 -
trunk/LayoutTests/webaudio/javascriptaudionode-expected.txt
r132125 r146033 17 17 PASS Successfully created ScriptProcessorNode with bufferSize = 16384. 18 18 PASS onaudioprocess was called with correct data. 19 PASS audioprocessWasCalled is true 19 20 PASS successfullyParsed is true 20 21 -
trunk/LayoutTests/webaudio/javascriptaudionode.html
r137516 r146033 76 76 } 77 77 78 function performGCTest() { 79 // now test that ScriptProcessorNodes are not garbage collected 80 // if they are unreachable but connected to a running audio context. 81 var context = new webkitOfflineAudioContext(2, renderLengthInFrames, sampleRate); 82 83 window.audioprocessWasCalled = false; 84 85 context.oncomplete = function () { 86 shouldBeTrue('audioprocessWasCalled'); 87 finishJSTest(); 88 }; 89 90 // add the scriptprocessor and callback in a nested function to be sure they'll 91 // be unreachable. 92 (function() { 93 var jsnode = context.createScriptProcessor(bufferSize, 0, 1); 94 jsnode.onaudioprocess = function() { 95 audioprocessWasCalled = true; 96 }; 97 jsnode.connect(context.destination); 98 })(); 99 gc(); 100 context.startRendering(); 101 } 102 78 103 function runTest() { 79 104 if (window.testRunner) { … … 149 174 150 175 bufferSource.noteOn(0); 151 context.oncomplete = finishJSTest;176 context.oncomplete = performGCTest; 152 177 context.startRendering(); 178 153 179 } 154 180 -
trunk/Source/WebCore/ChangeLog
r146032 r146033 1 2013-03-17 Russell McClellan <russell.mcclellan@gmail.com> 2 3 ScriptProcessorNode is garbage collected while still active if unreachable 4 https://bugs.webkit.org/show_bug.cgi?id=112521 5 6 Reviewed by Kentaro Hara. 7 8 Fix for issue where ScriptProcessorNodes (and AudioNode js wrappers generally) 9 would be garbage collected before their time. Made AudioNode an ActiveDOMElement 10 marked pending if there are any open audio connections. 11 12 Test: webaudio/javascriptaudionode.html 13 14 * Modules/webaudio/AudioNode.cpp: 15 (WebCore::AudioNode::AudioNode): 16 (WebCore::AudioNode::hasPendingActivity): it's pending (and thus not GCed) 17 if it has open audio connections. 18 * Modules/webaudio/AudioNode.h: AudioNode is now an ActiveDOMElement 19 * Modules/webaudio/AudioScheduledSourceNode.h: added a using declaration 20 to avoid function name hiding. 21 * Modules/webaudio/ScriptProcessorNode.idl: AudioNode is an ActiveDOMElement 22 1 23 2013-03-17 Kunihiko Sakamoto <ksakamoto@chromium.org> 2 24 -
trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp
r144235 r146033 46 46 47 47 AudioNode::AudioNode(AudioContext* context, float sampleRate) 48 : m_isInitialized(false) 48 : ActiveDOMObject(context->scriptExecutionContext(), this) 49 , m_isInitialized(false) 49 50 , m_nodeType(NodeTypeUnknown) 50 51 , m_context(context) … … 76 77 } 77 78 79 bool AudioNode::hasPendingActivity() const 80 { 81 return !m_isDisabled && (m_connectionRefCount > 0); 82 } 83 78 84 void AudioNode::initialize() 79 85 { -
trunk/Source/WebCore/Modules/webaudio/AudioNode.h
r144720 r146033 26 26 #define AudioNode_h 27 27 28 #include "ActiveDOMObject.h" 28 29 #include "AudioBus.h" 29 30 #include <wtf/Forward.h> … … 50 51 // Most processing nodes such as filters will have one input and one output, although multiple inputs and outputs are possible. 51 52 52 class AudioNode {53 class AudioNode : public ActiveDOMObject { 53 54 public: 54 55 enum { ProcessingSizeInFrames = 128 }; … … 111 112 // Called from context's audio thread. 112 113 virtual void reset() = 0; 114 115 // ActiveDOMObject interface 116 virtual bool hasPendingActivity() const OVERRIDE; 113 117 114 118 // No significant resources should be allocated until initialize() is called. -
trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.h
r129260 r146033 57 57 AudioScheduledSourceNode(AudioContext*, float sampleRate); 58 58 59 // unhide the ActiveDOMObject signature 60 using AudioSourceNode::stop; 61 59 62 // Scheduling. 60 63 void start(double when); -
trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.idl
r145922 r146033 28 28 JSGenerateToJSObject, 29 29 JSGenerateToNativeObject, 30 ActiveDOMObject, 30 31 EventTarget 31 32 ] interface ScriptProcessorNode : AudioNode {
Note: See TracChangeset
for help on using the changeset viewer.