Bug 886618. Remove dead AudioBuffer code. r=ehsan a=webaudio
authorRobert O'Callahan <robert@ocallahan.org>
Sat, 29 Jun 2013 01:49:56 +1200
changeset 147836 2644ea8fa5c31f1ece8193dde9ef639646eb572f
parent 147835 5b83b6d6d407b3fd8254227d124fa8ecdc029932
child 147837 8fdb3237bd94558f5ebfd1f0e8bd9cafe0b05f4f
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, webaudio
bugs886618
milestone24.0a2
Bug 886618. Remove dead AudioBuffer code. r=ehsan a=webaudio
content/media/webaudio/AudioBuffer.cpp
content/media/webaudio/AudioBuffer.h
--- a/content/media/webaudio/AudioBuffer.cpp
+++ b/content/media/webaudio/AudioBuffer.cpp
@@ -133,40 +133,16 @@ AudioBuffer::GetChannelData(JSContext* a
   if (!RestoreJSChannelData(aJSContext)) {
     aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
     return nullptr;
   }
 
   return mJSChannels[aChannel];
 }
 
-bool
-AudioBuffer::SetChannelDataFromArrayBufferContents(JSContext* aJSContext,
-                                                   uint32_t aChannel,
-                                                   void* aContents)
-{
-  if (!RestoreJSChannelData(aJSContext)) {
-    return false;
-  }
-
-  MOZ_ASSERT(aChannel < NumberOfChannels());
-  JS::RootedObject arrayBuffer(aJSContext, JS_NewArrayBufferWithContents(aJSContext, aContents));
-  if (!arrayBuffer) {
-    return false;
-  }
-  mJSChannels[aChannel] = JS_NewFloat32ArrayWithBuffer(aJSContext, arrayBuffer,
-                                                       0, -1);
-  if (!mJSChannels[aChannel]) {
-    return false;
-  }
-  MOZ_ASSERT(mLength == JS_GetTypedArrayLength(mJSChannels[aChannel]));
-
-  return true;
-}
-
 static already_AddRefed<ThreadSharedFloatArrayBufferList>
 StealJSArrayDataIntoThreadSharedFloatArrayBufferList(JSContext* aJSContext,
                                                      const nsTArray<JSObject*>& aJSArrays)
 {
   nsRefPtr<ThreadSharedFloatArrayBufferList> result =
     new ThreadSharedFloatArrayBufferList(aJSArrays.Length());
   for (uint32_t i = 0; i < aJSArrays.Length(); ++i) {
     JS::RootedObject arrayBuffer(aJSContext, JS_GetArrayBufferViewBuffer(aJSArrays[i]));
--- a/content/media/webaudio/AudioBuffer.h
+++ b/content/media/webaudio/AudioBuffer.h
@@ -89,22 +89,16 @@ public:
     return mJSChannels[aChannel];
   }
 
   /**
    * Returns a ThreadSharedFloatArrayBufferList containing the sample data.
    */
   ThreadSharedFloatArrayBufferList* GetThreadSharedChannelsForRate(JSContext* aContext);
 
-  // aContents should either come from JS_AllocateArrayBufferContents or
-  // JS_StealArrayBufferContents.
-  bool SetChannelDataFromArrayBufferContents(JSContext* aJSContext,
-                                             uint32_t aChannel,
-                                             void* aContents);
-
   // This replaces the contents of the JS array for the given channel.
   // This function needs to be called on an AudioBuffer which has not been
   // handed off to the content yet, and right after the object has been
   // initialized.
   void SetRawChannelContents(JSContext* aJSContext,
                              uint32_t aChannel,
                              float* aContents);