Bug 1174064 - Ensure we don't try to reuse a GMP doing async shutdown. r=edwin,a=lizzard
authorChris Pearce <cpearce@mozilla.com>
Fri, 12 Jun 2015 21:36:48 +1200
changeset 266252 a6b058d20345
parent 266251 81f2a1546715
child 266253 4304c0383035
push id4802
push usercpearce@mozilla.com
push date2015-06-14 22:55 +0000
treeherdermozilla-beta@a6b058d20345 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, lizzard
bugs1174064
milestone39.0
Bug 1174064 - Ensure we don't try to reuse a GMP doing async shutdown. r=edwin,a=lizzard
dom/media/gmp/GMPParent.cpp
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -1020,29 +1020,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;