Bug 1555076 - avoid a potential timeout race on Windows RDD launch. r=jld
authorMichael Froman <mfroman@mozilla.com>
Mon, 10 Jun 2019 15:03:46 +0000
changeset 478257 b2cb7ee93eef1d56006716ed24f3d0c11e071f11
parent 478256 975fec3b327cb034a85f5838caf2bc2d4c3a55ec
child 478258 4ea5c4fd7777b1d671a374266be98174df1c2a3c
push id87610
push usermfroman@mozilla.com
push dateTue, 11 Jun 2019 14:45:00 +0000
treeherderautoland@b2cb7ee93eef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1555076
milestone69.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 1555076 - avoid a potential timeout race on Windows RDD launch. r=jld Differential Revision: https://phabricator.services.mozilla.com/D34186
dom/media/ipc/RDDProcessHost.cpp
--- a/dom/media/ipc/RDDProcessHost.cpp
+++ b/dom/media/ipc/RDDProcessHost.cpp
@@ -142,25 +142,30 @@ void RDDProcessHost::OnChannelErrorTask(
 
 static uint64_t sRDDProcessTokenCounter = 0;
 
 void RDDProcessHost::InitAfterConnect(bool aSucceeded) {
   MOZ_ASSERT(mLaunchPhase == LaunchPhase::Waiting);
   MOZ_ASSERT(!mRDDChild);
 
   mLaunchPhase = LaunchPhase::Complete;
-  mPrefSerializer = nullptr;
 
   if (aSucceeded) {
     mProcessToken = ++sRDDProcessTokenCounter;
     mRDDChild = MakeUnique<RDDChild>(this);
     DebugOnly<bool> rv =
         mRDDChild->Open(GetChannel(), base::GetProcId(GetChildProcessHandle()));
     MOZ_ASSERT(rv);
 
+    // Only clear mPrefSerializer in the success case to avoid a
+    // possible race in the case case of a timeout on Windows launch.
+    // See Bug 1555076 comment 7:
+    // https://bugzilla.mozilla.org/show_bug.cgi?id=1555076#c7
+    mPrefSerializer = nullptr;
+
     bool startMacSandbox = false;
 
 #if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
     // If the sandbox was started at launch time,
     // do not start the sandbox again.
     startMacSandbox = !sLaunchWithMacSandbox;
 #endif