summaryrefslogtreecommitdiffstats
path: root/dom/media/eme/MediaKeyMessageEvent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/eme/MediaKeyMessageEvent.cpp')
-rw-r--r--dom/media/eme/MediaKeyMessageEvent.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/dom/media/eme/MediaKeyMessageEvent.cpp b/dom/media/eme/MediaKeyMessageEvent.cpp
index 37c509e67..289d0c16e 100644
--- a/dom/media/eme/MediaKeyMessageEvent.cpp
+++ b/dom/media/eme/MediaKeyMessageEvent.cpp
@@ -85,10 +85,11 @@ MediaKeyMessageEvent::Constructor(const GlobalObject& aGlobal,
RefPtr<MediaKeyMessageEvent> e = new MediaKeyMessageEvent(owner);
bool trusted = e->Init(owner);
e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable);
- aEventInitDict.mMessage.ComputeLengthAndData();
+ nsTArray<uint8_t> initData;
+ CopyArrayBufferViewOrArrayBufferData(aEventInitDict.mMessage, initData);
e->mMessage = ArrayBuffer::Create(aGlobal.Context(),
- aEventInitDict.mMessage.Length(),
- aEventInitDict.mMessage.Data());
+ initData.Length(),
+ initData.Elements());
if (!e->mMessage) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return nullptr;