gecko-dev/dom/media/gmp
Chris Pearce 0901ad8256 Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald
When we shutdown the browser while the GMPService is active we can end up
leaking a GMPParent, GeckoMediaPluginServiceParent, and a Runnable. I tracked
this down to the runnable dispatched to the GMP thread in
GMPParent::ChildTerminated(). The dispatch of this runnable is failing as we
are dispatching the runnable to a reference of the GMP thread which we have
previously acquired, but that thread is now shutdown. So the dispatch fails,
and if you look in nsThread::DispatchInternal() you'll see that we deliberately
leak the runnable if dispatch fails! The runnable leaking means that the
references it holds to the GMPParent and the GMP service parent leak.

The solution in this patch is to not cache a reference to the GMP thread on the
GMPParent; instead we re-request the GMP thread from the GMPService when we
want it. This means that in the case where the browser is shutting down,
GMPParent::GMPThread() will return null, and we'll not leak the runnable. We'll
then follow the (hacky) shutdown path added in bug 1163239.

We also need to change GMPParent::GMPThread() and GMPContentParent::GMPThread()
to return a reference to the GMP thread with a refcount held on it, in order
to ensure we don't race with the GMP service shutting down the GMP thread
while we're trying to dispatch to in on shutdown.

MozReview-Commit-ID: CXv9VZqTRzY

--HG--
extra : rebase_source : e507e48ee633cad8911287fb7296bbb1679a7bcb
2017-03-24 13:38:00 +13:00
..
gmp-api Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
widevine-adapter Bug 1315850 - Hook up CDM storage. r=gerald 2017-03-22 16:30:54 +13:00
ChromiumCDMAdapter.cpp Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
ChromiumCDMAdapter.h Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
ChromiumCDMChild.cpp Bug 1315850 - Port the work around from Bug 1343140 to the new CDM video decoder architecture. r=gerald 2017-03-14 17:17:05 +13:00
ChromiumCDMChild.h Bug 1315850 - Port the work around from Bug 1343140 to the new CDM video decoder architecture. r=gerald 2017-03-14 17:17:05 +13:00
ChromiumCDMParent.cpp Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
ChromiumCDMParent.h Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
ChromiumCDMProxy.cpp Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
ChromiumCDMProxy.h Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
DecryptJob.cpp Bug 1339755 - Move DecryptJob id calculation into its constructor. r=jwwang 2016-12-01 11:23:27 +13:00
DecryptJob.h Bug 1339755 - Move DecryptJob id calculation into its constructor. r=jwwang 2016-12-01 11:23:27 +13:00
GMPCallbackBase.h
GMPCDMCallbackProxy.cpp Bug 1346679 - Label runnables in dom/media/gmp/GMPCDMCallbackProxy.cpp. r=cpearce 2017-03-10 16:07:04 +08:00
GMPCDMCallbackProxy.h Bug 1346679 - Label runnables in dom/media/gmp/GMPCDMCallbackProxy.cpp. r=cpearce 2017-03-10 16:07:04 +08:00
GMPCDMProxy.cpp Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
GMPCDMProxy.h Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
GMPChild.cpp Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
GMPChild.h Replace GMP use of PCrashReporter with shmem-based annotations. (bug 1337518, r=billm) 2017-02-12 11:39:44 -08:00
GMPContentChild.cpp Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
GMPContentChild.h Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald 2017-02-23 11:51:00 +13:00
GMPContentParent.cpp Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPContentParent.h Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPCrashHelper.cpp Bug 1346678 - Label runnables in dom/media/gmp/GMPParent.cpp and its friends. r=cpearce 2017-03-09 15:31:11 +08:00
GMPCrashHelper.h Bug 1322739: P1. Fix style and headers. r=gerald 2017-02-22 13:02:58 +01:00
GMPCrashHelperHolder.cpp Bug 1339733 - Move GMPCrashHelperHolder implementation into its own .cpp file. r=jwwang 2016-11-23 15:53:42 +13:00
GMPCrashHelperHolder.h Bug 1339733 - Move GMPCrashHelperHolder implementation into its own .cpp file. r=jwwang 2016-11-23 15:53:42 +13:00
GMPDecryptorChild.cpp Bug 1337778 - Use counter for decryptor ID instead of IPDL actor Id. r=gerald 2017-03-01 17:19:08 +13:00
GMPDecryptorChild.h Bug 1337778 - Use counter for decryptor ID instead of IPDL actor Id. r=gerald 2017-03-01 17:19:08 +13:00
GMPDecryptorParent.cpp Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
GMPDecryptorParent.h Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPDecryptorProxy.h Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
GMPDiskStorage.cpp Bug 1332530 - Remove GMP enum storage names. r=gerald 2017-01-20 15:06:00 +13:00
GMPEncryptedBufferDataImpl.cpp
GMPEncryptedBufferDataImpl.h
GMPLoader.cpp Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/media/gmp* r=cpearce 2017-02-09 10:31:55 +01:00
GMPLoader.h Bug 1332530 - Flatten GMPLoader and GMPLoaderImpl. r=gerald 2017-01-19 15:44:54 +13:00
GMPLog.h Bug 1315850 - Add GMP_LOG macro. r=gerald 2017-02-22 09:45:54 +13:00
GMPMemoryStorage.cpp Bug 1332530 - Remove GMP enum storage names. r=gerald 2017-01-20 15:06:00 +13:00
GMPMessageUtils.h Bug 1315850 - Create ChromiumCDMProxy in MediaKeys.cpp when preffed on. r=gerald 2017-02-22 14:42:55 +13:00
GMPParent.cpp Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPParent.h Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPPlatform.cpp Bug 1344614 - Improve GMP clock precision to match Chromium's CDM clock. r=jwwang 2017-02-27 10:42:59 +13:00
GMPPlatform.h Bug 1338924 - Add GMPTask that takes/runs a lambda and a simple mechanism to set a timer on a lambda task. r=gerald 2017-02-14 11:09:38 +13:00
GMPProcessChild.cpp bug 1303096 - Stop sending sync messages soon after content process start-up r=billm 2017-02-05 00:52:38 -05:00
GMPProcessChild.h bug 1303096 - Stop sending sync messages soon after content process start-up r=billm 2017-02-05 00:52:38 -05:00
GMPProcessParent.cpp Bug 1332149 - Don't expose plugin-container or sandbox vouchers to GMPs. r=gerald 2017-01-19 14:57:30 +13:00
GMPProcessParent.h
GMPService.cpp Bug 1315850 - Add GMPService::GetCDM. r=gerald 2017-02-22 09:26:47 +13:00
GMPService.h Bug 1315850 - Add GMPService::GetCDM. r=gerald 2017-02-22 09:26:47 +13:00
GMPServiceChild.cpp Bug 1346678 - Label runnables in dom/media/gmp/GMPParent.cpp and its friends. r=cpearce 2017-03-09 15:31:11 +08:00
GMPServiceChild.h Bug 1321871, part 2 - Remove PContent opens of PGMPService. r=peterv 2017-01-05 12:55:57 -08:00
GMPServiceParent.cpp Bug 1346678 - Label runnables in dom/media/gmp/GMPParent.cpp and its friends. r=cpearce 2017-03-09 15:31:11 +08:00
GMPServiceParent.h Bug 1346678 - Label runnables in dom/media/gmp/GMPParent.cpp and its friends. r=cpearce 2017-03-09 15:31:11 +08:00
GMPSharedMemManager.cpp
GMPSharedMemManager.h
GMPStorage.h Bug 1332530 - Remove GMP enum storage names. r=gerald 2017-01-20 15:06:00 +13:00
GMPStorageChild.cpp Bug 1332530 - Remove GMP enum storage names. r=gerald 2017-01-20 15:06:00 +13:00
GMPStorageChild.h Bug 1332530 - Remove GMP enum storage names. r=gerald 2017-01-20 15:06:00 +13:00
GMPStorageParent.cpp Bug 1060419 - make log_print use Printf.h, r=froydnj 2016-12-15 20:16:31 -07:00
GMPStorageParent.h Bug 1332530 - Remove GMP enum storage names. r=gerald 2017-01-20 15:06:00 +13:00
GMPTimerChild.cpp Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPTimerChild.h Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPTimerParent.cpp Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPTimerParent.h Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPTypes.ipdlh Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald 2017-02-23 11:51:00 +13:00
GMPUtils.cpp Bug 1315850 - Add GetGMPAbstractThread() to GMPUtils.h. r=gerald 2017-02-23 14:04:25 +13:00
GMPUtils.h Bug 1315850 - Add GetGMPAbstractThread() to GMPUtils.h. r=gerald 2017-02-23 14:04:25 +13:00
GMPVideoDecoderChild.cpp Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPVideoDecoderChild.h Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPVideoDecoderParent.cpp Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPVideoDecoderParent.h Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPVideoDecoderProxy.h
GMPVideoEncodedFrameImpl.cpp
GMPVideoEncodedFrameImpl.h
GMPVideoEncoderChild.cpp Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPVideoEncoderChild.h Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPVideoEncoderParent.cpp Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald 2017-02-23 11:51:00 +13:00
GMPVideoEncoderParent.h Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm 2016-11-15 04:26:00 +01:00
GMPVideoEncoderProxy.h
GMPVideoHost.cpp
GMPVideoHost.h
GMPVideoi420FrameImpl.cpp
GMPVideoi420FrameImpl.h
GMPVideoPlaneImpl.cpp
GMPVideoPlaneImpl.h
moz.build Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
mozIGeckoMediaPluginChromeService.idl
mozIGeckoMediaPluginService.idl Bug 1329543 - Remove PGMPAudioDecoder. r=gerald 2017-01-14 16:14:32 +08:00
PChromiumCDM.ipdl Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
PGMP.ipdl Store the child process thread id in CrashReporterHost. (bug 1338281 part 2, r=billm) 2017-02-15 14:44:29 -08:00
PGMPContent.ipdl Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald 2017-02-23 11:51:00 +13:00
PGMPDecryptor.ipdl Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
PGMPService.ipdl Bug 1321871, part 1 - Replace use of opens and bridges in GMP protocols with endpoints. r=peterv 2017-01-05 12:55:27 -08:00
PGMPStorage.ipdl Bug 1332530 - Remove GMP enum storage names. r=gerald 2017-01-20 15:06:00 +13:00
PGMPTimer.ipdl
PGMPVideoDecoder.ipdl
PGMPVideoEncoder.ipdl
README.txt

This directory contains code supporting Gecko Media Plugins (GMPs). The GMP API is not the same thing as the Media Plugin API (MPAPI).