Run Tizen Webapps in single process mode
[platform/framework/web/crosswalk-tizen.git] / atom / browser / javascript_environment.cc
index b3e01c1..7ee10c1 100644 (file)
@@ -11,6 +11,7 @@
 #include "content/public/common/content_switches.h"
 #include "gin/array_buffer.h"
 #include "gin/v8_initializer.h"
+#include "tizen/common/env_variables.h"
 
 #include "atom/common/node_includes.h"
 
@@ -20,7 +21,6 @@ JavascriptEnvironment::JavascriptEnvironment()
     : initialized_(Initialize()),
       isolate_(isolate_holder_.isolate()),
       isolate_scope_(isolate_),
-      locker_(isolate_),
       handle_scope_(isolate_),
       context_(isolate_, v8::Context::New(isolate_)),
       context_scope_(v8::Local<v8::Context>::New(isolate_, context_)) {
@@ -34,6 +34,11 @@ void JavascriptEnvironment::OnMessageLoopDestroying() {
   isolate_holder_.RemoveRunMicrotasksObserver();
 }
 
+void JavascriptEnvironment::SetupLocker() {
+  if (!::tizen::is_single_process)
+    locker_.reset(new v8::Locker(isolate_));
+}
+
 bool JavascriptEnvironment::Initialize() {
   auto cmd = base::CommandLine::ForCurrentProcess();