Bug 1407549 - Copy AudioSegment by constructor. r?padenot
This allows static analysis to pass for AudioNodeExternalInputStream.cpp.
MozReview-Commit-ID: 9dvllnnODed
--- 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);