Bug 852164: Adds an addiitonal check to ensure that Plugin Hang UI user response doesn't race past a cancellation. r=bsmedberg a=lsblakk
authorAaron Klotz <aklotz@mozilla.com>
Thu, 21 Mar 2013 10:37:21 +0100
changeset 132451 939d9a29867777ceb7f185a2a6d0e8f95e7fea45
parent 132450 f5d00a1b6731b94efab1887b9a586505fa72b594
child 132452 e47f2c235959220f6cd089e913de6498d44c6412
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, lsblakk
bugs852164
milestone21.0a2
Bug 852164: Adds an addiitonal check to ensure that Plugin Hang UI user response doesn't race past a cancellation. r=bsmedberg a=lsblakk
dom/plugins/ipc/PluginHangUIParent.cpp
--- a/dom/plugins/ipc/PluginHangUIParent.cpp
+++ b/dom/plugins/ipc/PluginHangUIParent.cpp
@@ -292,16 +292,20 @@ PluginHangUIParent::SendCancel()
   }
   cmd->mCode = PluginHangUICommand::HANGUI_CMD_CANCEL;
   return NS_SUCCEEDED(mMiniShm.Send());
 }
 
 bool
 PluginHangUIParent::RecvUserResponse(const unsigned int& aResponse)
 {
+  if (!mIsShowing && !(aResponse & HANGUI_USER_RESPONSE_CANCEL)) {
+    // Don't process a user response if a cancellation is already pending
+    return true;
+  }
   mLastUserResponse = aResponse;
   mResponseTicks = GetTickCount();
   mIsShowing = false;
   // responseCode: 1 = Stop, 2 = Continue, 3 = Cancel
   int responseCode;
   if (aResponse & HANGUI_USER_RESPONSE_STOP) {
     // User clicked Stop
     mModule->TerminateChildProcess(mMainThreadMessageLoop);