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

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

Issue 1149913002: Access current frame counter carefully and remove m_cachedSampleFrame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove workaround in scriptprocessornode test Created 5 years, 7 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') | Source/modules/webaudio/AudioDestinationNode.h » ('j') | 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 845d729fa5598817b70e1853536a9758697f6fdb..a6e0aebbeeab2c4dc1278d17ec43f392fd25f5df 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -109,7 +109,6 @@ AudioContext::AudioContext(Document* document)
, m_deferredTaskHandler(DeferredTaskHandler::create())
, m_isOfflineContext(false)
, m_contextState(Suspended)
- , m_cachedSampleFrame(0)
{
m_didInitializeContextGraphMutex = true;
m_destinationNode = DefaultAudioDestinationNode::create(this);
@@ -130,7 +129,6 @@ AudioContext::AudioContext(Document* document, unsigned numberOfChannels, size_t
, m_deferredTaskHandler(DeferredTaskHandler::create())
, m_isOfflineContext(true)
, m_contextState(Suspended)
- , m_cachedSampleFrame(0)
{
m_didInitializeContextGraphMutex = true;
// Create a new destination for offline rendering.
@@ -679,22 +677,6 @@ PeriodicWave* AudioContext::createPeriodicWave(DOMFloat32Array* real, DOMFloat32
return PeriodicWave::create(sampleRate(), real, imag);
}
-size_t AudioContext::currentSampleFrame() const
-{
- if (isAudioThread())
- return m_destinationNode ? m_destinationNode->audioDestinationHandler().currentSampleFrame() : 0;
-
- return m_cachedSampleFrame;
-}
-
-double AudioContext::currentTime() const
-{
- if (isAudioThread())
- return m_destinationNode ? m_destinationNode->audioDestinationHandler().currentTime() : 0;
-
- return m_cachedSampleFrame / static_cast<double>(sampleRate());
-}
-
String AudioContext::state() const
{
// These strings had better match the strings for AudioContextState in AudioContext.idl.
@@ -880,9 +862,6 @@ void AudioContext::handlePreRenderTasks()
// Check to see if source nodes can be stopped because the end time has passed.
handleStoppableSourceNodes();
- // Update the cached sample frame value.
- m_cachedSampleFrame = currentSampleFrame();
-
unlock();
}
}
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioDestinationNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698