Bug 1087464 - Use the correct ContentParent when Nuwa forks PBackground actors. r=khuey, a=lsblakk
authorBen Turner <bent.mozilla@gmail.com>
Thu, 23 Oct 2014 20:13:25 -0400
changeset 233502 c11621d7a35ca32a0398e68f4b0a80dca52f32e1
parent 233501 a6414ad2ef81750886f1ddcafa3e36d4597507ec
child 233503 881c8b3944da07325f61b4c808b4bdbe13e3dc6f
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, lsblakk
bugs1087464
milestone35.0a2
Bug 1087464 - Use the correct ContentParent when Nuwa forks PBackground actors. r=khuey, a=lsblakk
ipc/glue/BackgroundImpl.cpp
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -1342,33 +1342,34 @@ ParentImpl::MainThreadActorDestroy()
 
 IToplevelProtocol*
 ParentImpl::CloneToplevel(const InfallibleTArray<ProtocolFdMapping>& aFds,
                           ProcessHandle aPeerProcess,
                           ProtocolCloneContext* aCtx)
 {
   AssertIsInMainProcess();
   AssertIsOnMainThread();
+  MOZ_ASSERT(aCtx->GetContentParent());
 
   const ProtocolId protocolId = GetProtocolId();
 
   for (unsigned int i = 0; i < aFds.Length(); i++) {
     if (static_cast<ProtocolId>(aFds[i].protocolId()) != protocolId) {
       continue;
     }
 
     Transport* transport = OpenDescriptor(aFds[i].fd(),
                                           Transport::MODE_SERVER);
     if (!transport) {
       NS_WARNING("Failed to open transport!");
       break;
     }
 
     PBackgroundParent* clonedActor =
-      Alloc(mContent, transport, base::GetProcId(aPeerProcess));
+      Alloc(aCtx->GetContentParent(), transport, base::GetProcId(aPeerProcess));
     MOZ_ASSERT(clonedActor);
 
     clonedActor->CloneManagees(this, aCtx);
     clonedActor->SetTransport(transport);
 
     return clonedActor;
   }