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

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

Issue 297313003: Initialize AudioContext on constructor to increase currentTime in real-time. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove layout test Created 6 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/AudioNode.cpp » ('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 0561c3ee7f6b7e74a23b2ad40686052789f4b232..148feb7612505d840d6e46147175164f857fe74a 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -119,9 +119,9 @@ AudioContext::AudioContext(Document* document)
, m_graphOwnerThread(UndefinedThreadIdentifier)
, m_isOfflineContext(false)
{
- constructCommon();
-
m_destinationNode = DefaultAudioDestinationNode::create(this);
+
+ constructCommon();
}
// Constructor for offline (non-realtime) rendering.
@@ -138,12 +138,12 @@ AudioContext::AudioContext(Document* document, unsigned numberOfChannels, size_t
, m_graphOwnerThread(UndefinedThreadIdentifier)
, m_isOfflineContext(true)
{
- constructCommon();
-
// Create a new destination for offline rendering.
m_renderTarget = AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate);
if (m_renderTarget.get())
m_destinationNode = OfflineAudioDestinationNode::create(this, m_renderTarget.get());
+
+ constructCommon();
}
void AudioContext::constructCommon()
@@ -153,6 +153,8 @@ void AudioContext::constructCommon()
FFTFrame::initialize();
m_listener = AudioListener::create();
+
+ initialize();
}
AudioContext::~AudioContext()
@@ -171,7 +173,7 @@ AudioContext::~AudioContext()
ASSERT(!m_renderingAutomaticPullNodes.size());
}
-void AudioContext::lazyInitialize()
+void AudioContext::initialize()
{
if (!m_isInitialized) {
// Don't allow the context to initialize a second time after it's already been explicitly uninitialized.
« no previous file with comments | « Source/modules/webaudio/AudioContext.h ('k') | Source/modules/webaudio/AudioNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698