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

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

Issue 85263006: Make IDL Callbacks non-refcounted by default (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 1 month 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/AsyncAudioDecoder.h ('k') | Source/modules/webaudio/AudioBufferCallback.h » ('j') | 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 338056449f4c069cd9161740a17d1eaaa00787aa..f1ea34f4c71456fad2716838e7c95099aba78e67 100644
--- a/Source/modules/webaudio/AsyncAudioDecoder.cpp
+++ b/Source/modules/webaudio/AsyncAudioDecoder.cpp
@@ -47,7 +47,7 @@ AsyncAudioDecoder::~AsyncAudioDecoder()
{
}
-void AsyncAudioDecoder::decodeAsync(ArrayBuffer* audioData, float sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback)
+void AsyncAudioDecoder::decodeAsync(ArrayBuffer* audioData, float sampleRate, PassOwnPtr<AudioBufferCallback> successCallback, PassOwnPtr<AudioBufferCallback> errorCallback)
{
ASSERT(isMainThread());
ASSERT(audioData);
@@ -58,7 +58,7 @@ void AsyncAudioDecoder::decodeAsync(ArrayBuffer* audioData, float sampleRate, Pa
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, audioDataRef.release().leakRef(), sampleRate, successCallback.leakRef(), errorCallback.leakRef())));
+ m_thread->postTask(new Task(WTF::bind(&AsyncAudioDecoder::decode, audioDataRef.release().leakRef(), sampleRate, successCallback.leakPtr(), errorCallback.leakPtr())));
}
void AsyncAudioDecoder::decode(ArrayBuffer* audioData, float sampleRate, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback)
@@ -75,8 +75,8 @@ void AsyncAudioDecoder::notifyComplete(ArrayBuffer* audioData, AudioBufferCallba
{
// Adopt references, so everything gets correctly dereffed.
RefPtr<ArrayBuffer> audioDataRef = adoptRef(audioData);
- RefPtr<AudioBufferCallback> successCallbackRef = adoptRef(successCallback);
- RefPtr<AudioBufferCallback> errorCallbackRef = adoptRef(errorCallback);
+ OwnPtr<AudioBufferCallback> successCallbackPtr = adoptPtr(successCallback);
+ OwnPtr<AudioBufferCallback> errorCallbackPtr = adoptPtr(errorCallback);
RefPtr<AudioBuffer> audioBufferRef = adoptRef(audioBuffer);
if (audioBuffer && successCallback)
« no previous file with comments | « Source/modules/webaudio/AsyncAudioDecoder.h ('k') | Source/modules/webaudio/AudioBufferCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698