Bug 1198302 - Ensure that PluginAsyncSurrogate::NotifyAsyncInitFailed properly aborts any PluginAsyncSurrogate::WaitForInit calls. r=jimm
authorAaron Klotz <aklotz@mozilla.com>
Thu, 27 Aug 2015 16:14:16 -0600
changeset 259874 1a6139dad4b195e854561aef275ac81765124516
parent 259873 99439a497979be5acda1c17a11a597b228d0dff1
child 259875 328a1fa58f56810e29d62b5296a15285deca16ee
push id29296
push userryanvm@gmail.com
push dateSun, 30 Aug 2015 19:45:10 +0000
treeherdermozilla-central@2ad5077d86ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1198302
milestone43.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 1198302 - Ensure that PluginAsyncSurrogate::NotifyAsyncInitFailed properly aborts any PluginAsyncSurrogate::WaitForInit calls. r=jimm
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();