Change ewk initialize code position
authorSeungkeun Lee <sngn.lee@samsung.com>
Thu, 9 Apr 2015 10:41:26 +0000 (19:41 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Thu, 9 Apr 2015 10:41:26 +0000 (19:41 +0900)
 - issue : ewk context was created before ewk init

Change-Id: I7a81d5dcc319ba5b5868f13b5f339b94800971cb

src/runtime/runtime.cc
src/runtime/web_application.cc

index 245a302..7e49e64 100755 (executable)
@@ -4,6 +4,7 @@
 
 #include "runtime/runtime.h"
 
+#include <ewk_chromium.h>
 #include <string>
 
 #include "common/logger.h"
@@ -134,8 +135,19 @@ int main(int argc, char* argv[]) {
   // Initalize CommandLineParser
   wrt::CommandLine::Init(argc, argv);
 
+  ewk_init();
+  char* chromium_arg_options[] = {
+    argv[0],
+    const_cast<char*>("--enable-file-cookies"),
+    const_cast<char*>("--allow-file-access-from-files"),
+    const_cast<char*>("--allow-universal-access-from-files")
+  };
+  const int chromium_arg_cnt =
+      sizeof(chromium_arg_options) / sizeof(chromium_arg_options[0]);
+  ewk_set_arguments(chromium_arg_cnt, chromium_arg_options);
+
   wrt::Runtime runtime;
   int ret = runtime.Exec(argc, argv);
-
+  ewk_shutdown();
   return ret;
 }
index 99b5cce..e21b42f 100755 (executable)
@@ -54,16 +54,6 @@ WebApplication::~WebApplication() {
 bool WebApplication::Initialize(NativeWindow* window) {
   window_ = window;
 
-  char* chromium_arg_options[] = {
-    CommandLine::ForCurrentProcess()->argv()[0],
-    const_cast<char*>("--enable-file-cookies"),
-    const_cast<char*>("--allow-file-access-from-files"),
-    const_cast<char*>("--allow-universal-access-from-files")
-  };
-  const int chromium_arg_cnt =
-      sizeof(chromium_arg_options) / sizeof(chromium_arg_options[0]);
-  ewk_set_arguments(chromium_arg_cnt, chromium_arg_options);
-
   // ewk setting
   ewk_context_cache_model_set(ewk_context_, EWK_CACHE_MODEL_DOCUMENT_BROWSER);