From 8f11d3f21ef1bcb724c0a04439270eb9a796fe7e Mon Sep 17 00:00:00 2001 From: zhaosy Date: Mon, 13 Mar 2023 11:03:23 +0800 Subject: [PATCH] [M108 Migration][WRTjs][VD] Optimize the policy of clear dead mount point 1. The init value of "rtc/memory/WebApp/wrtloadercount" is -1; and not all loop device is used by wrt, so define the timing of checking dead mount is 6. 2. Not check mount path is exist or not, bcz WRT move this logic to app process, if we check it, smack issue will happen. Reference: https://review.tizen.org/gerrit/288695/ Change-Id: Ia87b67a59553cc8a8cebe143f3b02849171d4a79 Signed-off-by: zhaosy --- wrt/src/browser/tv/mounter.cc | 13 +++++++------ wrt/src/browser/tv/native_web_runtime_delegate_tv.cc | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/wrt/src/browser/tv/mounter.cc b/wrt/src/browser/tv/mounter.cc index 92d542f..ae774bf 100755 --- a/wrt/src/browser/tv/mounter.cc +++ b/wrt/src/browser/tv/mounter.cc @@ -69,6 +69,10 @@ int CountMountedLoopDevices() { namespace wrt { Mounter::~Mounter() { + if (!base::PathExists(base::FilePath(mount_path_))) { + LOG(ERROR) << "Mount point does not exist: [" << mount_path_ << "]"; + return; + } PrivilegedService::GetInstance().Umount(mount_path_); } @@ -178,19 +182,16 @@ bool PrivilegedService::Mknod() { } bool PrivilegedService::Umount(const std::string& mount_path) { - if (!PS_Umount) + if (!PS_Umount) { + LOG(ERROR) << "PS_Umount not ready, that " << mount_path; return false; + } if (mount_path.empty()) { LOG(INFO) << "Mount point is empty"; return false; } - if (!base::PathExists(base::FilePath(mount_path))) { - LOG(ERROR) << "Mount point does not exist: [" << mount_path << "]"; - return false; - } - LOG(INFO) << "PS_Umount : " << mount_path; auto result = 0; auto ret_value = PS_Umount(mount_path.c_str(), mount_path.size(), 0, &result); diff --git a/wrt/src/browser/tv/native_web_runtime_delegate_tv.cc b/wrt/src/browser/tv/native_web_runtime_delegate_tv.cc index b38861f..428e0a3 100644 --- a/wrt/src/browser/tv/native_web_runtime_delegate_tv.cc +++ b/wrt/src/browser/tv/native_web_runtime_delegate_tv.cc @@ -39,6 +39,7 @@ #include "net/ssl/ssl_cert_request_info.h" #include "net/ssl/ssl_platform_key_nss.h" #include "sandbox/linux/services/credentials.h" +#include "shell/browser/browser.h" #include "tizen_src/chromium_impl/content/common/paths_efl.h" #if !defined(WRT_JS_BRINGUP) #include "tizen_src/chromium_impl/content/public/browser/certificates_utils.h" @@ -225,6 +226,7 @@ std::vector SearchDeadMount() { if (app_status == AUL_R_ERROR || app_status == AUL_R_EINVAL) dead_mount_path.push_back(mount_path); + LOG(INFO) << main_app_id << "is running(" << app_status << "), so skip"; pkgmgrinfo_pkginfo_destroy_pkginfo(pkg_info); } } @@ -459,7 +461,6 @@ bool NativeWebRuntimeDelegateTV::IsRunningAsBackground() { } void NativeWebRuntimeDelegateTV::HandleLowMemory() { -#if !defined(WRT_JS_BRINGUP) if (electron::Browser::Get()->is_quitting()) { LOG(ERROR) << "app is quiting, just return"; return; @@ -473,7 +474,6 @@ void NativeWebRuntimeDelegateTV::HandleLowMemory() { NativeWebRuntime::GetInstance().RequestQuit(); } } -#endif } base::FilePath NativeWebRuntimeDelegateTV::GetTmgFilePath() { -- 2.7.4