Bug 1088300 - Don't attempt to paint a ClientLayerManager if IPC is down (take two). r=dvander a=ritu FIREFOX_50_0b9_BUILD1 FIREFOX_50_0b9_RELEASE
authorNicolas Silva <nsilva@mozilla.com>
Wed, 12 Oct 2016 14:23:32 +0200
changeset 428906 2bb6dc758711c00d84246d74b57e5aa6cae4b447
parent 428905 d4fe6876afeb14bfa005e24b9e47260d9a2b4e1c
child 428907 e4e6022059e5c35d3b1bbc731b1f68f266302be3
push id33416
push userpaul@paul.cx
push dateMon, 24 Oct 2016 16:26:20 +0000
reviewersdvander, ritu
bugs1088300
milestone50.0
Bug 1088300 - Don't attempt to paint a ClientLayerManager if IPC is down (take two). r=dvander a=ritu
gfx/layers/client/ClientLayerManager.cpp
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -328,16 +328,22 @@ ClientLayerManager::StorePluginWidgetCon
   }
 }
 
 void
 ClientLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
                                    void* aCallbackData,
                                    EndTransactionFlags aFlags)
 {
+  if (!mForwarder->IPCOpen()) {
+    mTransactionIdAllocator->RevokeTransactionId(mLatestTransactionId);
+    mInTransaction = false;
+    return;
+  }
+
   if (mWidget) {
     mWidget->PrepareWindowEffects();
   }
   EndTransactionInternal(aCallback, aCallbackData, aFlags);
   ForwardTransaction(!(aFlags & END_NO_REMOTE_COMPOSITE));
 
   if (mRepeatTransaction) {
     mRepeatTransaction = false;
@@ -353,19 +359,21 @@ ClientLayerManager::EndTransaction(DrawP
   mTransactionStart = TimeStamp();
 }
 
 bool
 ClientLayerManager::EndEmptyTransaction(EndTransactionFlags aFlags)
 {
   mInTransaction = false;
 
-  if (!mRoot) {
+  if (!mRoot || !mForwarder->IPCOpen()) {
+    mTransactionIdAllocator->RevokeTransactionId(mLatestTransactionId);
     return false;
   }
+
   if (!EndTransactionInternal(nullptr, nullptr, aFlags)) {
     // Return without calling ForwardTransaction. This leaves the
     // ShadowLayerForwarder transaction open; the following
     // EndTransaction will complete it.
     return false;
   }
   if (mWidget) {
     mWidget->PrepareWindowEffects();