Bug 1630229: Part 1 - Ensure that GMP process notifies GeckoView when its actor is destroyed; r=jya

When a GMP process's top-level actor is destroyed, we need to relay that
information up to GeckoView's Java layer. We only want to do this when the
process had previously been successfully started.

Differential Revision: https://phabricator.services.mozilla.com/D71405
This commit is contained in:
Aaron Klotz 2020-04-18 04:12:50 +00:00
Родитель 4020ca1338
Коммит b1c5810208
1 изменённых файлов: 19 добавлений и 0 удалений

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

@ -339,6 +339,25 @@ void GMPParent::DeleteProcess() {
&GMPParent::ChildTerminated));
GMP_PARENT_LOG_DEBUG("%s: Shut down process", __FUNCTION__);
mProcess = nullptr;
#if defined(MOZ_WIDGET_ANDROID)
if (mState != GMPStateNotLoaded) {
nsCOMPtr<nsIEventTarget> launcherThread(GetIPCLauncher());
MOZ_ASSERT(launcherThread);
auto procType = java::GeckoProcessType::GMPLUGIN();
auto selector =
java::GeckoProcessManager::Selector::New(procType, OtherPid());
launcherThread->Dispatch(NS_NewRunnableFunction(
"GMPParent::DeleteProcess",
[selector =
java::GeckoProcessManager::Selector::GlobalRef(selector)]() {
java::GeckoProcessManager::MarkAsDead(selector);
}));
}
#endif // defined(MOZ_WIDGET_ANDROID)
mState = GMPStateNotLoaded;
nsCOMPtr<nsIRunnable> r =