Bug 1407549 - Copy AudioSegment by constructor. r?padenot draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Wed, 04 Apr 2018 12:07:41 +0200
changeset 777234 10cd06f955bcefbfdf279a89ae1c577edb696b70
parent 776613 00adaf71bc82264f939d47fa366c9558f1589090
push id105120
push userbmo:apehrson@mozilla.com
push dateWed, 04 Apr 2018 13:00:34 +0000
reviewerspadenot
bugs1407549
milestone61.0a1
Bug 1407549 - Copy AudioSegment by constructor. r?padenot This allows static analysis to pass for AudioNodeExternalInputStream.cpp. MozReview-Commit-ID: 9dvllnnODed
dom/media/AudioSegment.h
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -13,19 +13,30 @@
 #include "WebAudioUtils.h"
 #ifdef MOZILLA_INTERNAL_API
 #include "mozilla/TimeStamp.h"
 #endif
 #include <float.h>
 
 namespace mozilla {
   struct AudioChunk;
+  class AudioSegment;
 }
 DECLARE_USE_COPY_CONSTRUCTORS(mozilla::AudioChunk)
 
+/**
+ * This allows compilation of nsTArray<AudioSegment> and
+ * AutoTArray<AudioSegment> since without it, static analysis fails on the
+ * mChunks member being a non-memmovable AutoTArray.
+ *
+ * Note that AudioSegment(const AudioSegment&) is deleted, so this should
+ * never come into effect.
+ */
+DECLARE_USE_COPY_CONSTRUCTORS(mozilla::AudioSegment)
+
 namespace mozilla {
 
 template<typename T>
 class SharedChannelArrayBuffer : public ThreadSharedObject {
 public:
   explicit SharedChannelArrayBuffer(nsTArray<nsTArray<T> >* aBuffers)
   {
     mBuffers.SwapElements(*aBuffers);