Bug 1509442 - Enter a realm here. r=qdot

Differential Revision: https://phabricator.services.mozilla.com/D13481

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Blake Kaplan 2018-12-12 14:24:29 +00:00
Родитель cb3d965403
Коммит d418ca74d9
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -382,6 +382,13 @@ void AudioBuffer::GetChannelData(JSContext* aJSContext, uint32_t aChannel,
already_AddRefed<ThreadSharedFloatArrayBufferList>
AudioBuffer::StealJSArrayDataIntoSharedChannels(JSContext* aJSContext) {
nsPIDOMWindowInner* global = GetParentObject();
if (!global || !global->AsGlobal()->GetGlobalJSObject()) {
return nullptr;
}
JSAutoRealm ar(aJSContext, global->AsGlobal()->GetGlobalJSObject());
// "1. If any of the AudioBuffer's ArrayBuffer have been detached, abort
// these steps, and return a zero-length channel data buffers to the
// invoker."