Title: [126939] trunk/Source
Revision
126939
Author
[email protected]
Date
2012-08-28 16:30:19 -0700 (Tue, 28 Aug 2012)

Log Message

[Chromium] Remove decodeAudioFileData from PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=95250

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/WebCore:

* platform/audio/chromium/AudioBusChromium.cpp:
(WebCore::decodeAudioFileData):
(WebCore):
(WebCore::AudioBus::loadPlatformResource):
(WebCore::createBusFromInMemoryAudioFile):
* platform/chromium/PlatformSupport.h:
(PlatformSupport):

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126938 => 126939)


--- trunk/Source/WebCore/ChangeLog	2012-08-28 23:27:51 UTC (rev 126938)
+++ trunk/Source/WebCore/ChangeLog	2012-08-28 23:30:19 UTC (rev 126939)
@@ -1,3 +1,20 @@
+2012-08-28  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Remove decodeAudioFileData from PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=95250
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * platform/audio/chromium/AudioBusChromium.cpp:
+        (WebCore::decodeAudioFileData):
+        (WebCore):
+        (WebCore::AudioBus::loadPlatformResource):
+        (WebCore::createBusFromInMemoryAudioFile):
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+
 2012-08-27  Alexandru Chiculita  <[email protected]>
 
         [CSS Filters] Filters should render using sRGB until the specification says how it works

Modified: trunk/Source/WebCore/platform/audio/chromium/AudioBusChromium.cpp (126938 => 126939)


--- trunk/Source/WebCore/platform/audio/chromium/AudioBusChromium.cpp	2012-08-28 23:27:51 UTC (rev 126938)
+++ trunk/Source/WebCore/platform/audio/chromium/AudioBusChromium.cpp	2012-08-28 23:30:19 UTC (rev 126939)
@@ -29,43 +29,51 @@
 #include "AudioBus.h"
 
 #include "AudioFileReader.h"
-#include "PlatformSupport.h"
 #include <public/Platform.h>
+#include <public/WebAudioBus.h>
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
+PassOwnPtr<AudioBus> decodeAudioFileData(const char* data, size_t size, double sampleRate)
+{
+    WebKit::WebAudioBus webAudioBus;
+    if (WebKit::Platform::current()->loadAudioResource(&webAudioBus, data, size, sampleRate))
+        return webAudioBus.release();
+    return nullptr;
+}
+
 PassOwnPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, float sampleRate)
 {
     const WebKit::WebData& resource = WebKit::Platform::current()->loadResource(name);
     if (resource.isEmpty())
         return nullptr;
-    
+
     // FIXME: the sampleRate parameter is ignored. It should be removed from the API.
-    OwnPtr<AudioBus> audioBus = PlatformSupport::decodeAudioFileData(resource.data(), resource.size(), sampleRate);
+    OwnPtr<AudioBus> audioBus = decodeAudioFileData(resource.data(), resource.size(), sampleRate);
 
     if (!audioBus.get())
         return nullptr;
-    
+
     // If the bus is already at the requested sample-rate then return as is.
     if (audioBus->sampleRate() == sampleRate)
         return audioBus.release();
-    
+
     return AudioBus::createBySampleRateConverting(audioBus.get(), false, sampleRate);
 }
 
 PassOwnPtr<AudioBus> createBusFromInMemoryAudioFile(const void* data, size_t dataSize, bool mixToMono, float sampleRate)
 {
     // FIXME: the sampleRate parameter is ignored. It should be removed from the API.
-    OwnPtr<AudioBus> audioBus = PlatformSupport::decodeAudioFileData(static_cast<const char*>(data), dataSize, sampleRate);
+    OwnPtr<AudioBus> audioBus = decodeAudioFileData(static_cast<const char*>(data), dataSize, sampleRate);
     if (!audioBus.get())
         return nullptr;
-      
+
     // If the bus needs no conversion then return as is.
     if ((!mixToMono || audioBus->numberOfChannels() == 1) && audioBus->sampleRate() == sampleRate)
         return audioBus.release();
-    
-    return AudioBus::createBySampleRateConverting(audioBus.get(), mixToMono, sampleRate);    
+
+    return AudioBus::createBySampleRateConverting(audioBus.get(), mixToMono, sampleRate);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (126938 => 126939)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-08-28 23:27:51 UTC (rev 126938)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-08-28 23:30:19 UTC (rev 126939)
@@ -133,11 +133,6 @@
     static NPObject* pluginScriptableObject(Widget*);
     static bool popupsAllowed(NPP);
 
-    // Resources ----------------------------------------------------------
-#if ENABLE(WEB_AUDIO)
-    static PassOwnPtr<AudioBus> decodeAudioFileData(const char* data, size_t, double sampleRate);
-#endif
-
     // Screen -------------------------------------------------------------
     static int screenHorizontalDPI(Widget*);
     static int screenVerticalDPI(Widget*);

Modified: trunk/Source/WebKit/chromium/ChangeLog (126938 => 126939)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-28 23:27:51 UTC (rev 126938)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-28 23:30:19 UTC (rev 126939)
@@ -1,3 +1,15 @@
+2012-08-28  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Remove decodeAudioFileData from PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=95250
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * src/PlatformSupport.cpp:
+        (WebCore):
+
 2012-08-28  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r126344.

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (126938 => 126939)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-08-28 23:27:51 UTC (rev 126938)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-08-28 23:30:19 UTC (rev 126939)
@@ -317,20 +317,6 @@
     return static_cast<WebPluginContainerImpl*>(widget)->scriptableObject();
 }
 
-// Resources ------------------------------------------------------------------
-
-#if ENABLE(WEB_AUDIO)
-
-PassOwnPtr<AudioBus> PlatformSupport::decodeAudioFileData(const char* data, size_t size, double sampleRate)
-{
-    WebAudioBus webAudioBus;
-    if (webKitPlatformSupport()->loadAudioResource(&webAudioBus, data, size, sampleRate))
-        return webAudioBus.release();
-    return nullptr;
-}
-
-#endif // ENABLE(WEB_AUDIO)
-
 // Theming --------------------------------------------------------------------
 
 #if OS(WINDOWS)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to