add mode variable to extend dotnet-launcher by division 76/177176/1 accepted/tizen/unified/20180427.062348 submit/tizen/20180426.065036
authorCho Woong Suk <ws77.cho@samsung.com>
Thu, 26 Apr 2018 05:56:22 +0000 (14:56 +0900)
committerCho Woong Suk <ws77.cho@samsung.com>
Thu, 26 Apr 2018 05:56:22 +0000 (14:56 +0900)
Change-Id: I1317d95d234cb502fb1a616109c3346113a9fdf3

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

index c14e5f1..db5c2c5 100644 (file)
@@ -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;
index 998b0f8..37b0296 100644 (file)
@@ -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
index 6c1ac12..e49010e 100644 (file)
@@ -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<LauncherInterface> runtime;
 
        using tizen::runtime::dotnetcore::CoreRuntime;
-       std::unique_ptr<LauncherInterface> coreRuntime(new CoreRuntime());
+       std::unique_ptr<LauncherInterface> 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");
+}
+