Bug 1198302 - Ensure that PluginAsyncSurrogate::NotifyAsyncInitFailed properly aborts any PluginAsyncSurrogate::WaitForInit calls. r=jimm, a=sledru
authorAaron Klotz <aklotz@mozilla.com>
Thu, 27 Aug 2015 16:14:16 -0600
changeset 289033 179a6b8926096f2dd4e75748ca775bfa7acb3619
parent 289032 97c700862ca4fc2651a61e0e96d25a4dad9b7788
child 289034 c92238c774388593f3e0c0782f8cdc47d33069cd
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, sledru
bugs1198302
milestone42.0a2
Bug 1198302 - Ensure that PluginAsyncSurrogate::NotifyAsyncInitFailed properly aborts any PluginAsyncSurrogate::WaitForInit calls. r=jimm, a=sledru
dom/plugins/ipc/PluginAsyncSurrogate.cpp
--- a/dom/plugins/ipc/PluginAsyncSurrogate.cpp
+++ b/dom/plugins/ipc/PluginAsyncSurrogate.cpp
@@ -560,16 +560,20 @@ PluginAsyncSurrogate::NotifyAsyncInitFai
     // Clean up any pending NewStream requests
     for (uint32_t i = 0, len = mPendingNewStreamCalls.Length(); i < len; ++i) {
       PendingNewStreamCall& curPendingCall = mPendingNewStreamCalls[i];
       DestroyAsyncStream(curPendingCall.mStream);
     }
   }
   mPendingNewStreamCalls.Clear();
 
+  // Make sure that any WaitForInit calls on this surrogate will fail, or else
+  // we'll be perma-blocked
+  mInitCancelled = true;
+
   nsNPAPIPluginInstance* inst =
     static_cast<nsNPAPIPluginInstance*>(mInstance->ndata);
   if (!inst) {
       return;
   }
   nsPluginInstanceOwner* owner = inst->GetOwner();
   MOZ_ASSERT(owner);
   owner->NotifyHostAsyncInitFailed();