Bug 1386404 - Don't try to fetch the content process tmpdir if sandboxing is disabled. r?jld draft
authorGian-Carlo Pascutto <gcp@mozilla.com>
Tue, 09 Jan 2018 17:51:55 +0100
changeset 749382 50aaccec621d74e51db06dc2cb3d6cd2319d43d7
parent 749381 b39d5fecfea05b0bce6aebd50d922d9fe49aa98f
child 749383 705018e7091862675d3f5845d0c5dcc72dfc4d31
push id97374
push usergpascutto@mozilla.com
push dateWed, 31 Jan 2018 09:19:12 +0000
reviewersjld
bugs1386404
milestone60.0a1
Bug 1386404 - Don't try to fetch the content process tmpdir if sandboxing is disabled. r?jld MozReview-Commit-ID: zaWPy4rt1J
ipc/glue/GeckoChildProcessHost.cpp
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -274,26 +274,28 @@ GeckoChildProcessHost::PrepareLaunch()
 #if defined(MOZ_SANDBOX)
   // For other process types we can't rely on them being launched on main
   // thread and they may not have access to prefs in the child process, so allow
   // them to turn on logging via an environment variable.
   mEnableSandboxLogging = mEnableSandboxLogging
                           || !!PR_GetEnv("MOZ_SANDBOX_LOGGING");
 #endif
 #elif defined(XP_LINUX)
+#if defined(MOZ_CONTENT_SANDBOX)
   // Get and remember the path to the per-content-process tmpdir
   if (ShouldHaveDirectoryService()) {
     nsCOMPtr<nsIFile> contentTempDir;
     nsresult rv = NS_GetSpecialDirectory(NS_APP_CONTENT_PROCESS_TEMP_DIR,
-                                        getter_AddRefs(contentTempDir));
+                                         getter_AddRefs(contentTempDir));
     if (NS_SUCCEEDED(rv)) {
       contentTempDir->GetNativePath(mTmpDirName);
     }
   }
 #endif
+#endif
 }
 
 #ifdef XP_WIN
 void GeckoChildProcessHost::InitWindowsGroupID()
 {
   // On Win7+, pass the application user model to the child, so it can
   // register with it. This insures windows created by the container
   // properly group with the parent app on the Win7 taskbar.