| 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..32f1f5f2a9dd8b5195da38fbe02b435007eaf7aa 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),
|
| @@ -138,10 +136,10 @@ size_t OfflineAudioDestinationHandler::CallbackBufferSize() const {
|
| NOTREACHED();
|
| return 0;
|
| }
|
| -WebThread* OfflineAudioDestinationHandler::OfflineRenderThread() {
|
| - DCHECK(render_thread_);
|
|
|
| - return render_thread_.get();
|
| +void OfflineAudioDestinationHandler::InitializeOfflineRenderThread() {
|
| + DCHECK(IsMainThread());
|
| + render_thread_ = Platform::Current()->CreateThread("offline audio renderer");
|
| }
|
|
|
| void OfflineAudioDestinationHandler::StartOfflineRendering() {
|
| @@ -253,6 +251,11 @@ void OfflineAudioDestinationHandler::NotifySuspend(size_t frame) {
|
| }
|
|
|
| void OfflineAudioDestinationHandler::NotifyComplete() {
|
| + DCHECK(IsMainThread());
|
| +
|
| + // Nullify the rendering thread to save the system resource.
|
| + render_thread_.reset();
|
| +
|
| // The OfflineAudioContext might be gone.
|
| if (Context())
|
| Context()->FireCompletionEvent();
|
|
|