Bug 1193861: Log to the process log when launching a sandboxed process on Windows. r=billm
authorBob Owen <bobowencode@gmail.com>
Tue, 09 Feb 2016 08:31:18 +0000
changeset 329789 bd5d1c3f3c1e6f8a6161a50657044829b573cca6
parent 329788 35cdc40a44c45870ff5ba300ec504765eb87f0db
child 329790 92029305820c163ad08e1cbb5e8783f96d8c49b9
push id10611
push userdmitchell@mozilla.com
push dateTue, 09 Feb 2016 15:15:43 +0000
reviewersbillm
bugs1193861
milestone47.0a1
Bug 1193861: Log to the process log when launching a sandboxed process on Windows. r=billm
ipc/glue/GeckoChildProcessHost.cpp
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -1022,20 +1022,25 @@ GeckoChildProcessHost::PerformAsyncLaunc
     UTF8ToWide(CrashReporter::GetChildNotificationPipe()));
 #endif
 
   // Process type
   cmdLine.AppendLooseValue(UTF8ToWide(childProcessType));
 
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
   if (shouldSandboxCurrentProcess) {
-    mSandboxBroker.LaunchApp(cmdLine.program().c_str(),
-                             cmdLine.command_line_string().c_str(),
-                             mEnableSandboxLogging,
-                             &process);
+    if (mSandboxBroker.LaunchApp(cmdLine.program().c_str(),
+                                 cmdLine.command_line_string().c_str(),
+                                 mEnableSandboxLogging,
+                                 &process)) {
+      EnvironmentLog("MOZ_PROCESS_LOG").print(
+        "==> process %d launched child process %d (%S)\n",
+        base::GetCurrentProcId(), base::GetProcId(process),
+        cmdLine.command_line_string());
+    }
   } else
 #endif
   {
     base::LaunchApp(cmdLine, false, false, &process);
 
 #ifdef MOZ_SANDBOX
     // We need to be able to duplicate handles to non-sandboxed content
     // processes, so add it as a target peer.