зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1316221
- Force VideoBridge shutdown to happen before the compositor thread is destroyed. r=dvander
This commit is contained in:
Родитель
808b23cf14
Коммит
77e78d9558
|
@ -17,6 +17,7 @@
|
|||
#include "mozilla/layers/VideoBridgeChild.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/layers/ImageDataSerializer.h"
|
||||
#include "mozilla/SyncRunnable.h"
|
||||
|
||||
#if XP_WIN
|
||||
#include <objbase.h>
|
||||
|
@ -103,13 +104,21 @@ VideoDecoderManagerParent::ShutdownThreads()
|
|||
sManagerTaskQueue->AwaitShutdownAndIdle();
|
||||
sManagerTaskQueue = nullptr;
|
||||
|
||||
sVideoDecoderManagerThread->Dispatch(NS_NewRunnableFunction([]() {
|
||||
layers::VideoBridgeChild::Shutdown();
|
||||
}), NS_DISPATCH_SYNC);
|
||||
sVideoDecoderManagerThread->Shutdown();
|
||||
sVideoDecoderManagerThread = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
VideoDecoderManagerParent::ShutdownVideoBridge()
|
||||
{
|
||||
if (sVideoDecoderManagerThread) {
|
||||
RefPtr<Runnable> task = NS_NewRunnableFunction([]() {
|
||||
VideoBridgeChild::Shutdown();
|
||||
});
|
||||
SyncRunnable::DispatchToThread(sVideoDecoderManagerThread, task);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
VideoDecoderManagerParent::OnManagerThread()
|
||||
{
|
||||
|
|
|
@ -24,6 +24,8 @@ public:
|
|||
static void StartupThreads();
|
||||
static void ShutdownThreads();
|
||||
|
||||
static void ShutdownVideoBridge();
|
||||
|
||||
bool OnManagerThread();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
||||
#include "mozilla/layers/CompositorThread.h"
|
||||
#include "mozilla/layers/ImageBridgeParent.h"
|
||||
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
||||
#include "mozilla/layers/LayerTreeOwnerTracker.h"
|
||||
#include "nsDebugImpl.h"
|
||||
#include "nsExceptionHandler.h"
|
||||
|
@ -368,6 +369,7 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
|
|||
mVsyncBridge->Shutdown();
|
||||
mVsyncBridge = nullptr;
|
||||
}
|
||||
dom::VideoDecoderManagerParent::ShutdownVideoBridge();
|
||||
CompositorThreadHolder::Shutdown();
|
||||
Factory::ShutDown();
|
||||
#if defined(XP_WIN)
|
||||
|
|
|
@ -30,9 +30,10 @@ VideoBridgeChild::Startup()
|
|||
/* static */ void
|
||||
VideoBridgeChild::Shutdown()
|
||||
{
|
||||
sVideoBridgeChildSingleton->Close();
|
||||
sVideoBridgeChildSingleton = nullptr;
|
||||
|
||||
if (sVideoBridgeChildSingleton) {
|
||||
sVideoBridgeChildSingleton->Close();
|
||||
sVideoBridgeChildSingleton = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
VideoBridgeChild::VideoBridgeChild()
|
||||
|
|
Загрузка…
Ссылка в новой задаче