Signed-off-by: sodanotgreen <limengzheng@huawei.com>
This commit is contained in:
sodanotgreen 2024-07-30 15:32:01 +08:00
parent 92d01c011a
commit 8ccd7142b6
7 changed files with 58 additions and 58 deletions

View File

@ -80,7 +80,7 @@ void ConnectServerManager::LoadConnectServerDebuggerSo()
if (handlerConnectServerSo_ == nullptr) {
handlerConnectServerSo_ = dlopen("libconnectserver_debugger.z.so", RTLD_LAZY);
if (handlerConnectServerSo_ == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to open register library");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null handlerConnectServerSo_");
return;
}
}
@ -95,7 +95,7 @@ void ConnectServerManager::StartConnectServer(const std::string& bundleName, int
if (isLocalAbstract) {
auto startServer = reinterpret_cast<StartServer>(dlsym(handlerConnectServerSo_, "StartServer"));
if (startServer == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'StartServer'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null startServer");
return;
}
startServer(bundleName_);
@ -105,7 +105,7 @@ void ConnectServerManager::StartConnectServer(const std::string& bundleName, int
reinterpret_cast<StartServerForSocketPair>(dlsym(handlerConnectServerSo_, "StartServerForSocketPair"));
if (startServerForSocketPair == nullptr) {
TAG_LOGE(
AAFwkTag::JSRUNTIME, "failed to find symbol 'StartServer'");
AAFwkTag::JSRUNTIME, "null startServerForSocketPair");
return;
}
startServerForSocketPair(socketFd);
@ -115,7 +115,7 @@ void ConnectServerManager::StopConnectServer(bool isCloseSo)
{
TAG_LOGD(AAFwkTag::JSRUNTIME, "called");
if (handlerConnectServerSo_ == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "handlerConnectServerSo_ is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null handlerConnectServerSo_");
return;
}
auto stopServer = reinterpret_cast<StopServer>(dlsym(handlerConnectServerSo_, "StopServer"));
@ -205,7 +205,7 @@ void ConnectServerManager::SetSwitchCallback(int32_t instanceId)
auto setSwitchCallBack = reinterpret_cast<SetSwitchCallBack>(
dlsym(handlerConnectServerSo_, "SetSwitchCallBack"));
if (setSwitchCallBack == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "ConnectServerManager::AddInstance failed to find symbol 'setSwitchCallBack'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null setSwitchCallBack");
return;
}
setSwitchCallBack(
@ -213,14 +213,14 @@ void ConnectServerManager::SetSwitchCallback(int32_t instanceId)
if (setStatus_ != nullptr) {
setStatus_(status);
} else {
TAG_LOGE(AAFwkTag::JSRUNTIME, "setStatus_ is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null setStatus_");
}
},
[this](int32_t containerId) {
if (createLayoutInfo_ != nullptr) {
createLayoutInfo_(containerId);
} else {
TAG_LOGE(AAFwkTag::JSRUNTIME, "createLayoutInfo_ is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null createLayoutInfo_");
}
}, instanceId);
}
@ -239,21 +239,21 @@ void ConnectServerManager::SetProfilerCallBack()
if (setArkUIStateProfilerStatus_ != nullptr) {
setArkUIStateProfilerStatus_(status);
} else {
TAG_LOGE(AAFwkTag::JSRUNTIME, "setArkUIStateProfilerStatus_ is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null etArkUIStateProfilerStatus_");
}
});
}
bool ConnectServerManager::SendInstanceMessage(int32_t tid, int32_t instanceId, const std::string& instanceName)
{
TAG_LOGI(AAFwkTag::JSRUNTIME, "ConnectServerManager::SendInstanceMessage Add instance to connect server");
TAG_LOGI(AAFwkTag::JSRUNTIME, "called");
ConnectServerManager::Get().SetSwitchCallback(instanceId);
ConnectServerManager::Get().SetProfilerCallBack();
std::string message = GetInstanceMapMessage("addInstance", instanceId, instanceName, tid);
LoadConnectServerDebuggerSo();
auto storeMessage = reinterpret_cast<StoreMessage>(dlsym(handlerConnectServerSo_, "StoreMessage"));
if (storeMessage == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "ConnectServerManager::SendInstanceMessage failed to find symbol 'StoreMessage'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null storeMessage");
return false;
}
storeMessage(instanceId, message);
@ -278,7 +278,7 @@ bool ConnectServerManager::AddInstance(int32_t tid, int32_t instanceId, const st
return false;
}
TAG_LOGD(AAFwkTag::JSRUNTIME, "ConnectServerManager::AddInstance Add instance to connect server");
TAG_LOGD(AAFwkTag::JSRUNTIME, "called");
ConnectServerManager::Get().SetSwitchCallback(instanceId);
ConnectServerManager::Get().SetProfilerCallBack();
@ -288,7 +288,7 @@ bool ConnectServerManager::AddInstance(int32_t tid, int32_t instanceId, const st
auto storeMessage = reinterpret_cast<StoreMessage>(dlsym(handlerConnectServerSo_, "StoreMessage"));
if (storeMessage == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'StoreMessage'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null StoreMessage");
return false;
}
storeMessage(instanceId, message);
@ -296,7 +296,7 @@ bool ConnectServerManager::AddInstance(int32_t tid, int32_t instanceId, const st
// WaitForConnection() means the connection state of the connect server
auto sendMessage = reinterpret_cast<SendMessage>(dlsym(handlerConnectServerSo_, "SendMessage"));
if (sendMessage == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'SendMessage'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null SendMessage");
return false;
}
// if connected, message will be sent immediately.
@ -332,7 +332,7 @@ void ConnectServerManager::RemoveInstance(int32_t instanceId)
LoadConnectServerDebuggerSo();
auto waitForConnection = reinterpret_cast<WaitForConnection>(dlsym(handlerConnectServerSo_, "WaitForConnection"));
if (waitForConnection == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'WaitForConnection'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null WaitForConnection");
return;
}
@ -341,7 +341,7 @@ void ConnectServerManager::RemoveInstance(int32_t instanceId)
auto removeMessage = reinterpret_cast<RemoveMessage>(dlsym(handlerConnectServerSo_, "RemoveMessage"));
if (removeMessage == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'RemoveMessage'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null RemoveMessage");
return;
}
removeMessage(instanceId);
@ -363,7 +363,7 @@ void ConnectServerManager::SendInspector(const std::string& jsonTreeStr, const s
TAG_LOGI(AAFwkTag::JSRUNTIME, "called");
auto sendLayoutMessage = reinterpret_cast<SendMessage>(dlsym(handlerConnectServerSo_, "SendLayoutMessage"));
if (sendLayoutMessage == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'sendLayoutMessage'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null sendLayoutMessage");
return;
}
@ -372,7 +372,7 @@ void ConnectServerManager::SendInspector(const std::string& jsonTreeStr, const s
auto storeInspectorInfo = reinterpret_cast<StoreInspectorInfo>(
dlsym(handlerConnectServerSo_, "StoreInspectorInfo"));
if (storeInspectorInfo == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'StoreInspectorInfo'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null StoreInspectorInfo");
return;
}
storeInspectorInfo(jsonTreeStr, jsonSnapshotStr);

View File

@ -39,16 +39,16 @@ HdcRegister& HdcRegister::Get()
void HdcRegister::StartHdcRegister(const std::string& bundleName, const std::string& processName, bool debugApp,
HdcRegisterCallback callback)
{
TAG_LOGD(AAFwkTag::JSRUNTIME, "begin");
TAG_LOGD(AAFwkTag::JSRUNTIME, "called");
registerHandler_ = dlopen("libhdc_register.z.so", RTLD_LAZY);
if (registerHandler_ == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to open register library");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null registerHandler_");
return;
}
auto startRegister = reinterpret_cast<StartRegister>(dlsym(registerHandler_, "StartConnect"));
if (startRegister == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'StartConnect'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null StartConnect");
return;
}
startRegister(processName, bundleName, debugApp, callback);
@ -56,16 +56,16 @@ void HdcRegister::StartHdcRegister(const std::string& bundleName, const std::str
void HdcRegister::StopHdcRegister()
{
TAG_LOGD(AAFwkTag::JSRUNTIME, "begin");
TAG_LOGD(AAFwkTag::JSRUNTIME, "called");
if (registerHandler_ == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "registerHandler_ is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null registerHandler_");
return;
}
auto stopRegister = reinterpret_cast<StopRegister>(dlsym(registerHandler_, "StopConnect"));
if (stopRegister != nullptr) {
stopRegister();
} else {
TAG_LOGE(AAFwkTag::JSRUNTIME, "failed to find symbol 'StopConnect'");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null StopConnect");
}
dlclose(registerHandler_);
registerHandler_ = nullptr;

View File

@ -29,7 +29,7 @@ napi_value CreateJsWantObject(napi_env env, const AAFwk::Want& want)
napi_value object = nullptr;
napi_create_object(env, &object);
if (object == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Native object is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null object");
return nullptr;
}
napi_set_named_property(env, object, "deviceId", CreateJsValue(env, want.GetOperation().GetDeviceId()));
@ -48,7 +48,7 @@ napi_value CreateJsAbilityInfo(napi_env env, const AppExecFwk::AbilityInfo& abil
napi_value object = nullptr;
napi_create_object(env, &object);
if (object == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Create object failed");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null object");
return nullptr;
}
AppExecFwk::CommonFunc::ConvertAbilityInfo(env, abilityInfo, object);
@ -60,7 +60,7 @@ napi_value CreateJsApplicationInfo(napi_env env, const AppExecFwk::ApplicationIn
napi_value object = nullptr;
napi_create_object(env, &object);
if (object == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Create object failed");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null object");
return nullptr;
}
AppExecFwk::CommonFunc::ConvertApplicationInfo(env, object, applicationInfo);
@ -72,7 +72,7 @@ napi_value CreateJsLaunchParam(napi_env env, const AAFwk::LaunchParam& launchPar
napi_value object = nullptr;
napi_create_object(env, &object);
if (object == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Native object is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null object");
return nullptr;
}
napi_set_named_property(env, object, "launchReason", CreateJsValue(env, launchParam.launchReason));
@ -86,7 +86,7 @@ napi_value CreateJsConfiguration(napi_env env, const AppExecFwk::Configuration&
napi_value object = nullptr;
napi_create_object(env, &object);
if (object == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Native object is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null object");
return nullptr;
}
@ -133,7 +133,7 @@ napi_value CreateJsExtensionAbilityInfo(napi_env env, const AppExecFwk::Extensio
napi_value object = nullptr;
napi_create_object(env, &object);
if (object == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Create object failed");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null object");
return nullptr;
}
AppExecFwk::CommonFunc::ConvertExtensionInfo(env, info, object);
@ -145,7 +145,7 @@ napi_value CreateJsHapModuleInfo(napi_env env, const AppExecFwk::HapModuleInfo&
napi_value object = nullptr;
napi_create_object(env, &object);
if (object == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Create object failed");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null object");
return nullptr;
}
AppExecFwk::CommonFunc::ConvertHapModuleInfo(env, hapModuleInfo, object);

View File

@ -45,7 +45,7 @@ JsModuleReader::JsModuleReader(const std::string& bundleName, const std::string&
bool JsModuleReader::operator()(const std::string& inputPath, uint8_t **buff,
size_t *buffSize, std::string& errorMsg) const
{
TAG_LOGD(AAFwkTag::JSRUNTIME, "JsModuleReader operator start: %{private}s", inputPath.c_str());
TAG_LOGD(AAFwkTag::JSRUNTIME, "called start: %{private}s", inputPath.c_str());
HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
if (inputPath.empty() || buff == nullptr || buffSize == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Invalid param");
@ -54,7 +54,7 @@ bool JsModuleReader::operator()(const std::string& inputPath, uint8_t **buff,
auto realHapPath = GetAppHspPath(inputPath);
if (realHapPath.empty()) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "realHapPath is empty");
TAG_LOGE(AAFwkTag::JSRUNTIME, "empty realHapPath");
return false;
}
@ -68,7 +68,7 @@ bool JsModuleReader::operator()(const std::string& inputPath, uint8_t **buff,
auto data = extractor->GetSafeData(MERGE_ABC_PATH);
if (!data) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "get mergeAbc fileBuffer failed");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null data");
return false;
}
@ -134,7 +134,7 @@ std::string JsModuleReader::GetOtherHspPath(const std::string& bundleName, const
auto bundleMgrHelper = DelayedSingleton<AppExecFwk::BundleMgrHelper>::GetInstance();
if (bundleMgrHelper == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "The bundleMgrHelper is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null bundleMgrHelper");
return presetAppHapPath;
}
@ -172,12 +172,12 @@ std::string JsModuleReader::GetPresetAppHapPath(const std::string& inputPath, co
std::string presetAppHapPath = inputPath;
std::string moduleName = inputPath.substr(inputPath.find_last_of("/") + 1);
if (moduleName.empty()) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Failed to obtain moduleName");
TAG_LOGE(AAFwkTag::JSRUNTIME, "empty moduleName");
return presetAppHapPath;
}
auto bundleMgrHelper = DelayedSingleton<AppExecFwk::BundleMgrHelper>::GetInstance();
if (bundleMgrHelper == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "The bundleMgrHelper is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null bundleMgrHelper");
return presetAppHapPath;
}
if (inputPath.find_first_of("/") == inputPath.find_last_of("/")) {
@ -204,12 +204,12 @@ void JsModuleReader::GetHapPathList(const std::string &bundleName, std::vector<s
{
auto systemAbilityManagerClient = OHOS::SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
if (!systemAbilityManagerClient) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "fail to get system ability mgr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null systemAbilityManagerClient");
return;
}
auto remoteObject = systemAbilityManagerClient->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID);
if (!remoteObject) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "fail to get bundle manager proxy");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null remoteObject");
return;
}
auto bundleMgrProxy = iface_cast<IBundleMgr>(remoteObject);

View File

@ -120,7 +120,7 @@ static auto PermissionCheckFunc = []() {
napi_value CanIUse(napi_env env, napi_callback_info info)
{
if (env == nullptr || info == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "get syscap failed since env or callback info is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null env or info");
return nullptr;
}
napi_value undefined = CreateJsUndefined(env);
@ -129,7 +129,7 @@ napi_value CanIUse(napi_env env, napi_callback_info info)
napi_value argv[1] = { nullptr };
napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
if (argc != 1) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Get syscap failed with invalid parameter");
TAG_LOGE(AAFwkTag::JSRUNTIME, "invalid argc");
return undefined;
}
@ -170,7 +170,7 @@ napi_status CreateNapiEnv(napi_env *env)
}
auto options = JsRuntime::GetChildOptions();
if (options == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "options is null, it maybe application startup failed");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null options");
return napi_status::napi_generic_failure;
}
std::shared_ptr<OHOS::JsEnv::JsEnvironment> jsEnv = nullptr;
@ -181,7 +181,7 @@ napi_status CreateNapiEnv(napi_env *env)
}
*env = reinterpret_cast<napi_env>(jsEnv->GetNativeEngine());
if (env == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "CreateJsEnv failed");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null env");
return napi_status::napi_generic_failure;
}
return NativeRuntimeImpl::GetNativeRuntimeImpl().Init(*options, *env);
@ -208,7 +208,7 @@ std::shared_ptr<Runtime::Options> JsRuntime::childOptions_ = nullptr;
std::mutex childOptionsMutex_;
JsRuntime::JsRuntime()
{
TAG_LOGD(AAFwkTag::JSRUNTIME, "JsRuntime costructor");
TAG_LOGD(AAFwkTag::JSRUNTIME, "called");
}
JsRuntime::~JsRuntime()
@ -254,7 +254,7 @@ void JsRuntime::StartDebugMode(const DebugOption dOption)
}
CHECK_POINTER(jsEnv_);
if (jsEnv_->GetDebugMode()) {
TAG_LOGI(AAFwkTag::JSRUNTIME, "Already in debug mode");
TAG_LOGI(AAFwkTag::JSRUNTIME, "in debug mode");
return;
}
// Set instance id to tid after the first instance.
@ -275,7 +275,7 @@ void JsRuntime::StartDebugMode(const DebugOption dOption)
TAG_LOGI(AAFwkTag::JSRUNTIME, "HdcRegister msg, fd= %{public}d, option= %{public}s",
socketFd, option.c_str());
if (weak == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr in hdc register callback");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null weak");
return;
}
if (option.find(DEBUGGER) == std::string::npos) {
@ -381,7 +381,7 @@ int32_t JsRuntime::JsperfProfilerCommandParse(const std::string &command, int32_
interval = jsperfMatchResults[matchNumResultIndex].str();
if (interval.empty()) {
TAG_LOGD(AAFwkTag::JSRUNTIME, "match order result error");
TAG_LOGD(AAFwkTag::JSRUNTIME, "empty interval");
return defaultValue;
}
@ -410,7 +410,7 @@ void JsRuntime::StartProfiler(const DebugOption dOption)
[bundleName, isStartWithDebug, instanceId, weak, isDebugApp](int socketFd, std::string option) {
TAG_LOGI(AAFwkTag::JSRUNTIME, "HdcRegister msg, fd= %{public}d, option= %{public}s", socketFd, option.c_str());
if (weak == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr in hdc register callback");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return;
}
if (option.find(DEBUGGER) == std::string::npos) {
@ -1408,7 +1408,7 @@ bool JsRuntime::ReadSourceMapData(const std::string& hapPath, const std::string&
{
// Source map relative path, FA: "/assets/js", Stage: "/ets"
if (hapPath.empty()) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "hapPath is empty");
TAG_LOGE(AAFwkTag::JSRUNTIME, "empty hapPath");
return false;
}
bool newCreate = false;

View File

@ -76,7 +76,7 @@ void InitWorkerFunc(NativeEngine* nativeEngine)
{
TAG_LOGD(AAFwkTag::JSRUNTIME, "called");
if (nativeEngine == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Input nativeEngine is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null nativeEngine");
return;
}
@ -122,7 +122,7 @@ void OffWorkerFunc(NativeEngine* nativeEngine)
{
TAG_LOGD(AAFwkTag::JSRUNTIME, "called");
if (nativeEngine == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "Input nativeEngine is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null nativeEngine");
return;
}

View File

@ -113,7 +113,7 @@ napi_status NativeRuntimeImpl::Init(const Options& options, napi_env env)
{
auto jsEnv = GetJsEnv(env);
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return napi_status::napi_generic_failure;
}
@ -204,7 +204,7 @@ napi_status NativeRuntimeImpl::RemoveJsEnv(napi_env env)
panda::ecmascript::EcmaVM* NativeRuntimeImpl::GetEcmaVm(const std::shared_ptr<JsEnv::JsEnvironment>& jsEnv) const
{
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return nullptr;
}
return jsEnv->GetVM();
@ -238,7 +238,7 @@ void NativeRuntimeImpl::LoadAotFile(const Options& options, const std::shared_pt
void NativeRuntimeImpl::InitConsoleModule(const std::shared_ptr<JsEnv::JsEnvironment>& jsEnv)
{
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return;
}
jsEnv->InitConsoleModule();
@ -247,7 +247,7 @@ void NativeRuntimeImpl::InitConsoleModule(const std::shared_ptr<JsEnv::JsEnviron
void NativeRuntimeImpl::InitTimerModule(const std::shared_ptr<JsEnv::JsEnvironment>& jsEnv)
{
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return;
}
jsEnv->InitTimerModule();
@ -257,7 +257,7 @@ void NativeRuntimeImpl::SetModuleLoadChecker(const std::shared_ptr<ModuleChecker
const std::shared_ptr<JsEnv::JsEnvironment>& jsEnv)
{
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return;
}
jsEnv->SetModuleLoadChecker(moduleCheckerDelegate);
@ -266,7 +266,7 @@ void NativeRuntimeImpl::SetModuleLoadChecker(const std::shared_ptr<ModuleChecker
void NativeRuntimeImpl::SetRequestAotCallback(const std::shared_ptr<JsEnv::JsEnvironment>& jsEnv)
{
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return;
}
auto callback = [](const std::string& bundleName, const std::string& moduleName, int32_t triggerMode) -> int32_t {
@ -300,7 +300,7 @@ void NativeRuntimeImpl::SetRequestAotCallback(const std::shared_ptr<JsEnv::JsEnv
bool NativeRuntimeImpl::InitLoop(const std::shared_ptr<JsEnv::JsEnvironment>& jsEnv)
{
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return false;
}
return jsEnv->InitLoop();
@ -309,7 +309,7 @@ bool NativeRuntimeImpl::InitLoop(const std::shared_ptr<JsEnv::JsEnvironment>& js
void NativeRuntimeImpl::InitWorkerModule(const Options& options, const std::shared_ptr<JsEnv::JsEnvironment>& jsEnv)
{
if (jsEnv == nullptr) {
TAG_LOGE(AAFwkTag::JSRUNTIME, "jsEnv is nullptr");
TAG_LOGE(AAFwkTag::JSRUNTIME, "null jsEnv");
return;
}