Bug 1443429 - P4. Ensure MediaShutdownManager is initialized outside stable state. r=pehrsons

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2018-12-13 20:06:03 +00:00
Родитель 03276c5356
Коммит 1eaf0bea3e
2 изменённых файлов: 7 добавлений и 1 удалений

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

@ -35,6 +35,7 @@
#include "MediaManager.h"
#include "MediaMetadataManager.h"
#include "MediaResource.h"
#include "MediaShutdownManager.h"
#include "MediaSourceDecoder.h"
#include "MediaStreamError.h"
#include "MediaStreamGraph.h"
@ -3452,6 +3453,12 @@ HTMLMediaElement::HTMLMediaElement(
RegisterActivityObserver();
NotifyOwnerDocumentActivityChanged();
// We initialize the MediaShutdownManager as the HTMLMediaElement is always
// constructed on the main thread, and not during stable state.
// (MediaShutdownManager make use of nsIAsyncShutdownClient which is written
// in JS)
MediaShutdownManager::InitStatics();
mShutdownObserver->Subscribe(this);
}

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

@ -346,7 +346,6 @@ MediaDecoder::MediaDecoder(MediaDecoderInit& aInit)
mWatchManager.Watch(mIsAudioDataAudible,
&MediaDecoder::NotifyAudibleStateChanged);
MediaShutdownManager::InitStatics();
mVideoDecodingOberver->RegisterEvent();
}