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

Unified Diff: Source/modules/webaudio/AudioContext.cpp

Issue 208493002: Remove {,un}setPendingActivity from AudioContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioContext.cpp
diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp
index 1fa9d78d1487be98833b4ca9eed55da21e13c2ac..8289e2c179c8353381eadc87cdb13f7cf956c654 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.
haraken 2014/03/21 16:42:20 navigate => navigates or navigation
kouhei (in TOK) 2014/03/21 16:44:47 Done.
+ return !executionContext()->activeDOMObjectsAreStopped();
+}
+
PassRefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionState& exceptionState)
{
RefPtr<AudioBuffer> audioBuffer = AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate);
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698