Lines Matching refs:moduleName
68 if (headNativeModule_->moduleName) { in ~NativeModuleManager()
69 delete[] headNativeModule_->moduleName; in ~NativeModuleManager()
223 std::string NativeModuleManager::GetModuleFileName(const char* moduleName, bool isAppModule) in GetModuleFileName() argument
225 if (moduleName == nullptr) { in GetModuleFileName()
229 HILOG_INFO("moduleName is '%{public}s', isAppModule is %{public}d", moduleName, isAppModule); in GetModuleFileName()
232 std::string name = isAppModule ? (prefix_ + "/" + moduleName) : moduleName; in GetModuleFileName()
235 … if (!GetNativeModulePath(moduleName, pathKey, "", isAppModule, nativeModulePath, NAPI_PATH_MAX)) { in GetModuleFileName()
252 HILOG_ERROR("get module file name failed, moduleName is %{public}s", moduleName); in GetModuleFileName()
272 char *moduleName = strdup(tmpName.c_str()); in Register() local
273 if (moduleName == nullptr) { in Register()
278 if (g_isLoadingModule || !strcmp(loadingModuleName_.c_str(), moduleName)) { in Register()
281 delete moduleName; in Register()
287 tailNativeModule_->name = moduleName; in Register()
288 tailNativeModule_->moduleName = nullptr; /* we update moduleName latter */ in Register()
306 headNativeModule_->name = moduleName; in Register()
440 void NativeModuleManager::CreateLdNamespace(const std::string moduleName, const char* lib_ld_path,
449 std::string nsName = "moduleNs_" + moduleName;
491 nsMap_[moduleName] = ns;
493 HILOG_DEBUG("end. moduleName: %{public}s, path: %{public}s", moduleName.c_str(), lib_ld_path);
497 void NativeModuleManager::SetAppLibPath(const std::string& moduleName, const std::vector<std::strin… in SetAppLibPath() argument
500 …HILOG_DEBUG("moduleName is %{public}s, isisSystemApp is %{public}d", moduleName.c_str(), isSystemA… in SetAppLibPath()
521 if (appLibPathMap_[moduleName] != nullptr) { in SetAppLibPath()
522 delete[] appLibPathMap_[moduleName]; in SetAppLibPath()
524 appLibPathMap_[moduleName] = tmp; in SetAppLibPath()
525 CreateLdNamespace(moduleName, tmp, isSystemApp); in SetAppLibPath()
526 HILOG_DEBUG("path: %{public}s", appLibPathMap_[moduleName]); in SetAppLibPath()
537 NativeModule* NativeModuleManager::LoadNativeModule(const char* moduleName, const char* path, bool … in LoadNativeModule() argument
540 if (moduleName == nullptr) { in LoadNativeModule()
553 moduleName, path, relativePath); in LoadNativeModule()
557 !moduleLoadChecker_->CheckModuleLoadable(moduleName, apiAllowListChecker)) { in LoadNativeModule()
558 errInfo = "module " + std::string(moduleName) + " is in blocklist, loading prohibited"; in LoadNativeModule()
564 std::string strModule(moduleName); in LoadNativeModule()
571 strModule = prefixTmp + '/' + moduleName; in LoadNativeModule()
591 errInfo = "failed to get native file path of module " + std::string(moduleName); in LoadNativeModule()
598 std::string key(moduleName); in LoadNativeModule()
604 key = prefixTmp + '/' + moduleName; in LoadNativeModule()
607 …if (!GetNativeModulePath(moduleName, prefixTmp.c_str(), relativePath, isAppModule, nativeModulePat… in LoadNativeModule()
609 errInfo = "failed to get native file path of module " + std::string(moduleName); in LoadNativeModule()
614 StartTrace(HITRACE_TAG_ACE, moduleName); in LoadNativeModule()
645 HILOG_DEBUG("module '%{public}s' does not in cache", moduleName); in LoadNativeModule()
646 …nativeModule = FindNativeModuleByDisk(moduleName, prefix_.c_str(), relativePath, internal, isAppMo… in LoadNativeModule()
652 …FindNativeModuleByCache(moduleName, nativeModulePath, cacheNativeModule, cacheHeadTailNativeModule… in LoadNativeModule()
681 bool NativeModuleManager::GetNativeModulePath(const char* moduleName, const char* path, in GetNativeModulePath() argument
719 int32_t lengthOfModuleName = strlen(moduleName); in GetNativeModulePath()
721 if (strcpy_s(dupModuleName, NAPI_PATH_MAX, moduleName) != 0) { in GetNativeModulePath()
722 HILOG_ERROR("strcpy_s moduleName '%{public}s' failed", moduleName); in GetNativeModulePath()
854 prefix, moduleName, afterDot, soPostfix) == -1) { in GetNativeModulePath()
982 NativeModule* NativeModuleManager::FindNativeModuleByDisk(const char* moduleName, const char* path, in FindNativeModuleByDisk() argument
987 …if (moduleLoadChecker_ && !moduleLoadChecker_->CheckModuleLoadable(moduleName, apiAllowListChecker… in FindNativeModuleByDisk()
988 errInfo = "module " + std::string(moduleName) + " is in blocklist, loading prohibited"; in FindNativeModuleByDisk()
993 std::string moduleKey(moduleName); in FindNativeModuleByDisk()
996 moduleKey = moduleKey + '/' + moduleName; in FindNativeModuleByDisk()
1002 …HILOG_DEBUG("moduleName is %{public}s. get primary module path is %{public}s", moduleName, loadPat… in FindNativeModuleByDisk()
1038 const char* moduleName = strdup(moduleKey.c_str()); in FindNativeModuleByDisk() local
1039 if (moduleName == nullptr) { in FindNativeModuleByDisk()
1044 tailNativeModule_->moduleName = moduleName; in FindNativeModuleByDisk()
1046 if (strcmp(tailNativeModule_->moduleName, tailNativeModule_->name)) { in FindNativeModuleByDisk()
1048 tailNativeModule_->moduleName, tailNativeModule_->name); in FindNativeModuleByDisk()
1094 if (tailNativeModule_->name && tailNativeModule_->moduleName) { in FindNativeModuleByDisk()
1096 tailNativeModule_->name, tailNativeModule_->moduleName); in FindNativeModuleByDisk()
1111 char *moduleName = strdup(moduleKey.c_str()); in RegisterByBuffer() local
1112 if (moduleName == nullptr) { in RegisterByBuffer()
1116 tailNativeModule_->moduleName = moduleName; in RegisterByBuffer()
1117 tailNativeModule_->name = strdup(moduleName); in RegisterByBuffer()
1119 HILOG_ERROR("strdup failed. moduleKey is %{public}s", moduleName); in RegisterByBuffer()
1120 free(moduleName); in RegisterByBuffer()
1121 tailNativeModule_->moduleName = nullptr; in RegisterByBuffer()
1128 …LOG_INFO("Register by buffer success. module name is '%{public}s'", tailNativeModule_->moduleName); in RegisterByBuffer()
1141 if (!strcasecmp(nativeModule->moduleName, moduleKey.c_str())) { in RemoveNativeModuleByCache()
1147 if (nativeModule->moduleName) { in RemoveNativeModuleByCache()
1148 delete[] nativeModule->moduleName; in RemoveNativeModuleByCache()
1162 if (!strcasecmp(curr->moduleName, moduleKey.c_str())) { in RemoveNativeModuleByCache()
1168 if (curr->moduleName) { in RemoveNativeModuleByCache()
1169 delete[] curr->moduleName; in RemoveNativeModuleByCache()
1186 NativeModule* NativeModuleManager::FindNativeModuleByCache(const char* moduleName, in FindNativeModuleByCache() argument
1196 if ((temp->moduleName && !strcmp(temp->moduleName, moduleName)) in FindNativeModuleByCache()
1197 || !strcasecmp(temp->name, moduleName)) { in FindNativeModuleByCache()
1198 if (strcmp(temp->name, moduleName)) { in FindNativeModuleByCache()
1200 moduleName, temp->name); in FindNativeModuleByCache()
1212 HILOG_WARN("moduleName '%{public}s' is in different path", moduleName); in FindNativeModuleByCache()