From: Cho Woong Suk Date: Thu, 26 Apr 2018 05:56:22 +0000 (+0900) Subject: add mode variable to extend dotnet-launcher by division X-Git-Tag: accepted/tizen/unified/20180427.062348^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F177176%2F1;p=platform%2Fcore%2Fdotnet%2Flauncher.git add mode variable to extend dotnet-launcher by division Change-Id: I1317d95d234cb502fb1a616109c3346113a9fdf3 --- diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index c14e5f1..db5c2c5 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -80,7 +80,7 @@ static std::string getExtraNativeLibDirs(const std::string& appRoot) return candidate; } -CoreRuntime::CoreRuntime() : +CoreRuntime::CoreRuntime(const char* mode) : initializeClr(nullptr), executeAssembly(nullptr), shutdown(nullptr), @@ -98,7 +98,8 @@ CoreRuntime::CoreRuntime() : pluginGetDllPath(nullptr), pluginBeforeExecute(nullptr), pluginFinalize(nullptr), - fd(0) + fd(0), + __mode(mode) { #define __XSTR(x) #x #define __STR(x) __XSTR(x) @@ -131,7 +132,7 @@ CoreRuntime::CoreRuntime() : } if (pluginInitialize) - pluginInitialize(); + pluginInitialize(mode); _DBG("Constructor called!!"); } @@ -278,7 +279,7 @@ bool CoreRuntime::initializeCoreClr(const char* appId, } if (pluginSetCoreclrInfo) - pluginSetCoreclrInfo(__hostHandle, __domainId); + pluginSetCoreclrInfo(__hostHandle, __domainId, createDelegate); _DBG("Initialize core clr success"); return true; diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.h b/NativeLauncher/launcher/dotnet/dotnet_launcher.h index 998b0f8..37b0296 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.h +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.h @@ -50,7 +50,7 @@ extern "C" const char* entryPointMethodName, void** delegate); - typedef void (*plugin_initialize_ptr)(); + typedef void (*plugin_initialize_ptr)(const char* mode); typedef void (*plugin_preload_ptr)(); @@ -60,7 +60,8 @@ extern "C" typedef void (*plugin_set_coreclr_info_ptr)( void* hostHandle, - unsigned int domainId); + unsigned int domainId, + coreclr_create_delegate_ptr delegateFunc); typedef char* (*plugin_get_dll_path_ptr)(); @@ -79,7 +80,7 @@ typedef bool (*LaunchFunctionPtr)(const char* root, const char* path, int argc, class CoreRuntime : public tizen::runtime::LauncherInterface { public: - CoreRuntime(); + CoreRuntime(const char* mode); ~CoreRuntime(); int initialize(bool standalone) override; void dispose() override; @@ -110,6 +111,7 @@ class CoreRuntime : public tizen::runtime::LauncherInterface plugin_before_execute_ptr pluginBeforeExecute; plugin_finalize_ptr pluginFinalize; int fd; + const char* __mode; }; } // dotnetcore diff --git a/NativeLauncher/launcher/main.cc b/NativeLauncher/launcher/main.cc index 6c1ac12..e49010e 100644 --- a/NativeLauncher/launcher/main.cc +++ b/NativeLauncher/launcher/main.cc @@ -42,7 +42,7 @@ static std::string VersionOption("--version"); static std::string StandaloneOption("--standalone"); -int main(int argc, char *argv[]) +extern "C" int realMain(int argc, char *argv[], const char* mode) { int i; bool standalone = false; @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) std::unique_ptr runtime; using tizen::runtime::dotnetcore::CoreRuntime; - std::unique_ptr coreRuntime(new CoreRuntime()); + std::unique_ptr coreRuntime(new CoreRuntime(mode)); runtime = std::move(coreRuntime); if (standalone) { @@ -143,3 +143,9 @@ int main(int argc, char *argv[]) runtime->dispose(); return 0; } + +int main(int argc, char *argv[]) +{ + return realMain(argc, argv, "default"); +} +