зеркало из 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/layers/VideoBridgeChild.h"
|
||||||
#include "mozilla/SharedThreadPool.h"
|
#include "mozilla/SharedThreadPool.h"
|
||||||
#include "mozilla/layers/ImageDataSerializer.h"
|
#include "mozilla/layers/ImageDataSerializer.h"
|
||||||
|
#include "mozilla/SyncRunnable.h"
|
||||||
|
|
||||||
#if XP_WIN
|
#if XP_WIN
|
||||||
#include <objbase.h>
|
#include <objbase.h>
|
||||||
|
@ -103,13 +104,21 @@ VideoDecoderManagerParent::ShutdownThreads()
|
||||||
sManagerTaskQueue->AwaitShutdownAndIdle();
|
sManagerTaskQueue->AwaitShutdownAndIdle();
|
||||||
sManagerTaskQueue = nullptr;
|
sManagerTaskQueue = nullptr;
|
||||||
|
|
||||||
sVideoDecoderManagerThread->Dispatch(NS_NewRunnableFunction([]() {
|
|
||||||
layers::VideoBridgeChild::Shutdown();
|
|
||||||
}), NS_DISPATCH_SYNC);
|
|
||||||
sVideoDecoderManagerThread->Shutdown();
|
sVideoDecoderManagerThread->Shutdown();
|
||||||
sVideoDecoderManagerThread = nullptr;
|
sVideoDecoderManagerThread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
VideoDecoderManagerParent::ShutdownVideoBridge()
|
||||||
|
{
|
||||||
|
if (sVideoDecoderManagerThread) {
|
||||||
|
RefPtr<Runnable> task = NS_NewRunnableFunction([]() {
|
||||||
|
VideoBridgeChild::Shutdown();
|
||||||
|
});
|
||||||
|
SyncRunnable::DispatchToThread(sVideoDecoderManagerThread, task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
VideoDecoderManagerParent::OnManagerThread()
|
VideoDecoderManagerParent::OnManagerThread()
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,8 @@ public:
|
||||||
static void StartupThreads();
|
static void StartupThreads();
|
||||||
static void ShutdownThreads();
|
static void ShutdownThreads();
|
||||||
|
|
||||||
|
static void ShutdownVideoBridge();
|
||||||
|
|
||||||
bool OnManagerThread();
|
bool OnManagerThread();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
#include "mozilla/dom/VideoDecoderManagerParent.h"
|
||||||
#include "mozilla/layers/CompositorThread.h"
|
#include "mozilla/layers/CompositorThread.h"
|
||||||
#include "mozilla/layers/ImageBridgeParent.h"
|
#include "mozilla/layers/ImageBridgeParent.h"
|
||||||
|
#include "mozilla/dom/VideoDecoderManagerChild.h"
|
||||||
#include "mozilla/layers/LayerTreeOwnerTracker.h"
|
#include "mozilla/layers/LayerTreeOwnerTracker.h"
|
||||||
#include "nsDebugImpl.h"
|
#include "nsDebugImpl.h"
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
|
@ -368,6 +369,7 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||||
mVsyncBridge->Shutdown();
|
mVsyncBridge->Shutdown();
|
||||||
mVsyncBridge = nullptr;
|
mVsyncBridge = nullptr;
|
||||||
}
|
}
|
||||||
|
dom::VideoDecoderManagerParent::ShutdownVideoBridge();
|
||||||
CompositorThreadHolder::Shutdown();
|
CompositorThreadHolder::Shutdown();
|
||||||
Factory::ShutDown();
|
Factory::ShutDown();
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
|
|
|
@ -30,9 +30,10 @@ VideoBridgeChild::Startup()
|
||||||
/* static */ void
|
/* static */ void
|
||||||
VideoBridgeChild::Shutdown()
|
VideoBridgeChild::Shutdown()
|
||||||
{
|
{
|
||||||
sVideoBridgeChildSingleton->Close();
|
if (sVideoBridgeChildSingleton) {
|
||||||
sVideoBridgeChildSingleton = nullptr;
|
sVideoBridgeChildSingleton->Close();
|
||||||
|
sVideoBridgeChildSingleton = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoBridgeChild::VideoBridgeChild()
|
VideoBridgeChild::VideoBridgeChild()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче