mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: correct linux zygote process titles (#50533)
* fix: correct linux zygote process titles Co-authored-by: Mitchell Cohen <mitch.cohen@me.com> * pass argv on mac as well Co-authored-by: Mitchell Cohen <mitch.cohen@me.com> * lint Co-authored-by: Mitchell Cohen <mitch.cohen@me.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Mitchell Cohen <mitch.cohen@me.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "base/apple/scoped_nsautorelease_pool.h"
|
||||
#include "base/at_exit.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/i18n/icu_util.h"
|
||||
#include "base/notreached.h"
|
||||
#include "content/public/app/content_main.h"
|
||||
@@ -33,7 +34,10 @@ int ElectronMain(int argc, char* argv[]) {
|
||||
delegate.OverrideFrameworkBundlePath();
|
||||
delegate.SetUpBundleOverrides();
|
||||
|
||||
return content::ContentMain(content::ContentMainParams{&delegate});
|
||||
content::ContentMainParams params{&delegate};
|
||||
params.argc = argc;
|
||||
params.argv = UNSAFE_BUFFERS(const_cast<const char**>(argv));
|
||||
return content::ContentMain(std::move(params));
|
||||
}
|
||||
|
||||
int ElectronInitializeICUandStartNode(int argc, char* argv[]) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "base/at_exit.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/i18n/icu_util.h"
|
||||
#include "base/strings/cstring_view.h"
|
||||
#include "content/public/app/content_main.h"
|
||||
@@ -29,6 +30,9 @@ namespace {
|
||||
int main(int argc, char* argv[]) {
|
||||
FixStdioStreams();
|
||||
|
||||
// Chromium expects the original argv in its original memory location
|
||||
// to update /proc/<pid>/cmdline.
|
||||
const char** original_argv = UNSAFE_BUFFERS(const_cast<const char**>(argv));
|
||||
argv = uv_setup_args(argc, argv);
|
||||
base::CommandLine::Init(argc, argv);
|
||||
electron::ElectronCommandLine::Init(argc, argv);
|
||||
@@ -40,5 +44,8 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
electron::ElectronMainDelegate delegate;
|
||||
return content::ContentMain(content::ContentMainParams{&delegate});
|
||||
content::ContentMainParams params{&delegate};
|
||||
params.argc = argc;
|
||||
params.argv = original_argv;
|
||||
return content::ContentMain(std::move(params));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user