diff options
Diffstat (limited to 'dom/media/eme/EMEUtils.cpp')
-rw-r--r-- | dom/media/eme/EMEUtils.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/media/eme/EMEUtils.cpp b/dom/media/eme/EMEUtils.cpp index 11eb0026e..93e7834e3 100644 --- a/dom/media/eme/EMEUtils.cpp +++ b/dom/media/eme/EMEUtils.cpp @@ -5,6 +5,8 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/EMEUtils.h" + +#include "jsfriendapi.h" // for AutoCheckCannotGC #include "mozilla/dom/UnionTypes.h" namespace mozilla { @@ -23,6 +25,7 @@ ArrayData GetArrayBufferViewOrArrayBufferData(const dom::ArrayBufferViewOrArrayBuffer& aBufferOrView) { MOZ_ASSERT(aBufferOrView.IsArrayBuffer() || aBufferOrView.IsArrayBufferView()); + JS::AutoCheckCannotGC nogc; if (aBufferOrView.IsArrayBuffer()) { const dom::ArrayBuffer& buffer = aBufferOrView.GetAsArrayBuffer(); buffer.ComputeLengthAndData(); @@ -39,6 +42,7 @@ void CopyArrayBufferViewOrArrayBufferData(const dom::ArrayBufferViewOrArrayBuffer& aBufferOrView, nsTArray<uint8_t>& aOutData) { + JS::AutoCheckCannotGC nogc; ArrayData data = GetArrayBufferViewOrArrayBufferData(aBufferOrView); aOutData.Clear(); if (!data.IsValid()) { @@ -47,6 +51,14 @@ CopyArrayBufferViewOrArrayBufferData(const dom::ArrayBufferViewOrArrayBuffer& aB aOutData.AppendElements(data.mData, data.mLength); } +void CopyArrayBufferViewOrArrayBufferData(const dom::ArrayBuffer& aBuffer, + nsTArray<uint8_t>& aOutData) { + JS::AutoCheckCannotGC nogc; + aBuffer.ComputeLengthAndData(); + aOutData.Clear(); + aOutData.AppendElements(aBuffer.Data(), aBuffer.Length()); +} + bool IsClearkeyKeySystem(const nsAString& aKeySystem) { |