[M108 Migration][VD] Do not overwrite process title with symbolic link 52/289252/4
authorzhaosy <shiyusy.zhao@samsung.com>
Fri, 3 Mar 2023 07:40:04 +0000 (15:40 +0800)
committerBot Blink <blinkbot@samsung.com>
Mon, 6 Mar 2023 09:26:23 +0000 (09:26 +0000)
In Chromium-efl, we exec from /usr/lib/chromium-efl/efl_webprocess.
Therefore, we don't need to overwrite process title with symbolic link
of /proc/self/exe.

Before this patch, /proc/[pid]/comm of browser app is 'launchpad-loader'.
After this patch, it will be 'browser'.

Reference patch:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/269598/

Change-Id: Ic24db12dd7b447042accbc4434aa6cb18585b80c
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
content/common/set_process_title.cc

index 04a0801..cb44edf 100644 (file)
@@ -59,6 +59,9 @@ void SetProcessTitleFromCommandLine(const char** main_argv) {
   if (main_argv)
     setproctitle_init(main_argv);
 
+// In Chromium-efl, we exec from /usr/lib/chromium-efl/efl_webprocess.
+// Therefore, we can skip below processing.
+#if !BUILDFLAG(IS_EFL)
   // In Linux we sometimes exec ourselves from /proc/self/exe, but this makes us
   // show up as "exe" in process listings. Read the symlink /proc/self/exe and
   // use the path it points at for our process title. Note that this is only for
@@ -88,6 +91,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) {
     *base_name_storage = std::move(base_name);
     program_invocation_short_name = &(*base_name_storage)[0];
   }
+#endif  // !BUILDFLAG(IS_EFL)
 #endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
 
   const base::CommandLine* command_line =