mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1006024 - Part 6: Replace AutoPushJSContext in AudioProcessingEvent::LazilyCreateBuffer. r=bholley
This commit is contained in:
parent
f9c6a2c9af
commit
57656ff550
@ -6,6 +6,7 @@
|
||||
|
||||
#include "AudioProcessingEvent.h"
|
||||
#include "mozilla/dom/AudioProcessingEventBinding.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "AudioContext.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -40,7 +41,15 @@ void
|
||||
AudioProcessingEvent::LazilyCreateBuffer(nsRefPtr<AudioBuffer>& aBuffer,
|
||||
uint32_t aNumberOfChannels)
|
||||
{
|
||||
AutoPushJSContext cx(mNode->Context()->GetJSContext());
|
||||
// We need the global for the context so that we can enter its compartment.
|
||||
JSObject* global = mNode->Context()->GetGlobalJSObject();
|
||||
if (NS_WARN_IF(!global)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AutoJSAPI jsapi;
|
||||
JSContext* cx = jsapi.cx();
|
||||
JSAutoCompartment ac(cx, global);
|
||||
|
||||
aBuffer = new AudioBuffer(mNode->Context(), mNode->BufferSize(),
|
||||
mNode->Context()->SampleRate());
|
||||
|
Loading…
Reference in New Issue
Block a user