Bug 1672858 - Handle RDD process crashes when looking up textures in the GPU process. r=jya
authorMatt Woodrow <mwoodrow@mozilla.com>
Sun, 25 Oct 2020 07:46:04 +0000
changeset 554349 f08534dd3713d20de0090e7d16ae9a465ed891b3
parent 554348 2481a9cb04ac33016b4ece124f8e5c9234cb5391
child 554350 a4341527c628b3ba77159a421f70da5adf9f8d54
push id37892
push usernbeleuzu@mozilla.com
push dateSun, 25 Oct 2020 21:41:16 +0000
treeherdermozilla-central@61c35792ca70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1672858
milestone84.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 1672858 - Handle RDD process crashes when looking up textures in the GPU process. r=jya Differential Revision: https://phabricator.services.mozilla.com/D94546
gfx/layers/composite/GPUVideoTextureHost.cpp
--- a/gfx/layers/composite/GPUVideoTextureHost.cpp
+++ b/gfx/layers/composite/GPUVideoTextureHost.cpp
@@ -33,18 +33,23 @@ GPUVideoTextureHost* GPUVideoTextureHost
 
 TextureHost* GPUVideoTextureHost::EnsureWrappedTextureHost() {
   if (mWrappedTextureHost) {
     return mWrappedTextureHost;
   }
 
   const auto& sd =
       static_cast<const SurfaceDescriptorRemoteDecoder&>(mDescriptor);
-  mWrappedTextureHost =
-      VideoBridgeParent::GetSingleton(sd.source())->LookupTexture(sd.handle());
+  VideoBridgeParent* parent = VideoBridgeParent::GetSingleton(sd.source());
+  if (!parent) {
+    // The VideoBridge went away. This can happen if the RDD process
+    // crashes.
+    return nullptr;
+  }
+  mWrappedTextureHost = parent->LookupTexture(sd.handle());
 
   if (!mWrappedTextureHost) {
     // The TextureHost hasn't been registered yet. This is due to a race
     // between the ImageBridge (content) and the VideoBridge (RDD) and the
     // ImageBridge won. See bug
     // https://bugzilla.mozilla.org/show_bug.cgi?id=1630733#c14 for more
     // details.
     return nullptr;