Run Tizen Webapps in single process mode
[platform/framework/web/crosswalk-tizen.git] / atom / browser / api / atom_api_web_contents.cc
index 4365e2e..99cb90a 100644 (file)
@@ -77,6 +77,7 @@
 #include "net/url_request/url_request_context.h"
 #include "third_party/WebKit/public/platform/WebInputEvent.h"
 #include "third_party/WebKit/public/web/WebFindOptions.h"
+#include "tizen/common/env_variables.h"
 #include "ui/display/screen.h"
 
 #if defined(USE_EFL)
@@ -466,7 +467,8 @@ void WebContents::WebContentsCreated(content::WebContents* source_contents,
                                      const std::string& frame_name,
                                      const GURL& target_url,
                                      content::WebContents* new_contents) {
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   auto api_web_contents = CreateFrom(isolate(), new_contents, BROWSER_WINDOW);
   Emit("-web-contents-created", api_web_contents, target_url, frame_name);
@@ -478,7 +480,8 @@ void WebContents::AddNewContents(content::WebContents* source,
                                  const gfx::Rect& initial_rect,
                                  bool user_gesture,
                                  bool* was_blocked) {
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   auto api_web_contents = CreateFrom(isolate(), new_contents);
   if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
@@ -630,7 +633,8 @@ void WebContents::FindReply(content::WebContents* web_contents,
   if (!final_update)
     return;
 
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   mate::Dictionary result = mate::Dictionary::CreateEmpty(isolate());
   result.Set("requestId", request_id);
@@ -886,7 +890,8 @@ void WebContents::DevToolsFocused() {
 }
 
 void WebContents::DevToolsOpened() {
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   auto handle = WebContents::CreateFrom(
       isolate(), managed_web_contents()->GetDevToolsWebContents());
@@ -906,7 +911,8 @@ void WebContents::DevToolsOpened() {
 }
 
 void WebContents::DevToolsClosed() {
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   devtools_web_contents_.Reset();