Run Tizen Webapps in single process mode
[platform/framework/web/crosswalk-tizen.git] / atom / browser / api / atom_api_app.cc
index 638a769..1471c86 100644 (file)
@@ -42,6 +42,7 @@
 #include "native_mate/dictionary.h"
 #include "native_mate/object_template_builder.h"
 #include "net/ssl/ssl_cert_request_info.h"
+#include "tizen/common/env_variables.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/image/image.h"
 
@@ -476,7 +477,8 @@ int ImportIntoCertStore(
 void OnIconDataAvailable(v8::Isolate* isolate,
                          const App::FileIconCallback& callback,
                          gfx::Image* icon) {
-  v8::Locker locker(isolate);
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate);
   v8::HandleScope handle_scope(isolate);
 
   if (icon && !icon->IsEmpty()) {
@@ -567,7 +569,8 @@ void App::OnContinueUserActivity(
 
 void App::OnLogin(LoginHandler* login_handler,
                   const base::DictionaryValue& request_details) {
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   bool prevent_default = Emit(
       "login",
@@ -589,7 +592,8 @@ void App::OnCreateWindow(
     const scoped_refptr<content::ResourceRequestBodyImpl>& body,
     int render_process_id,
     int render_frame_id) {
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   content::RenderFrameHost* rfh =
       content::RenderFrameHost::FromID(render_process_id, render_frame_id);
@@ -616,7 +620,8 @@ void App::AllowCertificateError(
     bool expired_previous_decision,
     const base::Callback<void(content::CertificateRequestResultType)>&
         callback) {
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
   bool prevent_default = Emit("certificate-error",
                               WebContents::CreateFrom(isolate(), web_contents),
@@ -882,7 +887,8 @@ void App::GetFileIcon(const base::FilePath& path,
   IconLoader::IconSize icon_size;
   FileIconCallback callback;
 
-  v8::Locker locker(isolate());
+  if (!::tizen::is_single_process)
+    v8::Locker locker(isolate());
   v8::HandleScope handle_scope(isolate());
 
   base::FilePath normalized_path = path.NormalizePathSeparators();