Bug 1213758 - Aquire the inderect layer trees data lock during plugin window update calculations. r=matt.woodrow
authorJim Mathies <jmathies@mozilla.com>
Mon, 19 Oct 2015 10:38:42 -0500
changeset 268333 938c7a3c65e4875a1fb960c3a51c327e5cfee19f
parent 268332 831c479eb4217171fee1410247d17ab69d896ce7
child 268334 59588063362c741672381032638d1f38a82668c2
push id66774
push userjmathies@mozilla.com
push dateMon, 19 Oct 2015 15:38:46 +0000
treeherdermozilla-inbound@eddce960bab6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmatt.woodrow
bugs1213758
milestone44.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 1213758 - Aquire the inderect layer trees data lock during plugin window update calculations. r=matt.woodrow
gfx/layers/ipc/CompositorParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -2052,17 +2052,23 @@ CrossProcessCompositorParent::ShadowLaye
 //#define PLUGINS_LOG(...) printf_stderr("CP [%s]: ", __FUNCTION__);
 //                         printf_stderr(__VA_ARGS__);
 //                         printf_stderr("\n");
 #define PLUGINS_LOG(...)
 
 bool
 CompositorParent::UpdatePluginWindowState(uint64_t aId)
 {
+  MonitorAutoLock lock(*sIndirectLayerTreesLock);
   CompositorParent::LayerTreeState& lts = sIndirectLayerTrees[aId];
+  if (!lts.mParent) {
+    PLUGINS_LOG("[%" PRIu64 "] layer tree compositor parent pointer is null", aId);
+    return false;
+  }
+
   // Check if this layer tree has received any shadow layer updates
   if (!lts.mUpdatedPluginDataAvailable) {
     PLUGINS_LOG("[%" PRIu64 "] no plugin data", aId);
     return false;
   }
 
   // pluginMetricsChanged tracks whether we need to send plugin update
   // data to the main thread. If we do we'll have to block composition,