From 35d754a1cb2126e1f8a82b8260c0d8beec73cc93 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Thu, 19 Jan 2012 04:02:28 +0000 Subject: [PATCH] Remove some unused code in AudioContext https://bugs.webkit.org/show_bug.cgi?id=76506 Patch by Raymond Liu on 2012-01-18 Reviewed by Kenneth Russell. No new tests required. * webaudio/AudioContext.cpp: (WebCore::AudioContext::constructCommon): (WebCore::AudioContext::uninitialize): * webaudio/AudioContext.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105375 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 14 ++++++++++++++ Source/WebCore/webaudio/AudioContext.cpp | 14 -------------- Source/WebCore/webaudio/AudioContext.h | 12 ------------ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index e26def7..292ec01 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,5 +1,19 @@ 2012-01-18 Raymond Liu + Remove some unused code in AudioContext + https://bugs.webkit.org/show_bug.cgi?id=76506 + + Reviewed by Kenneth Russell. + + No new tests required. + + * webaudio/AudioContext.cpp: + (WebCore::AudioContext::constructCommon): + (WebCore::AudioContext::uninitialize): + * webaudio/AudioContext.h: + +2012-01-18 Raymond Liu + Only create AudioBus with required number of channels for AudioNodeOutput https://bugs.webkit.org/show_bug.cgi?id=76417 diff --git a/Source/WebCore/webaudio/AudioContext.cpp b/Source/WebCore/webaudio/AudioContext.cpp index dca9606..0c1664f 100644 --- a/Source/WebCore/webaudio/AudioContext.cpp +++ b/Source/WebCore/webaudio/AudioContext.cpp @@ -172,8 +172,6 @@ void AudioContext::constructCommon() FFTFrame::initialize(); m_listener = AudioListener::create(); - m_temporaryMonoBus = adoptPtr(new AudioBus(1, AudioNode::ProcessingSizeInFrames)); - m_temporaryStereoBus = adoptPtr(new AudioBus(2, AudioNode::ProcessingSizeInFrames)); } AudioContext::~AudioContext() @@ -238,13 +236,6 @@ void AudioContext::uninitialize() deleteMarkedNodes(); - // Because the AudioBuffers are garbage collected, we can't delete them here. - // Instead, at least release the potentially large amount of allocated memory for the audio data. - // Note that we do this *after* the context is uninitialized and stops processing audio. - for (unsigned i = 0; i < m_allocatedBuffers.size(); ++i) - m_allocatedBuffers[i]->releaseMemory(); - m_allocatedBuffers.clear(); - m_isInitialized = false; } } @@ -295,11 +286,6 @@ bool AudioContext::hasDocument() return m_document; } -void AudioContext::refBuffer(PassRefPtr buffer) -{ - m_allocatedBuffers.append(buffer); -} - PassRefPtr AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode& ec) { RefPtr audioBuffer = AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate); diff --git a/Source/WebCore/webaudio/AudioContext.h b/Source/WebCore/webaudio/AudioContext.h index c4eec08..ba7c538 100644 --- a/Source/WebCore/webaudio/AudioContext.h +++ b/Source/WebCore/webaudio/AudioContext.h @@ -102,9 +102,6 @@ public: // Asynchronous audio file data decoding. void decodeAudioData(ArrayBuffer*, PassRefPtr, PassRefPtr, ExceptionCode& ec); - // Keep track of this buffer so we can release memory after the context is shut down... - void refBuffer(PassRefPtr buffer); - AudioListener* listener() { return m_listener.get(); } // The AudioNode create methods are called on the main thread (from JavaScript). @@ -126,9 +123,6 @@ public: PassRefPtr createChannelSplitter(); PassRefPtr createChannelMerger(); - AudioBus* temporaryMonoBus() { return m_temporaryMonoBus.get(); } - AudioBus* temporaryStereoBus() { return m_temporaryStereoBus.get(); } - // When a source node has no more processing to do (has finished playing), then it tells the context to dereference it. void notifyNodeFinishedProcessing(AudioNode*); @@ -255,9 +249,6 @@ private: RefPtr m_destinationNode; RefPtr m_listener; - // Only accessed in the main thread. - Vector > m_allocatedBuffers; - // Only accessed in the audio thread. Vector m_finishedNodes; @@ -277,9 +268,6 @@ private: void handleDirtyAudioNodeInputs(); void handleDirtyAudioNodeOutputs(); - OwnPtr m_temporaryMonoBus; - OwnPtr m_temporaryStereoBus; - unsigned m_connectionCount; // Graph locking. -- 2.7.4