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

Unified Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp

Issue 2889393003: Lazy initialization of the rendering thread in OfflineAudioContext (Closed)
Patch Set: Created 3 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
Index: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
index e35b087652e1663a338b77707488110927f8aae1..423a588ee4519e1b26295eb69422babd01a983da 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -46,8 +46,6 @@ OfflineAudioDestinationHandler::OfflineAudioDestinationHandler(
AudioBuffer* render_target)
: AudioDestinationHandler(node),
render_target_(render_target),
- render_thread_(
- Platform::Current()->CreateThread("offline audio renderer")),
frames_processed_(0),
frames_to_process_(0),
is_rendering_started_(false),
@@ -104,12 +102,14 @@ unsigned long OfflineAudioDestinationHandler::MaxChannelCount() const {
void OfflineAudioDestinationHandler::StartRendering() {
DCHECK(IsMainThread());
- DCHECK(render_thread_);
DCHECK(render_target_);
if (!render_target_)
return;
+ render_thread_ = Platform::Current()->CreateThread("offline audio renderer");
Raymond Toy 2017/05/19 19:37:54 Maybe if we fail to create the thread we can rejec
+ DCHECK(render_thread_);
+
// Rendering was not started. Starting now.
if (!is_rendering_started_) {
is_rendering_started_ = true;

Powered by Google App Engine
This is Rietveld 408576698