Bringup with updated chromium-efl(m56.0.2924) 68/117868/1 submit/tizen/20170313.110550
authorYoungcheol Kang <ychul.kang@samsung.com>
Thu, 8 Dec 2016 11:27:22 +0000 (20:27 +0900)
committerYoungcheol Kang <ychul.kang@samsung.com>
Wed, 8 Mar 2017 01:41:50 +0000 (10:41 +0900)
This patch supports the working of WebApp and WebTCT with
new updated chromium-efl(m56.0.2924).

- Changed the codes related to including 'ewk_chromium.h' from 'EWebkit.h'
- Changed the codes related to dependency of V8 in chromium-efl

Bug: http://suprem.sec.samsung.net/jira/browse/RWASP-253

Change-Id: Iee178f03e9926b13d972c975b1e53a9fa20be576
Signed-off-by: Youngcheol Kang <ychul.kang@samsung.com>
12 files changed:
extensions/common/xwalk_extension_server.h
extensions/renderer/runtime_ipc_client.h
extensions/renderer/xwalk_extension_renderer_controller.h
extensions/renderer/xwalk_module_system.cc
extensions/renderer/xwalk_module_system.h
extensions/renderer/xwalk_v8tools_module.cc
runtime/browser/native_window.cc
runtime/browser/preload_manager.cc
runtime/browser/runtime_process.cc
runtime/browser/web_view.h
runtime/browser/web_view_impl.h
runtime/renderer/injected_bundle.cc

index 3cd67bf9588487301d83925ed95b540078d4f704..123d8141b5861ae0b9762d44dab695b123264187 100755 (executable)
@@ -5,8 +5,8 @@
 #ifndef XWALK_EXTENSIONS_XWALK_EXTENSION_SERVER_H_
 #define XWALK_EXTENSIONS_XWALK_EXTENSION_SERVER_H_
 
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 #include <json/json.h>
 
 #include <string>
index 7f94fb33f8ae383479c9e03d31adfb2ce903520a..ab0eac9e332fcabb7335210961a01fb2b0013b82 100755 (executable)
@@ -18,8 +18,8 @@
 #define XWALK_EXTENSIONS_RENDERER_RUNTIME_IPC_CLIENT_H_
 
 #include <v8/v8.h>
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 
 #include <functional>
 #include <map>
index 95e3145421831bcf59c8ca686b200a979a0447ce..b889af2046ab9c0ebb473930a2811c7c3d25806d 100755 (executable)
@@ -6,8 +6,8 @@
 #ifndef XWALK_EXTENSIONS_RENDERER_XWALK_EXTENSION_RENDERER_CONTROLLER_H_
 #define XWALK_EXTENSIONS_RENDERER_XWALK_EXTENSION_RENDERER_CONTROLLER_H_
 
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 #include <v8/v8.h>
 
 #include <memory>
index b14f12cd6d3d85e5472627e345a94907bb2daa4b..22181886dc7fde441af5c5584ee94bd5829fecce 100644 (file)
@@ -255,7 +255,7 @@ bool XWalkModuleSystem::SetTrampolineAccessorForEntryPoint(
   params->Set(v8::Integer::New(isolate, 1), entry);
 
   // FIXME(cmarcelo): ensure that trampoline is readonly.
-  value.As<v8::Object>()->SetAccessor(
+  value.As<v8::Object>()->SetAccessor(context,
       v8::String::NewFromUtf8(isolate, basename.c_str()),
       TrampolineCallback, TrampolineSetterCallback, params);
   return true;
@@ -294,7 +294,7 @@ bool XWalkModuleSystem::InstallTrampoline(v8::Handle<v8::Context> context,
     return false;
   }
 
-  auto it = entry->entry_points.begin();
+  std::vector<std::string>::const_iterator it = entry->entry_points.begin();
   for (; it != entry->entry_points.end(); ++it) {
     ret = SetTrampolineAccessorForEntryPoint(context, *it, entry_ptr);
     if (!ret) {
@@ -326,7 +326,7 @@ void XWalkModuleSystem::Initialize() {
 
   MarkModulesWithTrampoline();
 
-  auto it = extension_modules_.begin();
+  ExtensionModules::iterator it = extension_modules_.begin();
   for (; it != extension_modules_.end(); ++it) {
     if (it->use_trampoline && InstallTrampoline(context, &*it))
       continue;
@@ -367,6 +367,7 @@ void XWalkModuleSystem::DeleteExtensionModules() {
 void XWalkModuleSystem::LoadExtensionForTrampoline(
     v8::Isolate* isolate,
     v8::Local<v8::Value> data) {
+  v8::HandleScope handle_scope(isolate);
   v8::Local<v8::Array> params = data.As<v8::Array>();
   void* ptr = params->Get(
       v8::Integer::New(isolate, 0)).As<v8::External>()->Value();
@@ -391,7 +392,6 @@ void XWalkModuleSystem::LoadExtensionForTrampoline(
           isolate,
           module_system->require_native_template_);
 
-
   XWalkExtensionModule* module = entry->module;
   module->LoadExtensionCode(module_system->GetV8Context(),
                             require_native_template->GetFunction());
@@ -417,7 +417,7 @@ v8::Handle<v8::Value> XWalkModuleSystem::RefetchHolder(
 
 // static
 void XWalkModuleSystem::TrampolineCallback(
-    v8::Local<v8::String> property,
+    v8::Local<v8::Name> property,
     const v8::PropertyCallbackInfo<v8::Value>& info) {
   XWalkModuleSystem::LoadExtensionForTrampoline(info.GetIsolate(), info.Data());
   v8::Handle<v8::Value> holder = RefetchHolder(info.GetIsolate(), info.Data());
@@ -429,7 +429,7 @@ void XWalkModuleSystem::TrampolineCallback(
 
 // static
 void XWalkModuleSystem::TrampolineSetterCallback(
-    v8::Local<v8::String> property,
+    v8::Local<v8::Name> property,
     v8::Local<v8::Value> value,
     const v8::PropertyCallbackInfo<void>& info) {
   XWalkModuleSystem::LoadExtensionForTrampoline(info.GetIsolate(), info.Data());
index b70603a49c254c46992952c4c351415b8379c07c..e8bf6bf1ebbe454ba19fada7bb6fb0bf9dbe6630 100644 (file)
@@ -77,10 +77,10 @@ class XWalkModuleSystem {
                          ExtensionModuleEntry* entry);
 
   static void TrampolineCallback(
-      v8::Local<v8::String> property,
+      v8::Local<v8::Name> property,
       const v8::PropertyCallbackInfo<v8::Value>& info);
   static void TrampolineSetterCallback(
-      v8::Local<v8::String> property,
+      v8::Local<v8::Name> property,
       v8::Local<v8::Value> value,
       const v8::PropertyCallbackInfo<void>& info);
   static void LoadExtensionForTrampoline(
index 72e1a4d75014ee95fd6dd0d8188c685a59c03089..4fcad37161c2272fcec8a931716153b9bb70d7ab 100644 (file)
@@ -21,43 +21,48 @@ void ForceSetPropertyCallback(
   info[0].As<v8::Object>()->ForceSet(info[1], info[2]);
 }
 
+// ================
+// lifecycleTracker
+// ================
+struct LifecycleTrackerWrapper {
+  v8::Global<v8::Object> handle;
+  v8::Global<v8::Function> destructor;
+};
+
 void LifecycleTrackerCleanup(
-    const v8::WeakCallbackData<v8::Object,
-                               v8::Persistent<v8::Object> >& data) {
-  v8::Isolate* isolate = data.GetIsolate();
-  v8::HandleScope handle_scope(isolate);
+    const v8::WeakCallbackInfo<LifecycleTrackerWrapper>& data) {
+  LifecycleTrackerWrapper* wrapper = data.GetParameter();
 
-  v8::Local<v8::Object> tracker = data.GetValue();
-  v8::Handle<v8::Value> function =
-      tracker->Get(v8::String::NewFromUtf8(isolate, "destructor"));
+  if (!wrapper->destructor.IsEmpty()) {
+    v8::HandleScope handle_scope(data.GetIsolate());
+    v8::Local<v8::Context> context = v8::Context::New(data.GetIsolate());
+    v8::Context::Scope scope(context);
 
-  if (function.IsEmpty() || !function->IsFunction()) {
-    LOGGER(WARN) << "Destructor function not set for LifecycleTracker.";
-    data.GetParameter()->Reset();
-    delete data.GetParameter();
-    return;
-  }
+    v8::Local<v8::Function> destructor =
+      wrapper->destructor.Get(data.GetIsolate());
 
-  v8::Handle<v8::Context> context = v8::Context::New(isolate);
+    v8::MicrotasksScope microtasks(
+        data.GetIsolate(), v8::MicrotasksScope::kDoNotRunMicrotasks);
 
-  v8::TryCatch try_catch;
-  v8::Handle<v8::Function>::Cast(function)->Call(context->Global(), 0, NULL);
-  if (try_catch.HasCaught())
-    LOGGER(WARN) << "Exception when running LifecycleTracker destructor";
+    v8::TryCatch try_catch(data.GetIsolate());
+    destructor->Call(context->Global(), 0, nullptr);
 
-  data.GetParameter()->Reset();
-  delete data.GetParameter();
+    if (try_catch.HasCaught()) {
+      LOGGER(WARN) << "Exception when running LifecycleTracker destructor";
+    }
+  }
 }
 
 void LifecycleTracker(const v8::FunctionCallbackInfo<v8::Value>& info) {
-  v8::Isolate* isolate = v8::Isolate::GetCurrent();
-  v8::HandleScope handle_scope(isolate);
-
-  v8::Persistent<v8::Object>* tracker =
-      new v8::Persistent<v8::Object>(isolate, v8::Object::New(isolate));
-  tracker->SetWeak(tracker, &LifecycleTrackerCleanup);
-
-  info.GetReturnValue().Set(*tracker);
+  v8::Isolate* isolate = info.GetIsolate();
+       v8::HandleScope handle_scope(info.GetIsolate());
+
+  v8::Local<v8::Object> tracker = v8::Object::New(isolate);
+  LifecycleTrackerWrapper* wrapper = new LifecycleTrackerWrapper;
+  wrapper->handle.Reset(isolate, tracker);
+  wrapper->handle.SetWeak(wrapper, LifecycleTrackerCleanup,
+                          v8::WeakCallbackType::kParameter);
+  info.GetReturnValue().Set(wrapper->handle);
 }
 
 }  // namespace
index 6e723e5a37e46ac3d7c7cd8e50d50151ec4e4353..c2648a14318441c33e66906ece2af3a8b926c4e2 100755 (executable)
@@ -17,8 +17,8 @@
 #include "runtime/browser/native_window.h"
 
 #include <Ecore_Wayland.h>
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 #include <cstdint>
 
 #include "common/arraysize.h"
index 53317ae761dd6b866946a07ad6a7077c18a88d4c..4fbaaecfb8bdc3dcb04dec741450481ec80a1c13 100755 (executable)
@@ -17,8 +17,8 @@
 #include "runtime/browser/preload_manager.h"
 
 #include <Elementary.h>
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 #include <stdio.h>
 
 #include "common/logger.h"
index e51887a9c7325a17fa046cae49cef7ec34e3eb01..ee87fbb8d5bb87b3830e2eefb79563a942f088c7 100755 (executable)
@@ -14,8 +14,8 @@
  *    limitations under the License.
  */
 
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 
 #include <Elementary.h>
 
index 82bbe843679caf7cbf3440e91b51a06c664fcf78..9eaebc0b04b33f2b55deea5e82c159c41cb7a40a 100644 (file)
@@ -18,8 +18,8 @@
 #define XWALK_RUNTIME_BROWSER_WEB_VIEW_H_
 
 #include <Elementary.h>
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 #include <functional>
 #include <string>
 
index da2f297e3012c03b34cddc3c2e1d24bb05c35e52..56ecabf46ebfe0b3c3ec82c36acba4c6b681fbc3 100644 (file)
@@ -19,8 +19,8 @@
 
 #include <efl_extension.h>
 #include <Elementary.h>
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 
 #include <map>
 #include <string>
index f0243e2dcd0ad38ee1d19dc5a261685e84a85143..36fea96e153c71b445377b7886b1b2e7df251f8c 100755 (executable)
@@ -15,8 +15,8 @@
  */
 
 #include <Ecore.h>
-#include <EWebKit.h>
-#include <EWebKit_internal.h>
+#include <ewk_chromium.h>
+
 #include <unistd.h>
 #include <v8.h>
 #include <dlfcn.h>