Bug 1288569 - Add more mCanSend checks r=nical
authorSotaro Ikeda <sotaro.ikeda.g@gmail.com>
Fri, 22 Jul 2016 02:42:22 -0700
changeset 306174 13a135813767793c0ac1d185d4983b222b29d9c4
parent 306173 1198cb175ed76649ba303012db91b9793d5a14b5
child 306175 76b04196acceb86e55d7a2cdc2fa62f53a756f14
push id79798
push usersikeda@mozilla.com
push dateFri, 22 Jul 2016 09:42:49 +0000
treeherdermozilla-inbound@13a135813767 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1288569
milestone50.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 1288569 - Add more mCanSend checks r=nical
gfx/layers/ipc/CompositorBridgeChild.cpp
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -286,16 +286,19 @@ CompositorBridgeChild::RecvCompositorUpd
 {
   if (mLayerManager) {
     // This case is handled directly by nsBaseWidget.
     MOZ_ASSERT(aLayersId == 0);
   } else if (aLayersId != 0) {
     if (dom::TabChild* child = dom::TabChild::GetFrom(aLayersId)) {
       child->CompositorUpdated(aNewIdentifier);
     }
+    if (!mCanSend) {
+      return true;
+    }
     SendAcknowledgeCompositorUpdate(aLayersId);
   }
   return true;
 }
 
 #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
 static void CalculatePluginClip(const LayoutDeviceIntRect& aBounds,
                                 const nsTArray<LayoutDeviceIntRect>& aPluginClipRects,
@@ -411,16 +414,19 @@ CompositorBridgeChild::RecvUpdatePluginC
 #endif
         visiblePluginIds.AppendElement(aPlugins[pluginsIdx].windowId());
       }
     }
   }
   // Any plugins we didn't update need to be hidden, as they are
   // not associated with visible content.
   nsIWidget::UpdateRegisteredPluginWindowVisibility((uintptr_t)parent, visiblePluginIds);
+  if (!mCanSend) {
+    return true;
+  }
   SendRemotePluginsReady();
   return true;
 #endif // !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
 }
 
 #if defined(XP_WIN)
 static void
 ScheduleSendAllPluginsCaptured(CompositorBridgeChild* aThis, MessageLoop* aLoop)
@@ -456,16 +462,19 @@ CompositorBridgeChild::RecvHideAllPlugin
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
   NS_NOTREACHED("CompositorBridgeChild::RecvHideAllPlugins calls "
                 "unexpected on this platform.");
   return false;
 #else
   MOZ_ASSERT(NS_IsMainThread());
   nsTArray<uintptr_t> list;
   nsIWidget::UpdateRegisteredPluginWindowVisibility(aParentWidget, list);
+  if (!mCanSend) {
+    return true;
+  }
   SendRemotePluginsReady();
   return true;
 #endif // !defined(XP_WIN) && !defined(MOZ_WIDGET_GTK)
 }
 
 bool
 CompositorBridgeChild::RecvDidComposite(const uint64_t& aId, const uint64_t& aTransactionId,
                                         const TimeStamp& aCompositeStart,
@@ -648,16 +657,19 @@ CompositorBridgeChild::RecvRemotePaintIs
 }
 
 
 void
 CompositorBridgeChild::RequestNotifyAfterRemotePaint(TabChild* aTabChild)
 {
   MOZ_ASSERT(aTabChild, "NULL TabChild not allowed in CompositorBridgeChild::RequestNotifyAfterRemotePaint");
   mWeakTabChild = do_GetWeakReference( static_cast<dom::TabChildBase*>(aTabChild) );
+  if (!mCanSend) {
+    return;
+  }
   Unused << SendRequestNotifyAfterRemotePaint();
 }
 
 void
 CompositorBridgeChild::CancelNotifyAfterRemotePaint(TabChild* aTabChild)
 {
   RefPtr<nsISupports> iTabChildBase(do_QueryReferent(mWeakTabChild));
   if (!iTabChildBase) {