Bug 1326003 - Remove dead code: WebAudioDecodeJob::mContentType. r?padenot draft
authormaxLan <maxime.langlade@etu.univ-lyon1.fr>
Fri, 29 Sep 2017 16:02:43 +0200
changeset 672649 3fb23feff8b3babc3ed0c561b87d5b59386ab14c
parent 672293 67974008894e0dfa6a287167ddefbb31280549b5
child 672650 8cb672781bcf2e8dd5970e58262986e3b55e24e4
push id82318
push userbmo:maxime.langlade@etu.univ-lyon1.fr
push dateFri, 29 Sep 2017 14:52:19 +0000
reviewerspadenot
bugs1326003
milestone58.0a1
Bug 1326003 - Remove dead code: WebAudioDecodeJob::mContentType. r?padenot MozReview-Commit-ID: B35bgs91mep
dom/media/webaudio/MediaBufferDecoder.cpp
dom/media/webaudio/MediaBufferDecoder.h
--- a/dom/media/webaudio/MediaBufferDecoder.cpp
+++ b/dom/media/webaudio/MediaBufferDecoder.cpp
@@ -509,23 +509,21 @@ AsyncDecodeWebAudio(const char* aContent
     //   task->Reader()->OwnerThread()->Dispatch(task.forget())
     // we might evaluate the task.forget() before calling Reader(). Enforce
     // a non-crashy order-of-operations.
     TaskQueue* taskQueue = task->Reader()->OwnerThread();
     taskQueue->Dispatch(task.forget());
   }
 }
 
-WebAudioDecodeJob::WebAudioDecodeJob(const nsACString& aContentType,
-                                     AudioContext* aContext,
+WebAudioDecodeJob::WebAudioDecodeJob(AudioContext* aContext,
                                      Promise* aPromise,
                                      DecodeSuccessCallback* aSuccessCallback,
                                      DecodeErrorCallback* aFailureCallback)
-  : mContentType(aContentType)
-  , mContext(aContext)
+  : mContext(aContext)
   , mPromise(aPromise)
   , mSuccessCallback(aSuccessCallback)
   , mFailureCallback(aFailureCallback)
 {
   MOZ_ASSERT(aContext);
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_COUNT_CTOR(WebAudioDecodeJob);
 }
@@ -604,17 +602,16 @@ WebAudioDecodeJob::OnFailure(ErrorCode a
 
   mContext->RemoveFromDecodeQueue(this);
 }
 
 size_t
 WebAudioDecodeJob::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = 0;
-  amount += mContentType.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
   if (mSuccessCallback) {
     amount += mSuccessCallback->SizeOfIncludingThis(aMallocSizeOf);
   }
   if (mFailureCallback) {
     amount += mFailureCallback->SizeOfIncludingThis(aMallocSizeOf);
   }
   if (mOutput) {
     amount += mOutput->SizeOfIncludingThis(aMallocSizeOf);
--- a/dom/media/webaudio/MediaBufferDecoder.h
+++ b/dom/media/webaudio/MediaBufferDecoder.h
@@ -26,18 +26,17 @@ class DecodeErrorCallback;
 class DecodeSuccessCallback;
 class Promise;
 } // namespace dom
 
 struct WebAudioDecodeJob final
 {
   // You may omit both the success and failure callback, or you must pass both.
   // The callbacks are only necessary for asynchronous operation.
-  WebAudioDecodeJob(const nsACString& aContentType,
-                    dom::AudioContext* aContext,
+  WebAudioDecodeJob(dom::AudioContext* aContext,
                     dom::Promise* aPromise,
                     dom::DecodeSuccessCallback* aSuccessCallback = nullptr,
                     dom::DecodeErrorCallback* aFailureCallback = nullptr);
   ~WebAudioDecodeJob();
 
   enum ErrorCode {
     NoError,
     UnknownContent,
@@ -52,17 +51,16 @@ struct WebAudioDecodeJob final
   void OnFailure(ErrorCode aErrorCode);
 
   bool AllocateBuffer();
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   AudioChunk mBuffer;
-  nsCString mContentType;
   RefPtr<dom::AudioContext> mContext;
   RefPtr<dom::Promise> mPromise;
   RefPtr<dom::DecodeSuccessCallback> mSuccessCallback;
   RefPtr<dom::DecodeErrorCallback> mFailureCallback; // can be null
   RefPtr<dom::AudioBuffer> mOutput;
 };
 
 void AsyncDecodeWebAudio(const char* aContentType, uint8_t* aBuffer,