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

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

Issue 26209004: Merge 158146 "[XHR] Abort method execution when m_loader->cancel..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1599/
Patch Set: check Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AsyncAudioDecoder.cpp
diff --git a/Source/modules/webaudio/AsyncAudioDecoder.cpp b/Source/modules/webaudio/AsyncAudioDecoder.cpp
index 95a56a2904ec9bc6cf034d93a75c91e6faab18d5..6bde9d67aa5ad86306449f42e5b72338f3fdeee4 100644
--- a/Source/modules/webaudio/AsyncAudioDecoder.cpp
+++ b/Source/modules/webaudio/AsyncAudioDecoder.cpp
@@ -54,8 +54,11 @@ void AsyncAudioDecoder::decodeAsync(ArrayBuffer* audioData, float sampleRate, Pa
if (!audioData)
return;
+ // Add a ref to keep audioData alive until completion of decoding.
+ RefPtr<ArrayBuffer> audioDataRef(audioData);
+
// The leak references to successCallback and errorCallback are picked up on notifyComplete.
- m_thread->postTask(new Task(WTF::bind(&AsyncAudioDecoder::decode, audioData, sampleRate, successCallback.leakRef(), errorCallback.leakRef())));
+ m_thread->postTask(new Task(WTF::bind(&AsyncAudioDecoder::decode, audioDataRef.release().leakRef(), sampleRate, successCallback.leakRef(), errorCallback.leakRef())));
}
void AsyncAudioDecoder::decode(ArrayBuffer* audioData, float sampleRate, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698