Bug 1198302 - Ensure that PluginAsyncSurrogate::NotifyAsyncInitFailed properly aborts any PluginAsyncSurrogate::WaitForInit calls. r=jimm, a=ritu
authorAaron Klotz <aklotz@mozilla.com>
Thu, 27 Aug 2015 16:14:16 -0600
changeset 282107 cc07ed95653e2e31af6976fb8df4ce3fafd71417
parent 282106 5d3f403db22618ef0139bf9d02c81d15ad6d229c
child 282108 e2c3777c5e82aa526e59955a98d9d5dc2dc5996f
push id5009
push userryanvm@gmail.com
push dateMon, 31 Aug 2015 19:40:38 +0000
treeherdermozilla-beta@cc07ed95653e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, ritu
bugs1198302
milestone41.0
Bug 1198302 - Ensure that PluginAsyncSurrogate::NotifyAsyncInitFailed properly aborts any PluginAsyncSurrogate::WaitForInit calls. r=jimm, a=ritu
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();