зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1180355 - Initialize the AudioChannelAgent after AudioContext has gained a stable refcount; r=baku
This commit is contained in:
Родитель
1bff6caf2d
Коммит
70caaac6af
|
@ -105,6 +105,11 @@ AudioContext::AudioContext(nsPIDOMWindow* aWindow,
|
|||
// bound to the window.
|
||||
mDestination = new AudioDestinationNode(this, aIsOffline, aChannel,
|
||||
aNumberOfChannels, aLength, aSampleRate);
|
||||
}
|
||||
|
||||
void
|
||||
AudioContext::Init()
|
||||
{
|
||||
// We skip calling SetIsOnlyNodeForContext and the creation of the
|
||||
// audioChannelAgent during mDestination's constructor, because we can only
|
||||
// call them after mDestination has been set up.
|
||||
|
@ -145,6 +150,7 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
|
|||
nsRefPtr<AudioContext> object =
|
||||
new AudioContext(window, false,
|
||||
AudioChannelService::GetDefaultAudioChannel());
|
||||
object->Init();
|
||||
|
||||
RegisterWeakMemoryReporter(object);
|
||||
|
||||
|
@ -163,6 +169,7 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
|
|||
}
|
||||
|
||||
nsRefPtr<AudioContext> object = new AudioContext(window, false, aChannel);
|
||||
object->Init();
|
||||
|
||||
RegisterWeakMemoryReporter(object);
|
||||
|
||||
|
|
|
@ -101,6 +101,8 @@ class AudioContext final : public DOMEventTargetHelper,
|
|||
float aSampleRate = 0.0f);
|
||||
~AudioContext();
|
||||
|
||||
void Init();
|
||||
|
||||
public:
|
||||
typedef uint64_t AudioContextId;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче