Chromium Code Reviews| Index: Source/modules/webaudio/AudioContext.cpp |
| diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp |
| index 1fa9d78d1487be98833b4ca9eed55da21e13c2ac..3b7dee2a9bd2ed1cb8ce6c4212bd681869f826c8 100644 |
| --- a/Source/modules/webaudio/AudioContext.cpp |
| +++ b/Source/modules/webaudio/AudioContext.cpp |
| @@ -155,9 +155,6 @@ AudioContext::AudioContext(Document* document, unsigned numberOfChannels, size_t |
| void AudioContext::constructCommon() |
| { |
| ScriptWrappable::init(this); |
| - // According to spec AudioContext must die only after page navigate. |
| - // Lets mark it as ActiveDOMObject with pending activity and unmark it in clear method. |
| - setPendingActivity(this); |
| FFTFrame::initialize(); |
| @@ -217,9 +214,6 @@ void AudioContext::clear() |
| m_nodesToDelete.appendVector(m_nodesMarkedForDeletion); |
| m_nodesMarkedForDeletion.clear(); |
| } while (m_nodesToDelete.size()); |
| - |
| - // It was set in constructCommon. |
| - unsetPendingActivity(this); |
| } |
| void AudioContext::uninitialize() |
| @@ -276,6 +270,12 @@ void AudioContext::stop() |
| callOnMainThread(stopDispatch, this); |
| } |
| +bool AudioContext::hasPendingActivity() const |
| +{ |
| + // According to spec AudioContext must die only after page navigate. |
| + return executionContext()->activeDOMObjectsAreStopped(); |
|
kouhei (in TOK)
2014/03/21 16:32:40
Sorry this must be the opposite!
|
| +} |
| + |
| PassRefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionState& exceptionState) |
| { |
| RefPtr<AudioBuffer> audioBuffer = AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate); |