add plugin api to set coreclr info 74/155074/1
authorCho Woong Suk <ws77.cho@samsung.com>
Thu, 12 Oct 2017 05:01:10 +0000 (14:01 +0900)
committerCho Woong Suk <ws77.cho@samsung.com>
Thu, 12 Oct 2017 05:01:10 +0000 (14:01 +0900)
Change-Id: I83f76c7cfbb939e6b397150db1675c41e264b7fb

NativeLauncher/launcher/dotnet/dotnet_launcher.cc
NativeLauncher/launcher/dotnet/dotnet_launcher.h

index 6adff4b..7734df5 100644 (file)
@@ -46,6 +46,7 @@ CoreRuntime::CoreRuntime() :
        pluginInitialize(nullptr),
        pluginPreload(nullptr),
        pluginSetAppInfo(nullptr),
+       pluginSetCoreclrInfo(nullptr),
        pluginGetDllPath(nullptr),
        pluginBeforeExecute(nullptr),
        pluginFinalize(nullptr)
@@ -79,6 +80,7 @@ CoreRuntime::CoreRuntime() :
                        pluginInitialize  = (plugin_initialize_ptr)dlsym(__pluginLib, "plugin_initialize");
                        pluginPreload  = (plugin_preload_ptr)dlsym(__pluginLib, "plugin_preload");
                        pluginSetAppInfo  = (plugin_set_app_info_ptr)dlsym(__pluginLib, "plugin_set_app_info");
+                       pluginSetCoreclrInfo = (plugin_set_coreclr_info_ptr)dlsym(__pluginLib, "plugin_set_coreclr_info");
                        pluginGetDllPath  = (plugin_get_dll_path_ptr)dlsym(__pluginLib, "plugin_get_dll_path");
                        pluginBeforeExecute  = (plugin_before_execute_ptr)dlsym(__pluginLib, "plugin_before_execute");
                        pluginFinalize  = (plugin_finalize_ptr)dlsym(__pluginLib, "plugin_finalize");
@@ -211,6 +213,9 @@ bool CoreRuntime::initializeCoreClr(const char* appId,
                return false;
        }
 
+       if (pluginSetCoreclrInfo)
+               pluginSetCoreclrInfo(__hostHandle, __domainId);
+
        _DBG("Initialize core clr success");
        return true;
 }
@@ -280,6 +285,7 @@ void CoreRuntime::dispose()
                pluginInitialize = nullptr;
                pluginPreload = nullptr;
                pluginSetAppInfo = nullptr;
+               pluginSetCoreclrInfo = nullptr;
                pluginGetDllPath = nullptr;
                pluginBeforeExecute = nullptr;
                pluginFinalize = nullptr;
index 931846c..aaaa9d8 100644 (file)
@@ -56,7 +56,11 @@ extern "C"
 
        typedef void (*plugin_set_app_info_ptr)(
                        const char* appId,
-                       const char* hostHandle);
+                       const char* managedAssemblyPath);
+
+       typedef void (*plugin_set_coreclr_info_ptr)(
+                       void* hostHandle,
+                       unsigned int domainId);
 
        typedef char* (*plugin_get_dll_path_ptr)();
 
@@ -103,6 +107,7 @@ class CoreRuntime : public tizen::runtime::LauncherInterface
                plugin_initialize_ptr pluginInitialize;
                plugin_preload_ptr      pluginPreload;
                plugin_set_app_info_ptr pluginSetAppInfo;
+               plugin_set_coreclr_info_ptr     pluginSetCoreclrInfo;
                plugin_get_dll_path_ptr pluginGetDllPath;
                plugin_before_execute_ptr pluginBeforeExecute;
                plugin_finalize_ptr     pluginFinalize;