Bug 1285157 - Remove SetTransport(aChannel) for NUWA r=cyu
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Thu, 07 Jul 2016 10:07:24 +0200
changeset 304597 fcfa26398425779f0dc87fc4658f2ebcc6f6f8cb
parent 304596 722bbf56e5da51370ef420212e23e96399857335
child 304598 0abc7b2bbc1f95884ccd580886661e6eff1fc0ea
child 304608 965a291ce94981239d55bb1cf45e1279faa788a9
push id30558
push useralissy@mozilla.com
push dateTue, 12 Jul 2016 09:16:40 +0000
treeherderautoland@fcfa26398425 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscyu
bugs1285157
milestone50.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 1285157 - Remove SetTransport(aChannel) for NUWA r=cyu MozReview-Commit-ID: HR8r9flyJDQ
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
ipc/glue/ProcessUtils_linux.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -624,20 +624,16 @@ ContentChild::Init(MessageLoop* aIOLoop,
   nsQAppInstance::AddRef();
 #endif
 
 #ifdef MOZ_X11
   // Do this after initializing GDK, or GDK will install its own handler.
   XRE_InstallX11ErrorHandler();
 #endif
 
-#ifdef MOZ_NUWA_PROCESS
-  SetTransport(aChannel);
-#endif
-
   NS_ASSERTION(!sSingleton, "only one ContentChild per child");
 
   // Once we start sending IPC messages, we need the thread manager to be
   // initialized so we can deal with the responses. Do that here before we
   // try to construct the crash reporter.
   nsresult rv = nsThreadManager::get()->Init();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2313,17 +2313,16 @@ ContentParent::ContentParent(ContentPare
 
   NS_ASSERTION(fd != nullptr, "IPC Channel for PContent is necessary!");
   mSubprocess = new GeckoExistingProcessHost(GeckoProcessType_Content,
                                              aPid, *fd);
 
   mSubprocess->LaunchAndWaitForProcessHandle();
 
   // Clone actors routed by aTemplate for this instance.
-  IToplevelProtocol::SetTransport(mSubprocess->GetChannel());
   ProtocolCloneContext cloneContext;
   cloneContext.SetContentParent(this);
   CloneManagees(aTemplate, &cloneContext);
   CloneOpenedToplevels(aTemplate, aFds, aPid, &cloneContext);
 
   Open(mSubprocess->GetChannel(),
      base::GetProcId(mSubprocess->GetChildProcessHandle()));
 
--- a/ipc/glue/ProcessUtils_linux.cpp
+++ b/ipc/glue/ProcessUtils_linux.cpp
@@ -213,19 +213,19 @@ ProcLoaderClientGeckoInit()
     return;
   }
 
   sProcLoaderClientGeckoInitialized = true;
 
   TransportDescriptor fd;
   fd.mFd = base::FileDescriptor(sProcLoaderChannelFd, /*auto_close=*/ false);
   sProcLoaderChannelFd = -1;
-  Transport *transport = OpenDescriptor(fd, Transport::MODE_CLIENT);
+  UniquePtr<Transport> transport = OpenDescriptor(fd, Transport::MODE_CLIENT);
   sProcLoaderParent = new ProcLoaderParent();
-  sProcLoaderParent->Open(transport,
+  sProcLoaderParent->Open(transport.get(),
                           sProcLoaderPid,
                           XRE_GetIOMessageLoop(),
                           ParentSide);
   sProcLoaderLoop = MessageLoop::current();
 }
 
 bool ProcLoaderIsInitialized()
 {
@@ -564,21 +564,21 @@ ProcLoaderServiceRun(pid_t aPeerPid, int
 
     MOZ_ASSERT(!sProcLoaderServing);
     MessageLoop loop;
 
     nsAutoPtr<ContentProcess> process;
     process = new ContentProcess(aPeerPid);
     ChildThread *iothread = process->child_thread();
 
-    Transport *transport = OpenDescriptor(fd, Transport::MODE_CLIENT);
+    UniquePtr<Transport> transport = OpenDescriptor(fd, Transport::MODE_CLIENT);
     ProcLoaderChild *loaderChild = new ProcLoaderChild(aPeerPid);
     // Pass a message loop to initialize (connect) the channel
     // (connection).
-    loaderChild->Open(transport, aPeerPid, iothread->message_loop());
+    loaderChild->Open(transport.get(), aPeerPid, iothread->message_loop());
 
     BackgroundHangMonitor::Prohibit();
 
     sProcLoaderServing = true;
     loop.Run();
 
     BackgroundHangMonitor::Allow();