Upstream version 6.34.113.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / xwalk_browser_main_parts.cc
index dbeaef8..7122e9e 100644 (file)
@@ -61,7 +61,6 @@ GURL GetURLFromCommandLine(const CommandLine& command_line) {
 
 namespace xswitches {
 // Redefine settings not exposed by content module.
-const char kEnableViewport[] = "enable-viewport";
 const char kEnableOverlayScrollbars[] = "enable-overlay-scrollbars";
 }
 
@@ -91,7 +90,8 @@ XWalkBrowserMainParts::~XWalkBrowserMainParts() {
 
 void XWalkBrowserMainParts::PreMainMessageLoopStart() {
   CommandLine* command_line = CommandLine::ForCurrentProcess();
-  command_line->AppendSwitch(xswitches::kEnableViewport);
+  command_line->AppendSwitch(switches::kEnableViewport);
+  command_line->AppendSwitch(switches::kEnableViewportMeta);
 
   command_line->AppendSwitch(xswitches::kEnableOverlayScrollbars);
 
@@ -105,6 +105,15 @@ void XWalkBrowserMainParts::PreMainMessageLoopStart() {
   // FIXME: Add comment why this is needed on Android and Tizen.
   command_line->AppendSwitch(switches::kAllowFileAccessFromFiles);
 
+  // Enable SIMD.JS API by default.
+  std::string js_flags("--simd_object");
+  if (command_line->HasSwitch(switches::kJavaScriptFlags)) {
+    js_flags += " ";
+    js_flags +=
+        command_line->GetSwitchValueASCII(switches::kJavaScriptFlags);
+  }
+  command_line->AppendSwitchASCII(switches::kJavaScriptFlags, js_flags);
+
   startup_url_ = GetURLFromCommandLine(*command_line);
 }
 
@@ -165,7 +174,6 @@ void XWalkBrowserMainParts::RegisterExternalExtensions() {
 void XWalkBrowserMainParts::PreMainMessageLoopRun() {
   xwalk_runner_->PreMainMessageLoopRun();
 
-  runtime_context_ = xwalk_runner_->runtime_context();
   extension_service_ = xwalk_runner_->extension_service();
 
   if (extension_service_)
@@ -179,7 +187,7 @@ void XWalkBrowserMainParts::PreMainMessageLoopRun() {
     const char* local_ip = "0.0.0.0";
     if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) {
       remote_debugging_server_.reset(
-          new RemoteDebuggingServer(runtime_context_,
+          new RemoteDebuggingServer(xwalk_runner_->runtime_context(),
               local_ip, port, std::string()));
     }
   }