Bug 1305320 - Check if the PVideoDecoderManagerChild enpoint is valid before using it. r=dvander
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 27 Sep 2016 14:11:31 +1300
changeset 315306 36342f8d4114a1780bdd69e185ad899f2ab40609
parent 315305 c33c1775fe24fe536a408719ef5f6283ef075533
child 315307 d6cf880cf9ec40e5511808c04098c7c3623ab6fd
push id30747
push usercbook@mozilla.com
push dateTue, 27 Sep 2016 09:22:00 +0000
treeherdermozilla-central@66a77b9bfe5d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1305320
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1305320 - Check if the PVideoDecoderManagerChild enpoint is valid before using it. r=dvander
dom/media/ipc/VideoDecoderManagerChild.cpp
--- a/dom/media/ipc/VideoDecoderManagerChild.cpp
+++ b/dom/media/ipc/VideoDecoderManagerChild.cpp
@@ -47,19 +47,19 @@ VideoDecoderManagerChild::Initialize()
       AbstractThread::CreateXPCOMThreadWrapper(childThread, false);
   }
 
   Endpoint<PVideoDecoderManagerChild> endpoint;
   if (!ContentChild::GetSingleton()->SendInitVideoDecoderManager(&endpoint)) {
     return;
   }
 
-  // TODO: The above message should return an empty endpoint if there wasn't a GPU
-  // process. Unfortunately IPDL will assert in this case, so it can't actually
-  // happen. Bug 1302009 is filed for fixing this.
+  if (!endpoint.IsValid()) {
+    return;
+  }
 
   sDecoderManager = new VideoDecoderManagerChild();
 
   RefPtr<Runnable> task = NewRunnableMethod<Endpoint<PVideoDecoderManagerChild>&&>(
     sDecoderManager, &VideoDecoderManagerChild::Open, Move(endpoint));
   sVideoDecoderChildThread->Dispatch(task.forget(), NS_DISPATCH_NORMAL);
 #else
   return;