[WRTjs][VD] Boost all thread for 60s for game app in lite board 55/321955/2
authorliwei90727 <wei90727.li@samsung.com>
Tue, 1 Apr 2025 09:53:39 +0000 (17:53 +0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 13 May 2025 23:35:29 +0000 (23:35 +0000)
For xbox requirement, in Lite board, boost all thread for 60s
for game app in lite board

Change-Id: I452d4e25a5f179f85b8a9ac66659515bacebef48
Signed-off-by: liwei90727 <wei90727.li@samsung.com>
wrt/src/browser/tv/wrt_native_window_tv.cc
wrt/src/common/tv/wrt_thread_booster.cc
wrt/src/common/tv/wrt_thread_booster.h

index 63486e5ea492f1e227deb6fcc2957759855bc24a..7b286dc3be50135f3275163d99b3f52454f1223a 100644 (file)
@@ -867,6 +867,9 @@ void WRTNativeWindowTV::SetAppMetaDataInfo() {
                                          "Enabled");
 
   if (enable_game_mode) {
+    if (IsLiteMemoryBoard())
+      WRT_thread_booster::GetInstance()->BoostUpAllThreads(60000);
+
     auto current_command_line = base::CommandLine::ForCurrentProcess();
     current_command_line->AppendSwitch(switches::kEnableGameMode);
     base::FieldTrialList::CreateFieldTrial("WebRTC-ForceZeroDelayInGameMode",
index 7449ad56216f6adca62079fdf9421c0db264aab5..48a61a47c7a3857b5ac24989e949b66491af934b 100644 (file)
@@ -126,6 +126,17 @@ void WRT_thread_booster::BoostUpByProNameTimeout(const std::string& name,
   boost_request_by_process_name(name.c_str(), (const boost_info_t*)&info);
 }
 
+void WRT_thread_booster::BoostUpAllThreads(int msec) {
+  boost_generic_info_t info;
+  info.parent.framework_type = BOOST_GENERIC;
+  info.event = BOOST_GENERIC_EVENT_USER_REQUEST_START;
+  info.group = BOOST_CGROUP_NORMAL;
+  info.sched = BOOST_API_SCHED_RR;
+  info.boostingTimeMs = msec;
+  LOG(INFO) << "boost up all threads timeout [" << msec << "] ms";
+  boost_request_by_pid(current_pid, (const boost_info_t*)&info);
+}
+
 #else
 WRT_thread_booster::WRT_thread_booster() {}
 void WRT_thread_booster::RegisterThreadByName(std::string name) {}
@@ -139,6 +150,8 @@ void WRT_thread_booster::BoostUpByThreadNameTimeout(std::string name,
                                                     int msec) {}
 void WRT_thread_booster::BoostUpByProNameTimeout(const std::string& name,
                                                  int msec) {}
+void WRT_thread_booster::BoostUpAllThreads(int msec) {}
+
 #endif
 
 }  // namespace wrt
index 9793f79de3135dfc171ad61661f71386e7aa8b9b..c0cb79c15a5c4286881c8886feb0ae0ba7c258db 100644 (file)
@@ -26,6 +26,8 @@ class WRT_thread_booster {
   void BoostUpByThreadNameTimeout(std::string name, int msec);
   void BoostUpByProNameTimeout(const std::string& name, int msec);
 
+  void BoostUpAllThreads(int msec);
+
   WRT_thread_booster();
   ~WRT_thread_booster() = default;