fixup! [WRTjs] Enable WRTjs 63/305863/5
authorv-saha <v.saha@samsung.com>
Fri, 9 Feb 2024 12:45:43 +0000 (18:15 +0530)
committerBot Blink <blinkbot@samsung.com>
Fri, 16 Feb 2024 09:21:12 +0000 (09:21 +0000)
This patch fixes build errors after enabling WRTjs for M120.

Change-Id: Ib7cfe8ea6166a92c87f34e7d384de71d7c2c8d31
Signed-off-by: v-saha <v.saha@samsung.com>
chrome/browser/net/proxy_config_monitor.cc
chrome/browser/net/proxy_config_monitor.h
content/browser/web_contents/web_contents_view_aura.cc
content/public/renderer/content_renderer_client.cc
content/renderer/render_frame_impl.cc
packaging/chromium-efl.spec
third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc
tizen_src/chromium_impl/media/filters/media_capabilities.cc

index bb0be4a..5359feb 100644 (file)
@@ -11,7 +11,7 @@
 #include "build/chromeos_buildflags.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/net/proxy_service_factory.h"
-#if !defined(ENABLE_WRT_JS)
+#if !defined(ENABLE_WRT_JS) || defined(BUILD_CHROME)
 #include "chrome/browser/profiles/profile.h"
 #endif
 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
@@ -29,7 +29,7 @@
 
 using content::BrowserThread;
 
-#if !defined(ENABLE_WRT_JS)
+#if !defined(ENABLE_WRT_JS) || defined(BUILD_CHROME)
 ProxyConfigMonitor::ProxyConfigMonitor(Profile* profile) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
   DCHECK(profile);
index 18f5c33..4b22980 100644 (file)
@@ -40,7 +40,7 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer,
 
 {
  public:
-#if !defined(ENABLE_WRT_JS)
+#if !defined(ENABLE_WRT_JS) || defined(BUILD_CHROME)
   // Creates a ProxyConfigMonitor that gets proxy settings from |profile| and
   // watches for changes. The created ProxyConfigMonitor must be destroyed
   // before |profile|.
@@ -96,7 +96,7 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer,
 
 #if BUILDFLAG(ENABLE_EXTENSIONS)
   mojo::ReceiverSet<network::mojom::ProxyErrorClient> error_receiver_set_;
-#if !defined(ENABLE_WRT_JS)
+#if !defined(ENABLE_WRT_JS) || defined(BUILD_CHROME)
   raw_ptr<Profile> profile_ = nullptr;
 #endif
 #endif
index 5776c67..4831918 100644 (file)
@@ -924,7 +924,7 @@ void WebContentsViewAura::SetOrientation(int orientation) {
 #endif
 
 void WebContentsViewAura::SetInitialFocus() {
-#if defined(ENABLE_WRT_JS) && BUILDFLAG(IS_TIZEN_TV)
+#if defined(ENABLE_WRT_JS) && BUILDFLAG(IS_TIZEN_TV) && !defined(BUILD_CHROME)
   if (wrt::IsInWRT() &&
       !base::CommandLine::ForCurrentProcess()->HasSwitch(
           switches::kEnableOffscreenRendering)) {
index 94d5a94..6d54932 100644 (file)
@@ -13,6 +13,7 @@
 #include "media/base/demuxer.h"
 #include "media/base/renderer_factory.h"
 #include "third_party/blink/public/common/security/protocol_handler_security_level.h"
+#include "third_party/blink/public/platform/web_application_type.h"
 #include "third_party/blink/public/platform/web_audio_device.h"
 #include "third_party/blink/public/platform/web_prescient_networking.h"
 #include "ui/gfx/icc_profile.h"
@@ -86,7 +87,7 @@ std::unique_ptr<media::Demuxer> ContentRendererClient::OverrideDemuxerForUrl(
     const GURL& url,
     scoped_refptr<base::SequencedTaskRunner> task_runner) {
 #if defined(TIZEN_MULTIMEDIA) && BUILDFLAG(IS_TIZEN_TV)
-  if (content::IsHbbTV()) {
+  if (blink::IsHbbTV()) {
     blink::WebLocalFrame* frame = render_frame->GetWebFrame();
     return std::make_unique<media::MediaUrlDemuxer>(
         task_runner, url, frame->GetDocument().SiteForCookies(),
index ff6f6c0..be31843 100644 (file)
@@ -3059,7 +3059,7 @@ void RenderFrameImpl::CommitFailedNavigation(
   navigation_params->http_method = WebString::FromASCII(common_params->method);
   navigation_params->error_code = error_code;
 
-#if defined(ENABLE_WRT_JS) && BUILDFLAG(IS_TIZEN_TV)
+#if defined(ENABLE_WRT_JS) && BUILDFLAG(IS_TIZEN_TV) && !defined(BUILD_CHROME)
   if (wrt::IsInWRT())
     navigation_params->grant_load_local_resources = true;
 #endif
index 51da36f..4b89512 100755 (executable)
@@ -864,18 +864,20 @@ install -m 0755 -p -D %{OUTPUT_FOLDER}/ppapi_unittests %{buildroot}/opt/usr/utc_
   install -m 0755 %{OUTPUT_FOLDER}/wrt                            %{buildroot}%{_bindir}
   ln -s %{_bindir}/wrt                                            %{buildroot}%{_bindir}/wrt-client
   install -m 0755 wrt/wrt_env.sh                                  %{buildroot}%{_sysconfdir}/profile.d/
-  install -m 0644 %{OUTPUT_FOLDER}/wrt_resources.pak              %{buildroot}%{CHROMIUM_LIB_DIR}/bin/
-  install -m 0644 %{OUTPUT_FOLDER}/liboffload_js_plugin.so        %{buildroot}%{__xwalk_extension_path}
-  install -m 0644 %{OUTPUT_FOLDER}/libsplash_screen_plugin.so     %{buildroot}%{__xwalk_extension_path}
-  install -m 0644 %{OUTPUT_FOLDER}/libwidget_plugin.so            %{buildroot}%{__xwalk_extension_path}
-  install -m 0644 %{OUTPUT_FOLDER}/libwrt-service-override.so     %{buildroot}%{__xwalk_extension_path}
-  install -m 0644 %{OUTPUT_FOLDER}/gen/tizen_src/chromium_impl/components/xwalk_extensions/offload_js_plugin/offload_js.json \
-                                                                  %{buildroot}%{__xwalk_extension_path}
-  install -m 0644 %{OUTPUT_FOLDER}/gen/tizen_src/chromium_impl/components/xwalk_extensions/splash_screen_plugin/splash_screen.json \
-                                                                  %{buildroot}%{__xwalk_extension_path}
-  install -m 0644 %{OUTPUT_FOLDER}/gen/tizen_src/chromium_impl/components/xwalk_extensions/widget_plugin/widget.json \
-                                                                  %{buildroot}%{__xwalk_extension_path}
-
+  %if %{__build_chrome} != 1
+    install -m 0644 %{OUTPUT_FOLDER}/wrt_resources.pak              %{buildroot}%{CHROMIUM_LIB_DIR}/bin/
+    install -m 0644 %{OUTPUT_FOLDER}/liboffload_js_plugin.so        %{buildroot}%{__xwalk_extension_path}
+    install -m 0644 %{OUTPUT_FOLDER}/libsplash_screen_plugin.so     %{buildroot}%{__xwalk_extension_path}
+    install -m 0644 %{OUTPUT_FOLDER}/libwidget_plugin.so            %{buildroot}%{__xwalk_extension_path}
+    install -m 0644 %{OUTPUT_FOLDER}/libwrt-service-override.so     %{buildroot}%{__xwalk_extension_path}
+    install -m 0644 %{OUTPUT_FOLDER}/gen/tizen_src/chromium_impl/components/xwalk_extensions/offload_js_plugin/offload_js.json \
+                                                                    %{buildroot}%{__xwalk_extension_path}
+    install -m 0644 %{OUTPUT_FOLDER}/gen/tizen_src/chromium_impl/components/xwalk_extensions/splash_screen_plugin/splash_screen.json \
+                                                                    %{buildroot}%{__xwalk_extension_path}
+    install -m 0644 %{OUTPUT_FOLDER}/gen/tizen_src/chromium_impl/components/xwalk_extensions/widget_plugin/widget.json \
+                                                                    %{buildroot}%{__xwalk_extension_path}
+    install -m 0644 %{OUTPUT_FOLDER}/gen/wrt/resources/*.edj        %{buildroot}%{CHROMIUM_LIB_DIR}/res/themes/
+  %endif
   %if "%{?profile}" == "wearable"
     # Popup icons
     cp wrt/resources/icons/*.png                                  %{buildroot}%{_datadir}/icons/wrtjs/
@@ -898,8 +900,6 @@ install -m 0755 -p -D %{OUTPUT_FOLDER}/ppapi_unittests %{buildroot}/opt/usr/utc_
       install -m 644 -D $file                                     %{buildroot}%{CHROMIUM_LIB_DIR}/res/locale/${file#%{__wrt_localedir}}
     done
 
-    install -m 0644 %{OUTPUT_FOLDER}/gen/wrt/resources/*.edj      %{buildroot}%{CHROMIUM_LIB_DIR}/res/themes/
-
     install -d %{buildroot}/etc/notstrip/
     install -m 644 packaging/wrt.notstrip                         %{buildroot}/etc/notstrip/wrt.notstrip
     %if 0%{?__generate_tpk}
@@ -1059,7 +1059,6 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk
 %{CHROMIUM_LIB_DIR}/bin/content_shell.pak
 %{CHROMIUM_LIB_DIR}/bin/locales/*.pak
 %{CHROMIUM_LIB_DIR}/res/themes/*.edj
-%{CHROMIUM_LIB_DIR}/res/locale/*
 
 %if %{__build_chrome} == 1
   %{CHROMIUM_LIB_DIR}/bin/chrome_100_percent.pak
@@ -1073,6 +1072,7 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk
   %{_bindir}/chrome_crashpad_handler
   %{_libdir}/libminigbm.so
 %else
+  %{CHROMIUM_LIB_DIR}/res/locale/*
   %{_libdir}/libchromium-ewk.so
   %{_libdir}/libtest_trace_processor.so
   %{_libdir}/libewebkit2.so*
@@ -1123,14 +1123,16 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk
   %endif
   %{_bindir}/wrt-client
   %{_sysconfdir}/profile.d/wrt_env.sh
-  %{CHROMIUM_LIB_DIR}/bin/wrt_resources.pak
-  %{__xwalk_extension_path}/liboffload_js_plugin.so
-  %{__xwalk_extension_path}/libsplash_screen_plugin.so
-  %{__xwalk_extension_path}/libwidget_plugin.so
-  %{__xwalk_extension_path}/libwrt-service-override.so
-  %{__xwalk_extension_path}/offload_js.json
-  %{__xwalk_extension_path}/splash_screen.json
-  %{__xwalk_extension_path}/widget.json
+  %if %{__build_chrome} != 1
+    %{CHROMIUM_LIB_DIR}/bin/wrt_resources.pak
+    %{__xwalk_extension_path}/liboffload_js_plugin.so
+    %{__xwalk_extension_path}/libsplash_screen_plugin.so
+    %{__xwalk_extension_path}/libwidget_plugin.so
+    %{__xwalk_extension_path}/libwrt-service-override.so
+    %{__xwalk_extension_path}/offload_js.json
+    %{__xwalk_extension_path}/splash_screen.json
+    %{__xwalk_extension_path}/widget.json
+  %endif
   %if "%{?profile}" != "tv"
     %{_datadir}/edje/wrtjs/*.edj
     %{_datadir}/locale/*
index a0f074f..a51bb34 100644 (file)
@@ -37,7 +37,7 @@ void DocumentModuleScriptFetcher::Fetch(
   DCHECK(!client_);
   client_ = client;
   expected_module_type_ = expected_module_type;
-#if defined(ENABLE_WRT_JS)
+#if defined(ENABLE_WRT_JS) && !defined(BUILD_CHROME)
   if (wrt::WRTModuleScriptFetcher::Fetch(fetch_params, client))
     return;
 #endif
index cfb3dd5..2576983 100644 (file)
@@ -47,9 +47,9 @@ class ScreenshotCapturedCallback {
  public:
   ScreenshotCapturedCallback(Screenshot_Captured_Callback func, void* user_data)
       : func_(func), user_data_(user_data) {}
-  void Run(Evas_Object* image) {
+  void Run(void* image) {
     if (func_ != NULL)
-      (func_)(image, user_data_);
+      (func_)((Evas_Object*)image, user_data_);
   }
 
  private:
index 5a97bfc..0008ab5 100644 (file)
@@ -1035,9 +1035,9 @@ void RWHVAuraOffscreenHelperEfl::GetMagnifierSnapshot(
   Evas_Object* image = GetSnapshot(snapshot_area, scale_factor, true);
 
   base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
-      FROM_HERE,
-      base::BindOnce(&ScreenshotCapturedCallback::Run,
-                     base::Owned(cb.release()), base::Unretained(image)));
+      FROM_HERE, base::BindOnce(&ScreenshotCapturedCallback::Run,
+                                base::Owned(cb.release()),
+                                base::Unretained((void*)image)));
 }
 
 void RWHVAuraOffscreenHelperEfl::RequestMagnifierSnapshotAsync(
index 4cb98c7..47092d8 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "base/command_line.h"
 #include "content/public/common/content_switches.h"
+#include "third_party/blink/public/platform/web_application_type.h"
 #include "tizen_src/chromium_impl/media/filters/esplusplayer_util.h"
 #include "tizen_src/chromium_impl/tizen/tizen_tv_platform.h"
 #include "tizen_src/ewk/efl_integration/common/application_type.h"
@@ -54,10 +55,10 @@ std::size_t TVMaxCount(MediaType type) {
         !IsMultiviewMode() &&
 #endif
         IsDualDecodingSupported() &&
-        (content::IsHbbTV() || IsCameraHardwareEncoderEnabled()))
+        (blink::IsHbbTV() || IsCameraHardwareEncoderEnabled()))
       return 2;
   }
-  if (content::IsTIZENWRT())
+  if (blink::IsTIZENWRT())
     return 4;
 #endif