Loading dom/ipc/ContentParent.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1699,7 +1699,9 @@ void ContentParent::Init() { RefPtr<GeckoMediaPluginServiceParent> gmps( GeckoMediaPluginServiceParent::GetSingleton()); if (gmps) { gmps->UpdateContentProcessGMPCapabilities(this); } // Flush any pref updates that happened during launch and weren't // included in the blobs set up in BeginSubprocessLaunch. Loading dom/media/gmp/GMPContentParent.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -118,8 +118,10 @@ void GMPContentParent::CloseIfUnused() { toClose = this; RefPtr<GeckoMediaPluginServiceChild> gmp( GeckoMediaPluginServiceChild::GetSingleton()); if (gmp) { gmp->RemoveGMPContentParent(toClose); } } NS_DispatchToCurrentThread(NewRunnableMethod( "gmp::GMPContentParent::Close", toClose, &GMPContentParent::Close)); } Loading dom/media/gmp/GMPCrashHelperHolder.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ void GMPCrashHelperHolder::MaybeDisconnect(bool aAbnormalShutdown) { if (!aAbnormalShutdown) { RefPtr<gmp::GeckoMediaPluginService> service( gmp::GeckoMediaPluginService::GetGeckoMediaPluginService()); if (service) { service->DisconnectCrashHelper(GetCrashHelper()); } } } } // namespace mozilla dom/media/gmp/GMPService.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -110,7 +110,9 @@ class GMPServiceCreateHelper final : public mozilla::Runnable { if (XRE_IsParentProcess()) { RefPtr<GeckoMediaPluginServiceParent> service = new GeckoMediaPluginServiceParent(); service->Init(); if (NS_WARN_IF(NS_FAILED(service->Init()))) { return nullptr; } sSingletonService = service; #if defined(XP_MACOSX) && defined(MOZ_SANDBOX) // GMPProcessParent should only be instantiated in the parent Loading @@ -120,7 +122,9 @@ class GMPServiceCreateHelper final : public mozilla::Runnable { } else { RefPtr<GeckoMediaPluginServiceChild> service = new GeckoMediaPluginServiceChild(); service->Init(); if (NS_WARN_IF(NS_FAILED(service->Init()))) { return nullptr; } sSingletonService = service; } ClearOnShutdown(&sSingletonService); Loading Loading @@ -365,12 +369,18 @@ void GeckoMediaPluginService::ShutdownGMPThread() { /* static */ nsCOMPtr<nsIAsyncShutdownClient> GeckoMediaPluginService::GetShutdownBarrier() { nsCOMPtr<nsIAsyncShutdownService> svc = services::GetAsyncShutdownService(); MOZ_RELEASE_ASSERT(svc); if (NS_WARN_IF(!svc)) { MOZ_ASSERT_UNREACHABLE("No async shutdown service!"); return nullptr; } nsCOMPtr<nsIAsyncShutdownClient> barrier; nsresult rv = svc->GetXpcomWillShutdown(getter_AddRefs(barrier)); if (NS_WARN_IF(NS_FAILED(rv))) { MOZ_ASSERT_UNREACHABLE("Could not create shutdown barrier!"); return nullptr; } MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); MOZ_RELEASE_ASSERT(barrier); return barrier; } Loading dom/media/gmp/GMPServiceChild.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -427,15 +427,20 @@ nsresult GeckoMediaPluginServiceChild::AddShutdownBlocker() { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(!mShuttingDownOnGMPThread, "No call paths should add blockers once we're shutting down!"); #ifdef DEBUG MOZ_ASSERT(!mShutdownBlockerAdded, "Should only add blocker once!"); mShutdownBlockerAdded = true; #endif GMP_LOG_DEBUG("%s::%s ", __CLASS__, __FUNCTION__); nsresult rv = GetShutdownBarrier()->AddBlocker( this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, kShutdownBlockerName); nsCOMPtr<nsIAsyncShutdownClient> barrier = GetShutdownBarrier(); if (NS_WARN_IF(!barrier)) { return NS_ERROR_NOT_AVAILABLE; } nsresult rv = barrier->AddBlocker(this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, kShutdownBlockerName); #ifdef DEBUG mShutdownBlockerAdded = NS_SUCCEEDED(rv); #endif return rv; } Loading @@ -449,7 +454,12 @@ void GeckoMediaPluginServiceChild::RemoveShutdownBlocker() { "GeckoMediaPluginServiceChild::" "RemoveShutdownBlocker", [this, self = RefPtr<GeckoMediaPluginServiceChild>(this)]() { nsresult rv = GetShutdownBarrier()->RemoveBlocker(this); nsCOMPtr<nsIAsyncShutdownClient> barrier = GetShutdownBarrier(); if (NS_WARN_IF(!barrier)) { return; } nsresult rv = barrier->RemoveBlocker(this); MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); })); if (NS_WARN_IF(NS_FAILED(rv))) { Loading Loading @@ -520,6 +530,7 @@ class OpenPGMPServiceChild : public mozilla::Runnable { NS_IMETHOD Run() override { RefPtr<GeckoMediaPluginServiceChild> gmp = GeckoMediaPluginServiceChild::GetSingleton(); MOZ_RELEASE_ASSERT(gmp); MOZ_ASSERT(!gmp->mServiceChild); if (mEndpoint.Bind(mGMPServiceChild.get())) { gmp->SetServiceChild(std::move(mGMPServiceChild)); Loading @@ -538,6 +549,10 @@ class OpenPGMPServiceChild : public mozilla::Runnable { bool GMPServiceChild::Create(Endpoint<PGMPServiceChild>&& aGMPService) { RefPtr<GeckoMediaPluginServiceChild> gmp = GeckoMediaPluginServiceChild::GetSingleton(); if (NS_WARN_IF(!gmp)) { return false; } MOZ_ASSERT(!gmp->mServiceChild); RefPtr<GMPServiceChild> serviceChild(new GMPServiceChild()); Loading Loading
dom/ipc/ContentParent.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1699,7 +1699,9 @@ void ContentParent::Init() { RefPtr<GeckoMediaPluginServiceParent> gmps( GeckoMediaPluginServiceParent::GetSingleton()); if (gmps) { gmps->UpdateContentProcessGMPCapabilities(this); } // Flush any pref updates that happened during launch and weren't // included in the blobs set up in BeginSubprocessLaunch. Loading
dom/media/gmp/GMPContentParent.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -118,8 +118,10 @@ void GMPContentParent::CloseIfUnused() { toClose = this; RefPtr<GeckoMediaPluginServiceChild> gmp( GeckoMediaPluginServiceChild::GetSingleton()); if (gmp) { gmp->RemoveGMPContentParent(toClose); } } NS_DispatchToCurrentThread(NewRunnableMethod( "gmp::GMPContentParent::Close", toClose, &GMPContentParent::Close)); } Loading
dom/media/gmp/GMPCrashHelperHolder.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ void GMPCrashHelperHolder::MaybeDisconnect(bool aAbnormalShutdown) { if (!aAbnormalShutdown) { RefPtr<gmp::GeckoMediaPluginService> service( gmp::GeckoMediaPluginService::GetGeckoMediaPluginService()); if (service) { service->DisconnectCrashHelper(GetCrashHelper()); } } } } // namespace mozilla
dom/media/gmp/GMPService.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -110,7 +110,9 @@ class GMPServiceCreateHelper final : public mozilla::Runnable { if (XRE_IsParentProcess()) { RefPtr<GeckoMediaPluginServiceParent> service = new GeckoMediaPluginServiceParent(); service->Init(); if (NS_WARN_IF(NS_FAILED(service->Init()))) { return nullptr; } sSingletonService = service; #if defined(XP_MACOSX) && defined(MOZ_SANDBOX) // GMPProcessParent should only be instantiated in the parent Loading @@ -120,7 +122,9 @@ class GMPServiceCreateHelper final : public mozilla::Runnable { } else { RefPtr<GeckoMediaPluginServiceChild> service = new GeckoMediaPluginServiceChild(); service->Init(); if (NS_WARN_IF(NS_FAILED(service->Init()))) { return nullptr; } sSingletonService = service; } ClearOnShutdown(&sSingletonService); Loading Loading @@ -365,12 +369,18 @@ void GeckoMediaPluginService::ShutdownGMPThread() { /* static */ nsCOMPtr<nsIAsyncShutdownClient> GeckoMediaPluginService::GetShutdownBarrier() { nsCOMPtr<nsIAsyncShutdownService> svc = services::GetAsyncShutdownService(); MOZ_RELEASE_ASSERT(svc); if (NS_WARN_IF(!svc)) { MOZ_ASSERT_UNREACHABLE("No async shutdown service!"); return nullptr; } nsCOMPtr<nsIAsyncShutdownClient> barrier; nsresult rv = svc->GetXpcomWillShutdown(getter_AddRefs(barrier)); if (NS_WARN_IF(NS_FAILED(rv))) { MOZ_ASSERT_UNREACHABLE("Could not create shutdown barrier!"); return nullptr; } MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); MOZ_RELEASE_ASSERT(barrier); return barrier; } Loading
dom/media/gmp/GMPServiceChild.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -427,15 +427,20 @@ nsresult GeckoMediaPluginServiceChild::AddShutdownBlocker() { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(!mShuttingDownOnGMPThread, "No call paths should add blockers once we're shutting down!"); #ifdef DEBUG MOZ_ASSERT(!mShutdownBlockerAdded, "Should only add blocker once!"); mShutdownBlockerAdded = true; #endif GMP_LOG_DEBUG("%s::%s ", __CLASS__, __FUNCTION__); nsresult rv = GetShutdownBarrier()->AddBlocker( this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, kShutdownBlockerName); nsCOMPtr<nsIAsyncShutdownClient> barrier = GetShutdownBarrier(); if (NS_WARN_IF(!barrier)) { return NS_ERROR_NOT_AVAILABLE; } nsresult rv = barrier->AddBlocker(this, NS_LITERAL_STRING_FROM_CSTRING(__FILE__), __LINE__, kShutdownBlockerName); #ifdef DEBUG mShutdownBlockerAdded = NS_SUCCEEDED(rv); #endif return rv; } Loading @@ -449,7 +454,12 @@ void GeckoMediaPluginServiceChild::RemoveShutdownBlocker() { "GeckoMediaPluginServiceChild::" "RemoveShutdownBlocker", [this, self = RefPtr<GeckoMediaPluginServiceChild>(this)]() { nsresult rv = GetShutdownBarrier()->RemoveBlocker(this); nsCOMPtr<nsIAsyncShutdownClient> barrier = GetShutdownBarrier(); if (NS_WARN_IF(!barrier)) { return; } nsresult rv = barrier->RemoveBlocker(this); MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); })); if (NS_WARN_IF(NS_FAILED(rv))) { Loading Loading @@ -520,6 +530,7 @@ class OpenPGMPServiceChild : public mozilla::Runnable { NS_IMETHOD Run() override { RefPtr<GeckoMediaPluginServiceChild> gmp = GeckoMediaPluginServiceChild::GetSingleton(); MOZ_RELEASE_ASSERT(gmp); MOZ_ASSERT(!gmp->mServiceChild); if (mEndpoint.Bind(mGMPServiceChild.get())) { gmp->SetServiceChild(std::move(mGMPServiceChild)); Loading @@ -538,6 +549,10 @@ class OpenPGMPServiceChild : public mozilla::Runnable { bool GMPServiceChild::Create(Endpoint<PGMPServiceChild>&& aGMPService) { RefPtr<GeckoMediaPluginServiceChild> gmp = GeckoMediaPluginServiceChild::GetSingleton(); if (NS_WARN_IF(!gmp)) { return false; } MOZ_ASSERT(!gmp->mServiceChild); RefPtr<GMPServiceChild> serviceChild(new GMPServiceChild()); Loading