Bug 1174064 - Ensure we don't try to reuse a GMP doing async shutdown. r=edwin
authorChris Pearce <cpearce@mozilla.com>
Fri, 12 Jun 2015 21:36:48 +1200
changeset 266677 bd9902d39e751c53210999c6243e4d2780cb1d59
parent 266676 d3df23a5ad6281a27d2306e3aee99add48045fb9
child 266678 ba30453354484e7518102ae4b97e58eacec71ed0
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1174064
milestone41.0a1
Bug 1174064 - Ensure we don't try to reuse a GMP doing async shutdown. r=edwin
dom/media/gmp/GMPParent.cpp
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -803,29 +803,31 @@ GMPParent::ReadGMPMetaData()
   }
 
   return NS_OK;
 }
 
 bool
 GMPParent::CanBeSharedCrossNodeIds() const
 {
-  return mNodeId.IsEmpty() &&
-    // XXX bug 1159300 hack -- maybe remove after openh264 1.4
-    // We don't want to use CDM decoders for non-encrypted playback
-    // just yet; especially not for WebRTC. Don't allow CDMs to be used
-    // without a node ID.
-    !mCanDecrypt;
+  return !mAsyncShutdownInProgress &&
+         mNodeId.IsEmpty() &&
+         // XXX bug 1159300 hack -- maybe remove after openh264 1.4
+         // We don't want to use CDM decoders for non-encrypted playback
+         // just yet; especially not for WebRTC. Don't allow CDMs to be used
+         // without a node ID.
+         !mCanDecrypt;
 }
 
 bool
 GMPParent::CanBeUsedFrom(const nsACString& aNodeId) const
 {
-  return (mNodeId.IsEmpty() && State() == GMPStateNotLoaded) ||
-         mNodeId == aNodeId;
+  return !mAsyncShutdownInProgress &&
+         ((mNodeId.IsEmpty() && State() == GMPStateNotLoaded) ||
+          mNodeId == aNodeId);
 }
 
 void
 GMPParent::SetNodeId(const nsACString& aNodeId)
 {
   MOZ_ASSERT(!aNodeId.IsEmpty());
   MOZ_ASSERT(CanBeUsedFrom(aNodeId));
   mNodeId = aNodeId;