Title: [89499] trunk/Source/WebCore
Revision
89499
Author
crog...@google.com
Date
2011-06-22 17:01:53 -0700 (Wed, 22 Jun 2011)

Log Message

2011-06-22  Chris Rogers  <crog...@google.com>

        Reviewed by David Levin.

        Use create() method for AsyncAudioDecoder::DecodingTask
        https://bugs.webkit.org/show_bug.cgi?id=63198

        No new tests.  This doesn't change any JS API.

        * webaudio/AsyncAudioDecoder.cpp:
        (WebCore::AsyncAudioDecoder::decodeAsync):
        (WebCore::AsyncAudioDecoder::DecodingTask::create):
        * webaudio/AsyncAudioDecoder.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89498 => 89499)


--- trunk/Source/WebCore/ChangeLog	2011-06-22 23:57:14 UTC (rev 89498)
+++ trunk/Source/WebCore/ChangeLog	2011-06-23 00:01:53 UTC (rev 89499)
@@ -1,3 +1,17 @@
+2011-06-22  Chris Rogers  <crog...@google.com>
+
+        Reviewed by David Levin.
+
+        Use create() method for AsyncAudioDecoder::DecodingTask
+        https://bugs.webkit.org/show_bug.cgi?id=63198
+
+        No new tests.  This doesn't change any JS API.
+
+        * webaudio/AsyncAudioDecoder.cpp:
+        (WebCore::AsyncAudioDecoder::decodeAsync):
+        (WebCore::AsyncAudioDecoder::DecodingTask::create):
+        * webaudio/AsyncAudioDecoder.h:
+
 2011-06-22  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r89489.

Modified: trunk/Source/WebCore/webaudio/AsyncAudioDecoder.cpp (89498 => 89499)


--- trunk/Source/WebCore/webaudio/AsyncAudioDecoder.cpp	2011-06-22 23:57:14 UTC (rev 89498)
+++ trunk/Source/WebCore/webaudio/AsyncAudioDecoder.cpp	2011-06-23 00:01:53 UTC (rev 89499)
@@ -60,7 +60,7 @@
     if (!audioData)
         return;
 
-    OwnPtr<DecodingTask> decodingTask = adoptPtr(new DecodingTask(audioData, sampleRate, successCallback, errorCallback));
+    OwnPtr<DecodingTask> decodingTask = DecodingTask::create(audioData, sampleRate, successCallback, errorCallback);
     m_queue.append(decodingTask.release()); // note that ownership of the task is effectively taken by the queue.
 }
 
@@ -90,6 +90,11 @@
     }
 }
 
+PassOwnPtr<AsyncAudioDecoder::DecodingTask> AsyncAudioDecoder::DecodingTask::create(ArrayBuffer* audioData, double sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback)
+{
+    return adoptPtr(new DecodingTask(audioData, sampleRate, successCallback, errorCallback));
+}
+
 AsyncAudioDecoder::DecodingTask::DecodingTask(ArrayBuffer* audioData, double sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback)
     : m_audioData(audioData)
     , m_sampleRate(sampleRate)

Modified: trunk/Source/WebCore/webaudio/AsyncAudioDecoder.h (89498 => 89499)


--- trunk/Source/WebCore/webaudio/AsyncAudioDecoder.h	2011-06-22 23:57:14 UTC (rev 89498)
+++ trunk/Source/WebCore/webaudio/AsyncAudioDecoder.h	2011-06-23 00:01:53 UTC (rev 89499)
@@ -41,6 +41,7 @@
 // Upon successful decoding, a completion callback will be invoked with the decoded PCM data in an AudioBuffer.
 
 class AsyncAudioDecoder {
+    WTF_MAKE_NONCOPYABLE(AsyncAudioDecoder);
 public:
     AsyncAudioDecoder();
     ~AsyncAudioDecoder();
@@ -52,11 +53,13 @@
     class DecodingTask {
         WTF_MAKE_NONCOPYABLE(DecodingTask);
     public:
-        DecodingTask(ArrayBuffer* audioData, double sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback);
-        
+        static PassOwnPtr<DecodingTask> create(ArrayBuffer* audioData, double sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback);
+
         void decode();
         
     private:
+        DecodingTask(ArrayBuffer* audioData, double sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback);
+
         ArrayBuffer* audioData() { return m_audioData.get(); }
         double sampleRate() const { return m_sampleRate; }
         AudioBufferCallback* successCallback() { return m_successCallback.get(); }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to