Lines Matching refs:moduleKey

117 void NativeModuleManager::SetNativeEngine(std::string moduleKey, NativeEngine* nativeEngine)
119 HILOG_DEBUG("modulekey is '%{public}s'", moduleKey.c_str());
121 nativeEngine->SetModuleName(moduleKey);
124 nativeEngineList_.emplace(moduleKey, nativeEngine);
127 void NativeModuleManager::EmplaceModuleLib(std::string moduleKey, const LIBHANDLE lib)
129 HILOG_DEBUG("modulekey is '%{public}s'", moduleKey.c_str());
132 moduleLibMap_.emplace(moduleKey, lib);
136 bool NativeModuleManager::RemoveModuleLib(const std::string moduleKey)
138 HILOG_DEBUG("moduleKey is '%{public}s'", moduleKey.c_str());
141 auto it = moduleLibMap_.find(moduleKey);
144 HILOG_DEBUG("module '%{public}s' erased", moduleKey.c_str());
150 LIBHANDLE NativeModuleManager::GetNativeModuleHandle(const std::string& moduleKey) const
152 HILOG_DEBUG("moduleKey is '%{public}s'", moduleKey.c_str());
154 auto it = moduleLibMap_.find(moduleKey);
161 void NativeModuleManager::EmplaceModuleBuffer(const std::string moduleKey, const uint8_t* lib)
163 HILOG_DEBUG("modulekey is '%{public}s'", moduleKey.c_str());
166 moduleBufMap_.emplace(moduleKey, lib);
170 bool NativeModuleManager::RemoveModuleBuffer(const std::string moduleKey)
172 HILOG_DEBUG("moduleKey is '%{public}s'", moduleKey.c_str());
175 auto it = moduleBufMap_.find(moduleKey);
178 HILOG_DEBUG("module '%{public}s' erased", moduleKey.c_str());
184 const uint8_t* NativeModuleManager::GetBufferHandle(const std::string& moduleKey) const
186 HILOG_DEBUG("moduleKey is '%{public}s'", moduleKey.c_str());
188 auto it = moduleBufMap_.find(moduleKey);
195 bool NativeModuleManager::RemoveNativeModule(const std::string& moduleKey)
197 bool handleAbcRemoved = RemoveModuleBuffer(moduleKey);
198 bool handleRemoved = RemoveModuleLib(moduleKey);
199 bool moduleRemoved = RemoveNativeModuleByCache(moduleKey);
206 bool NativeModuleManager::UnloadNativeModule(const std::string& moduleKey)
208 HILOG_DEBUG("moduleKey is '%{public}s'", moduleKey.c_str());
209 LIBHANDLE handle = GetNativeModuleHandle(moduleKey);
215 if (RemoveNativeModule(moduleKey) == false) {
863 LIBHANDLE NativeModuleManager::LoadModuleLibrary(std::string& moduleKey, const char* path,
867 errInfo += "load module " + moduleKey + " failed. module path is empty";
921 EmplaceModuleLib(moduleKey, lib);
927 const std::string& moduleKey, size_t &len)
936 std::string abcModuleKey = moduleKey;
939 HILOG_DEBUG("get native abc handle success. moduleKey is %{public}s", moduleKey.c_str());
993 std::string moduleKey(moduleName);
995 moduleKey = path;
996 moduleKey = moduleKey + '/' + moduleName;
998 loadingModuleName_ = moduleKey;
1005 LIBHANDLE lib = LoadModuleLibrary(moduleKey, loadPath, path, isAppModule, errInfo, errReason0);
1011 lib = LoadModuleLibrary(moduleKey, loadPath, path, isAppModule, errInfo, errReason1);
1028 abcBuffer = GetFileBuffer(loadPath, moduleKey, len);
1038 const char* moduleName = strdup(moduleKey.c_str());
1040 HILOG_ERROR("strdup failed. moduleKey is %{public}s", moduleKey.c_str());
1055 if (sprintf_s(symbol, sizeof(symbol), "NAPI_%s_GetABCCode", moduleKey.c_str()) == -1) {
1059 errInfo = "sprintf symbol NAPI_" + moduleKey + "_GetABCCode failed";
1088 RegisterByBuffer(moduleKey, abcBuffer, len);
1103 void NativeModuleManager::RegisterByBuffer(const std::string& moduleKey, const uint8_t* abcBuffer, size_t len)
1105 HILOG_DEBUG("native module name is '%{public}s'", moduleKey.c_str());
1111 char *moduleName = strdup(moduleKey.c_str());
1113 HILOG_ERROR("strdup failed. moduleKey is %{public}s", moduleKey.c_str());
1119 HILOG_ERROR("strdup failed. moduleKey is %{public}s", moduleName);
1131 bool NativeModuleManager::RemoveNativeModuleByCache(const std::string& moduleKey)
1141 if (!strcasecmp(nativeModule->moduleName, moduleKey.c_str())) {
1154 HILOG_DEBUG("module %{public}s deleted from cache", moduleKey.c_str());
1162 if (!strcasecmp(curr->moduleName, moduleKey.c_str())) {
1175 HILOG_DEBUG("module %{public}s deleted from cache", moduleKey.c_str());