Bug 1065881 - [e10s] Crash on child process shutdown in ShadowLayerForwarder::InWorkerThread
authorDavid Parks <davidp99@gmail.com>
Sun, 12 Oct 2014 16:23:20 -0700
changeset 210765 450728938eb2f9af60589bde6fabe4fbd87264c5
parent 210764 3a53ee57c736e74a9a8d3f716ecc5aa2c062108f
child 210766 a0c0f98c848250cabe0e9f883a34283b9bd80959
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1065881
milestone36.0a1
Bug 1065881 - [e10s] Crash on child process shutdown in ShadowLayerForwarder::InWorkerThread Had caused a crash in the test_streams_element_capture mochitest on Windows. The issue was that the audio decoder thread was destroying stale media frames by releasing a reference to them. This was causing the release of an Image on that thread, but that thread does not process a MessageLoop so the current MessageLoop is null. This is not a problem. Obviously, any thread that has no MessageLoop can't be the worker thread.
content/media/test/mochitest.ini
gfx/layers/ipc/ShadowLayers.cpp
--- a/content/media/test/mochitest.ini
+++ b/content/media/test/mochitest.ini
@@ -455,17 +455,16 @@ skip-if = true # bug 1021673
 [test_seekLies.html]
 [test_source.html]
 [test_source_media.html]
 [test_source_null.html]
 [test_source_write.html]
 [test_standalone.html]
 [test_streams_autoplay.html]
 [test_streams_element_capture.html]
-skip-if = e10s && os == 'win' # Bug 1065881 - Crash on child process shutdown in ShadowLayerForwarder::InWorkerThread
 [test_streams_element_capture_createObjectURL.html]
 [test_streams_element_capture_playback.html]
 [test_streams_element_capture_reset.html]
 [test_streams_gc.html]
 skip-if = buildapp == 'b2g' # bug 1021682
 [test_streams_srcObject.html]
 [test_streams_tracks.html]
 [test_texttrack.html]
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -489,17 +489,17 @@ ShadowLayerForwarder::RemoveTextureFromC
   }
   CompositableClient::HoldUntilComplete(aCompositable->GetIPDLActor(),
                                         aAsyncTransactionTracker);
 }
 
 bool
 ShadowLayerForwarder::InWorkerThread()
 {
-  return GetMessageLoop()->id() == MessageLoop::current()->id();
+  return MessageLoop::current() && (GetMessageLoop()->id() == MessageLoop::current()->id());
 }
 
 static void RemoveTextureWorker(TextureClient* aTexture, ReentrantMonitor* aBarrier, bool* aDone)
 {
   aTexture->ForceRemove();
 
   ReentrantMonitorAutoEnter autoMon(*aBarrier);
   *aDone = true;