[M85 Dev][Tizen]Fix for compilation errors 53/244253/5
authoruzair <uzair.jaleel@samsung.com>
Wed, 16 Sep 2020 09:05:19 +0000 (14:35 +0530)
committeruzair <uzair.jaleel@samsung.com>
Thu, 17 Sep 2020 16:15:15 +0000 (21:45 +0530)
Below change fixes compilation errors for standard
profile.

Change-Id: Ib4700b671030346140149827d4172764fb9f36b7
Signed-off-by: uzair <uzair.jaleel@samsung.com>
33 files changed:
base/BUILD.gn
components/safe_browsing/core/resources/BUILD.gn
components/viz/host/host_display_client.cc
components/viz/host/host_display_client.h
components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
content/common/zygote/zygote_communication_linux.cc
content/common/zygote/zygote_communication_linux.h
content/gpu/gpu_child_thread.cc
content/gpu/gpu_child_thread.h
gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.cc
gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h
gpu/vulkan/vma_wrapper.h
gpu/vulkan/vulkan_device_queue.h
ipc/ipc_message_start.h
packaging/chromium-efl.spec
services/device/public/mojom/BUILD.gn
services/service_manager/sandbox/linux/bpf_cros_amd_gpu_policy_linux.cc
third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py
third_party/blink/renderer/controller/BUILD.gn
third_party/node/node.py
third_party/node/tizen/node [new file with mode: 0755]
tizen_src/build/gn_chromiumefl.sh
tizen_src/buildtools/clang-format [new file with mode: 0755]
tizen_src/chromium_impl/content/common/content_client_export.cc
tizen_src/chromium_impl/content/common/content_client_export.h
tizen_src/chromium_impl/content/gpu/in_process_gpu_thread_efl.cc
tizen_src/chromium_impl/content/renderer/renderer_efl.gni
tizen_src/ewk/efl_integration/command_line_efl.cc
tizen_src/ewk/efl_integration/eweb_context.cc
ui/gfx/gpu_fence.cc
ui/gfx/mojom/native_handle_types.mojom
ui/ozone/public/platform_screen.h
ui/ozone/public/surface_factory_ozone.h

index 7b6557b..bb1aee3 100644 (file)
@@ -1309,7 +1309,10 @@ jumbo_component("base") {
   }
 
   if (is_tizen) {
-    libs += [ "pthread" ]
+    libs += [
+      "pthread",
+      "dlog",
+    ]
   }
 
   if (use_allocator_shim) {
index 91d51fe..cea8440 100644 (file)
@@ -28,7 +28,7 @@ action("make_file_types_protobuf") {
     target_arch = "win"
   } else if (is_mac) {
     target_arch = "mac"
-  } else if (is_linux) {
+  } else if (is_linux || is_tizen) {
     target_arch = "linux"
   } else {
     # This will cause the script to fail.
index 3547ee8..cc6d195 100644 (file)
@@ -56,7 +56,7 @@ void HostDisplayClient::CreateLayeredWindowUpdater(
 }
 #endif
 
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_TIZEN)
 void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
   NOTIMPLEMENTED();
 }
index cedf833..90b0413 100644 (file)
@@ -43,7 +43,7 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
       mojo::PendingReceiver<mojom::LayeredWindowUpdater> receiver) override;
 #endif
 
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_TIZEN)
   void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
 #endif
 
index 675e05a..180c78b 100644 (file)
@@ -448,7 +448,7 @@ void RootCompositorFrameSinkImpl::DisplayDidCompleteSwapWithSize(
 #if defined(OS_ANDROID)
   if (display_client_)
     display_client_->DidCompleteSwapWithSize(pixel_size);
-#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#elif defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_TIZEN)
   if (display_client_ && pixel_size != last_swap_pixel_size_) {
     last_swap_pixel_size_ = pixel_size;
     display_client_->DidCompleteSwapWithNewSize(last_swap_pixel_size_);
index 4ae0b9e..3929173 100644 (file)
@@ -320,4 +320,28 @@ int ZygoteCommunication::GetSandboxStatus() {
   return sandbox_status_;
 }
 
+#if defined(OS_TIZEN)
+void ZygoteCommunication::LoadInjectedBundlePath(
+    const std::string& injected_bundle_path) {
+  DCHECK(init_);
+  base::Pickle pickle;
+
+  pickle.WriteInt(kZygoteCommandLoadInjectedBundle);
+  pickle.WriteString(injected_bundle_path);
+  if (!SendMessage(pickle, NULL))
+    LOG(ERROR) << "Failed to send LoadInjectedBundlePath message to zygote";
+}
+
+void ZygoteCommunication::DropProcessPrivileges(const std::string& app_id) {
+  DCHECK(init_);
+  base::Pickle pickle;
+
+  pickle.WriteInt(kZygoteCommandDropProcessPrivileges);
+  pickle.WriteString(app_id);
+  base::AutoLock lock(control_lock_);
+  if (!SendMessage(pickle, NULL))
+    LOG(ERROR) << "Failed to send DropProcessPrivileges message to zygote";
+}
+#endif
+
 }  // namespace content
index 37d8ec3..812cb5f 100644 (file)
@@ -67,6 +67,11 @@ class CONTENT_EXPORT ZygoteCommunication {
   // Returns the sandbox status of this zygote.
   int GetSandboxStatus();
 
+#if defined(OS_TIZEN)
+  void LoadInjectedBundlePath(const std::string& injected_bundle_path);
+  void DropProcessPrivileges(const std::string& app_id);
+#endif
+
  private:
   // Should be called every time a Zygote child is born.
   void ZygoteChildBorn(pid_t process);
index eb0485f..c6104af 100644 (file)
@@ -139,6 +139,12 @@ void GpuChildThread::Init(const base::Time& process_start_time) {
                                      base::Unretained(this)));
 }
 
+#if defined(USE_EFL)
+void GpuChildThread::SetGpuServiceConnection(viz::GpuServiceImpl* service) {
+  OnGpuServiceConnection(service);
+}
+#endif
+
 void GpuChildThread::CreateVizMainService(
     mojo::PendingAssociatedReceiver<viz::mojom::VizMain> pending_receiver) {
   viz_main_.BindAssociated(std::move(pending_receiver));
index 53974cc..0b7f477 100644 (file)
@@ -57,6 +57,10 @@ class GpuChildThread : public ChildThreadImpl,
 
   void Init(const base::Time& process_start_time);
 
+#if defined(USE_EFL)
+  void SetGpuServiceConnection(viz::GpuServiceImpl* service);
+#endif
+
  private:
   GpuChildThread(base::RepeatingClosure quit_closure,
                  ChildThreadImpl::Options options,
index d3b369b..80abd07 100644 (file)
@@ -5,7 +5,7 @@
 #include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h"
 
 #if defined(OS_TIZEN)
-#include "third_party/vulkan/include/vulkan/vulkan.h"
+#include "third_party/vulkan_headers/include/vulkan/vulkan.h"
 #else
 #include <vulkan/vulkan.h>
 #endif
index 4ce8915..ad98a84 100644 (file)
@@ -6,7 +6,7 @@
 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_NATIVE_PIXMAP_H_
 
 #if defined(OS_TIZEN)
-#include "third_party/vulkan/include/vulkan/vulkan.h"
+#include "third_party/vulkan_headers/include/vulkan/vulkan.h"
 #else
 #include <vulkan/vulkan.h>
 #endif
index 502bdbc..d9d0af4 100644 (file)
@@ -5,7 +5,11 @@
 #ifndef GPU_VULKAN_VMA_WRAPPER_H_
 #define GPU_VULKAN_VMA_WRAPPER_H_
 
+#if defined(OS_TIZEN)
+#include "third_party/vulkan_headers/include/vulkan/vulkan.h"
+#else
 #include <vulkan/vulkan.h>
+#endif
 
 #include "base/component_export.h"
 
index 5fb07bb..ead0ac7 100644 (file)
@@ -6,7 +6,7 @@
 #define GPU_VULKAN_VULKAN_DEVICE_QUEUE_H_
 
 #if defined(OS_TIZEN)
-#include "third_party/vulkan/include/vulkan/vulkan.h"
+#include "third_party/vulkan_headers/include/vulkan/vulkan.h"
 #else
 #include <vulkan/vulkan.h>
 #endif
index 4464f1e..073724e 100644 (file)
@@ -38,6 +38,9 @@ enum IPCMessageStart {
   ChromeUtilityPrintingMsgStart,
   OzoneGpuMsgStart,
   WebTestMsgStart,
+#if defined(OS_TIZEN)
+  TtsMsgStart,
+#endif
   ExtensionsGuestViewMsgStart,
   GuestViewMsgStart,
   MediaPlayerDelegateMsgStart,
index 6b6583a..6948a4b 100644 (file)
@@ -38,7 +38,8 @@ Source1: content_shell.in
 %{?_use_system_icu: %define __use_system_icu %{_use_system_icu}}
 # Product tv can't utilize system icu due to nacl dependency.
 %if "%{?profile}" != "tv" && %{tizen_version} == 60 && %{?_use_system_icu: 0}%{!?_use_system_icu: 1}
-%define __use_system_icu 1
+# Disabling system icu temporarily as it needs to be upgraded to version >= 67
+%define __use_system_icu 0
 %endif
 
 Requires: /usr/bin/systemctl
index 221576f..880cd80 100644 (file)
@@ -86,7 +86,7 @@ mojom("device_service") {
   disable_variants = true
 
   enabled_features = []
-  if (is_linux && use_udev) {
+  if ((is_linux || is_tizen) && use_udev) {
     enabled_features += [ "enable_input_device_manager" ]
   }
 
index 56233ee..433e2c0 100644 (file)
@@ -6,7 +6,9 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#if !defined(EWK_BRINGUP)  // FIXME:m85 bringup
 #include <linux/kcmp.h>
+#endif
 #include <sys/socket.h>
 
 // Some arch's (arm64 for instance) unistd.h don't pull in symbols used here
@@ -50,6 +52,7 @@ ResultExpr CrosAmdGpuProcessPolicy::EvaluateSyscall(int sysno) const {
       return If(domain == AF_UNIX, Allow()).Else(Error(EPERM));
     }
 #endif
+#if !defined(EWK_BRINGUP)  // FIXME:m85 bringup
     case __NR_kcmp: {
       const Arg<int> pid1(0);
       const Arg<int> pid2(1);
@@ -61,6 +64,7 @@ ResultExpr CrosAmdGpuProcessPolicy::EvaluateSyscall(int sysno) const {
                 Allow())
           .Else(Error(EPERM));
     }
+#endif
     default:
       // Default to the generic GPU policy.
       return GpuProcessPolicy::EvaluateSyscall(sysno);
index dc3493c..dc0b7d7 100644 (file)
@@ -42,6 +42,17 @@ def init(root_src_dir):
     _gn_command_path = os.path.join(buildtools_platform_dir,
                                     "gn{}".format(exe_suffix))
 
+    # //tizen_src/buildtools for tizen platform
+    f = open(root_src_dir + "/target.txt", 'r')
+    str = f.read().strip()
+    if (str == "tizen"):
+        tizenbuildtools_dir = os.path.join(root_src_dir + "/tizen_src",
+                                           "buildtools")
+        _clang_format_command_path = os.path.join(
+            tizenbuildtools_dir, "clang-format{}".format(exe_suffix))
+        _gn_command_path = os.path.join(tizenbuildtools_dir,
+                                        "gn{}".format(exe_suffix))
+
 
 def auto_format(contents, filename):
     assert isinstance(filename, str)
index ea7f0d6..c38a9a4 100644 (file)
@@ -45,7 +45,7 @@ jumbo_component("controller") {
     "memory_usage_monitor.h",
   ]
 
-  if (is_linux) {
+  if (is_linux || is_tizen) {
     sources += [
       "memory_usage_monitor_posix.cc",
       "memory_usage_monitor_posix.h",
index 8097e2c..1217211 100755 (executable)
@@ -10,11 +10,16 @@ import sys
 
 
 def GetBinaryPath():
-  return os_path.join(os_path.dirname(__file__), *{
-    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-    'Windows': ('win', 'node.exe'),
-  }[platform.system()])
+    f = open(os_path.dirname(__file__)+"/target.txt",'r')
+    str = f.read().strip()
+    if (str  == "tizen") :
+        return os_path.join(os_path.dirname(__file__),"tizen/","node")
+    else :
+        return os_path.join(os_path.dirname(__file__), *{
+        'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
+        'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
+        'Windows': ('win', 'node.exe'),
+        }[platform.system()])
 
 
 def RunNode(cmd_parts, stdout=None):
diff --git a/third_party/node/tizen/node b/third_party/node/tizen/node
new file mode 100755 (executable)
index 0000000..6a8fb3e
Binary files /dev/null and b/third_party/node/tizen/node differ
index ce713d4..e9598dd 100755 (executable)
@@ -305,6 +305,10 @@ _GN_ARGS="
     $ADDITIONAL_GN_PARAMETERS
     $EXTRA_GN_ARGS
     "
+
+echo $target > target.txt
+echo $target > third_party/node/target.txt
+
 printf "GN_ARGUMENTS:\n"
 for arg in $_GN_ARGS; do
   printf "    * ${arg##-D}\n"
diff --git a/tizen_src/buildtools/clang-format b/tizen_src/buildtools/clang-format
new file mode 100755 (executable)
index 0000000..dfbe180
Binary files /dev/null and b/tizen_src/buildtools/clang-format differ
index 84503bf..a609eb8 100644 (file)
@@ -2,9 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content_client_export.h"
-
-#include "content/public/common/content_client.h"
+#include "content/common/content_client_export.h"
 
 namespace content {
 
index e0d6234..d3f4efc 100644 (file)
@@ -6,11 +6,10 @@
 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_EXPORT_H_
 
 #include "content/common/content_export.h"
+#include "content/public/common/content_client.h"
 
 namespace content {
 
-class ContentClient;
-
 CONTENT_EXPORT ContentClient* GetContentClientExport();
 
 }  // namespace content
index b4eea24..5081646 100644 (file)
@@ -16,6 +16,7 @@
 #define private public
 #include "gpu/ipc/service/gpu_channel_manager.h"
 #include "content/gpu/in_process_gpu_thread.h"
+#undef private
 #include "content/gpu/gpu_child_thread.h"
 
 // Implementation of InProcessGpuThread and GpuChildThread overrides
@@ -30,7 +31,7 @@ struct GpuChildThreadEfl : public content::GpuChildThread {
       : GpuChildThread(params, std::move(gpu_init)) {}
 
   void OnGpuServiceConnection(viz::GpuServiceImpl* gpu_service) override {
-    GpuChildThread::OnGpuServiceConnection(gpu_service);
+    GpuChildThread::SetGpuServiceConnection(gpu_service);
     gpu_service->gpu_channel_manager()->share_group_ =
         GLSharedContextEfl::GetShareGroup();
     SharedMailboxManager::SetMailboxManager(
index 9a64df2..6d9c075 100644 (file)
@@ -31,13 +31,14 @@ external_content_renderer_efl_deps = []
 ##############################################################################
 external_content_renderer_efl_sources = []
 
-if (is_tizen) {
-  external_content_renderer_efl_sources += [
-    "//tizen_src/chromium_impl/content/renderer/tts_dispatcher_efl.cc",
-    "//tizen_src/chromium_impl/content/renderer/tts_dispatcher_efl.h",
-  ]
+if (!ewk_bringup) {  #FIXME:m85 bringup
+  if (is_tizen) {
+    external_content_renderer_efl_sources += [
+      "//tizen_src/chromium_impl/content/renderer/tts_dispatcher_efl.cc",
+      "//tizen_src/chromium_impl/content/renderer/tts_dispatcher_efl.h",
+    ]
+  }
 }
-
 if (tizen_multimedia_support) {
   #"media/audio_decoder.cc",
   #"media/audio_decoder.h",
index a0945ca..1979157 100644 (file)
@@ -65,9 +65,9 @@ content::MainFunctionParams CommandLineEfl::GetDefaultPortParams() {
 #endif
 
 #if defined(OS_TIZEN)
+#if !defined(EWK_BRINGUP)  // FIXME:m85 bringup
   p_command_line->AppendSwitchASCII(
       switches::kAcceleratedCanvas2dMSAASampleCount, "4");
-#if !defined(EWK_BRINGUP)
   p_command_line->AppendSwitch(switches::kEnableGestureTapHighlight);
   p_command_line->AppendSwitch(switches::kEnableSpatialNavigation);
   p_command_line->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges);
index f3079f1..dd11cba 100644 (file)
 #include "base/command_line.h"
 #include "common/content_switches_efl.h"
 #include "content/common/content_client_export.h"
+#include "content/common/zygote/zygote_communication_linux.h"
 #include "content/public/common/content_switches.h"
+#include "content/public/common/zygote/zygote_handle.h"
 #include "content_browser_client_efl.h"
-#include "services/service_manager/zygote/common/zygote_handle.h"
-#include "services/service_manager/zygote/host/zygote_communication_linux.h"
 #endif
 
 using content::BrowserThread;
@@ -252,13 +252,13 @@ void EWebContext::SetWidgetInfo(const std::string& tizen_app_id,
     // Drop process privillages while web app is launching
     // from WRT process pool. It should be handled in webengine side
     // in product tv profile because this profile uses the zygote process.
-    service_manager::GetGenericZygote()->DropProcessPrivileges(tizen_app_id_);
+    content::GetGenericZygote()->DropProcessPrivileges(tizen_app_id_);
 #endif  // OS_TIZEN_TV_PRODUCT
   } else {
     // Drop process privillages while web app is launching
     // from WRT process pool. It is not necessary in single process mode,
     // because it is handled in crosswalk side in single process mode.
-    service_manager::GetGenericZygote()->DropProcessPrivileges(tizen_app_id_);
+    content::GetGenericZygote()->DropProcessPrivileges(tizen_app_id_);
   }
 #endif  // OS_TIZEN
 }
@@ -362,7 +362,7 @@ EWebContext::EWebContext(bool incognito, const std::string& injectedBundlePath)
       }
     } else {
       // Preload injected bundle on zygote process for process pool.
-      service_manager::GetGenericZygote()->LoadInjectedBundlePath(
+      content::GetGenericZygote()->LoadInjectedBundlePath(
           injected_bundle_path_);
     }
   }
index 8c751bb..36cced8 100644 (file)
@@ -8,7 +8,9 @@
 #include "base/notreached.h"
 #include "base/time/time.h"
 
-#if (defined(OS_LINUX) || defined(OS_ANDROID)) && !defined(OS_TIZEN)
+#if defined(OS_TIZEN)
+#include "third_party/libsync/src/include/sync/sync.h"
+#elif (defined(OS_LINUX) || defined(OS_ANDROID))
 #include <sync/sync.h>
 #endif
 
index 5cf1461..ed9b9e3 100644 (file)
@@ -23,8 +23,8 @@ struct NativePixmapPlane {
 struct NativePixmapHandle {
   array<NativePixmapPlane> planes;
 
-  [EnableIf=is_linux]
   uint64 modifier;
+
   [EnableIf=is_chromeos]
   uint64 modifier;
 
index 9ce293c..ba20597 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <set>
 #include <string>
+#include <vector>
 
 #include "base/component_export.h"
 #include "base/macros.h"
index e9834c6..11315c6 100644 (file)
@@ -10,7 +10,7 @@
 #include <vector>
 
 #if defined(OS_TIZEN)
-#include "third_party/vulkan/include/vulkan/vulkan.h"
+#include "third_party/vulkan_headers/include/vulkan/vulkan.h"
 #else
 #include <vulkan/vulkan.h>
 #endif