Bug 1632717

This commit is contained in:
Moonchild 2020-06-03 09:44:20 +00:00 committed by Roy Tam
commit 0ae2d2fb2e
4 changed files with 24 additions and 7 deletions

View file

@ -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;