From c9012150fb856517fe7de694e6c2fdd066cc15c0 Mon Sep 17 00:00:00 2001 From: Jed Davis Date: Wed, 9 Aug 2023 21:35:49 +0000 Subject: [PATCH] Bug 1840515 - Step 0: Use GeckoArgs for the `-greomni` and `-appomni` flags. r=nika The `-appomni` flag isn't currently used, but the next patch will bring it back and change how both flags are processed in child processes. Differential Revision: https://phabricator.services.mozilla.com/D185330 --- ipc/glue/GeckoChildProcessHost.cpp | 3 +-- toolkit/xre/GeckoArgs.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index 406fd59fb607..708e56ff3878 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -1263,8 +1263,7 @@ Result PosixProcessLauncher::DoSetup() { nsAutoCString path; nsCOMPtr file = Omnijar::GetPath(Omnijar::GRE); if (file && NS_SUCCEEDED(file->GetNativePath(path))) { - mChildArgv.push_back("-greomni"); - mChildArgv.push_back(path.get()); + geckoargs::sGREOmni.Put(path.get(), mChildArgv); } } # endif diff --git a/toolkit/xre/GeckoArgs.h b/toolkit/xre/GeckoArgs.h index 667ddb4ba494..7c0a3a9ad01e 100644 --- a/toolkit/xre/GeckoArgs.h +++ b/toolkit/xre/GeckoArgs.h @@ -109,6 +109,8 @@ inline void CommandLineArg::Put(uint64_t aValue, static CommandLineArg sParentBuildID{"-parentBuildID", "parentbuildid"}; static CommandLineArg sAppDir{"-appDir", "appdir"}; +static CommandLineArg sGREOmni{"-greomni", "greomni"}; +static CommandLineArg sAppOmni{"-appomni", "appomni"}; static CommandLineArg sProfile{"-profile", "profile"}; static CommandLineArg sJsInitHandle{"-jsInitHandle", "jsinithandle"};