[M120 Migration][VD][Perf] Avoid waiting for sandbox status from zygote 85/307285/4
authorjiangyuwei <yuwei.jiang@samsung.com>
Thu, 7 Mar 2024 00:37:33 +0000 (08:37 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 7 Mar 2024 05:19:47 +0000 (05:19 +0000)
to improve the browser launch time.

During initialization, the browser process wastes time waiting
until its zygote process is initialized.
The main reason for this synchronization is to avoid losing messages
between browser and zygote process.
browser does not need to wait for the synchronization before
sending messages, because messages are buffered on the zygote side

Reference:
  - https://review.tizen.org/gerrit/300627/

Change-Id: I9b4f490387eabe77e341cb2e52a7b18bee9b5de7
Signed-off-by: jiangyuwei <yuwei.jiang@samsung.com>
content/app/content_main_runner_impl.cc
content/common/zygote/zygote_communication_linux.cc

index 965b07bc438473baacd3c1309e012e68a3b245d9..1c1c7fb1d2d7a54627f600f32028ada258ef477a 100644 (file)
@@ -369,8 +369,10 @@ void InitializeZygoteSandboxForBrowserProcess(
 
   // This operation is done through the ZygoteHostImpl as a proxy because of
   // race condition concerns.
+#if !BUILDFLAG(IS_TIZEN_TV)
   ZygoteHostImpl::GetInstance()->SetRendererSandboxStatus(
       generic_zygote->GetSandboxStatus());
+#endif
 }
 #endif  // BUILDFLAG(USE_ZYGOTE)
 
index 71baf41413556f86e6c9d30476904aeca70e98d4..c03363dd679fe64a2ba081df8c7ff8bdbbaed0a3 100644 (file)
@@ -22,7 +22,9 @@
 #include "content/public/common/result_codes.h"
 #include "sandbox/policy/switches.h"
 #include "third_party/icu/source/i18n/unicode/timezone.h"
-
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "content/browser/zygote_host/zygote_host_impl_linux.h"
+#endif
 namespace content {
 
 ZygoteCommunication::ZygoteCommunication(ZygoteType type)
@@ -60,6 +62,9 @@ ssize_t ZygoteCommunication::ReadSandboxStatus() {
   if (bytes_read != sizeof(sandbox_status_)) {
     return -1;
   }
+#if BUILDFLAG(IS_TIZEN_TV)
+  ZygoteHostImpl::GetInstance()->SetRendererSandboxStatus(sandbox_status_);
+#endif
   return bytes_read;
 }