Bug 1386404 - Don't try to fetch the content process tmpdir if sandboxing is disabled. r?jld
MozReview-Commit-ID: zaWPy4rt1J
--- 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.