# HG changeset patch # User Nathan Froyd # Date 1547154817 18000 # Node ID 20e70e44d305ae18eca2ff3b4af5cb46ef549082 # Parent 221c61c5af4a43df314bca50f82acd1dae890ab8 Bug 1518922 - part 2 - remove GetChildProcessTmpDir; r=gsvelto After part 1, this function and the code associated with it is no longer used. diff --git a/toolkit/crashreporter/nsDummyExceptionHandler.cpp b/toolkit/crashreporter/nsDummyExceptionHandler.cpp --- a/toolkit/crashreporter/nsDummyExceptionHandler.cpp +++ b/toolkit/crashreporter/nsDummyExceptionHandler.cpp @@ -162,18 +162,16 @@ bool AppendExtraData(const nsAString& id } bool AppendExtraData(nsIFile* extraFile, const AnnotationTable& data) { return false; } void OOPInit() {} -void GetChildProcessTmpDir(nsIFile** aOutTmpDir) {} - #if defined(XP_WIN) || defined(XP_MACOSX) const char* GetChildNotificationPipe() { return nullptr; } #endif #ifdef MOZ_CRASHREPORTER_INJECTOR void InjectCrashReporterIntoProcess(DWORD processID, InjectorCrashCallback* cb) {} diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -237,21 +237,16 @@ static bool isSafeToDump = false; static bool sIncludeContextHeap = false; // OOP crash reporting static CrashGenerationServer* crashServer; // chrome process has this static std::map processToCrashFd; static std::terminate_handler oldTerminateHandler = nullptr; -#if (defined(XP_MACOSX) || defined(XP_WIN)) -// This field is valid in both chrome and content processes. -static xpstring* childProcessTmpDir = nullptr; -#endif - #if defined(XP_WIN) || defined(XP_MACOSX) // If crash reporting is disabled, we hand out this "null" pipe to the // child process and don't attempt to connect to a parent server. static const char kNullNotifyPipe[] = "-"; static char* childCrashNotifyPipe; #elif defined(XP_LINUX) static int serverSocketFd = -1; @@ -2996,36 +2991,16 @@ void OOPInit() { if (OOPInitialized()) return; MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(gExceptionHandler != nullptr, "attempt to initialize OOP crash reporter before in-process " "crashreporter!"); -#if (defined(XP_WIN) || defined(XP_MACOSX)) - nsCOMPtr tmpDir; -#if defined(MOZ_CONTENT_SANDBOX) - nsresult rv = NS_GetSpecialDirectory(NS_APP_CONTENT_PROCESS_TEMP_DIR, - getter_AddRefs(tmpDir)); - if (NS_FAILED(rv) && PR_GetEnv("XPCSHELL_TEST_PROFILE_DIR")) { - // Temporary hack for xpcshell, will be fixed in bug 1257098 - rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpDir)); - } - if (NS_SUCCEEDED(rv)) { - childProcessTmpDir = CreatePathFromFile(tmpDir); - } -#else - if (NS_SUCCEEDED( - NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpDir)))) { - childProcessTmpDir = CreatePathFromFile(tmpDir); - } -#endif // defined(MOZ_CONTENT_SANDBOX) -#endif // (defined(XP_WIN) || defined(XP_MACOSX)) - #if defined(XP_WIN) childCrashNotifyPipe = mozilla::Smprintf("\\\\.\\pipe\\gecko-crash-server-pipe.%i", static_cast(::GetCurrentProcessId())) .release(); const std::wstring dumpPath = gExceptionHandler->dump_path(); crashServer = new CrashGenerationServer( @@ -3100,25 +3075,16 @@ static void OOPDeinit() { pidToMinidump = nullptr; #if defined(XP_WIN) || defined(XP_MACOSX) free(childCrashNotifyPipe); childCrashNotifyPipe = nullptr; #endif } -void GetChildProcessTmpDir(nsIFile** aOutTmpDir) { - MOZ_ASSERT(XRE_IsParentProcess()); -#if (defined(XP_MACOSX) || defined(XP_WIN)) - if (childProcessTmpDir) { - CreateFileFromPath(*childProcessTmpDir, aOutTmpDir); - } -#endif -} - #if defined(XP_WIN) || defined(XP_MACOSX) // Parent-side API for children const char* GetChildNotificationPipe() { if (!GetEnabled()) return kNullNotifyPipe; MOZ_ASSERT(OOPInitialized()); return childCrashNotifyPipe; diff --git a/toolkit/crashreporter/nsExceptionHandler.h b/toolkit/crashreporter/nsExceptionHandler.h --- a/toolkit/crashreporter/nsExceptionHandler.h +++ b/toolkit/crashreporter/nsExceptionHandler.h @@ -230,20 +230,16 @@ bool CreateMinidumpsAndPair(ProcessHandl // a minidump (|parentMinidump|). // The resulting dump will get the id of the parent and use the |name| as // an extension. bool CreateAdditionalChildMinidump(ProcessHandle childPid, ThreadId childBlamedThread, nsIFile* parentMinidump, const nsACString& name); -// Parent-side API, returns the tmp dir for child processes to use, accounting -// for sandbox considerations. -void GetChildProcessTmpDir(nsIFile** aOutTmpDir); - #if defined(XP_WIN32) || defined(XP_MACOSX) // Parent-side API for children const char* GetChildNotificationPipe(); #ifdef MOZ_CRASHREPORTER_INJECTOR // Inject a crash report client into an arbitrary process, and inform the // callback object when it crashes. Parent process only.