From dc040ada5512bfacb5a6c65399e22d0f70659bbc Mon Sep 17 00:00:00 2001 From: Rohit Kumar Date: Wed, 20 Mar 2024 14:48:20 +0530 Subject: [PATCH] [M120 Migration] Build libchromium-impl.so with chrome implementation This patch builds libchromium-impl.so inlcude chrome implementation and chrome_tizen as chrome main executable when |--build-chrome| option is given. Plus, gbs root and out directory are seperated. Reference: https://review.tizen.org/gerrit/303499 https://review.tizen.org/gerrit/306836 https://review.tizen.org/gerrit/305200 Change-Id: Ie7718fa71ff361932e07eddb2651fcc7a4a3a6c2 Signed-off-by: Rohit Kumar --- build/config/BUILD.gn | 4 - build/config/linux/libffi/BUILD.gn | 6 +- chrome/BUILD.gn | 86 +++++++++++++++ .../content/renderer/password_autofill_agent.cc | 5 +- components/autofill_strings.grdp | 2 +- components/components_strings.grd | 14 +-- components/omnibox_strings.grdp | 4 +- components/password_manager_strings.grdp | 2 + components/policy_strings.grdp | 4 +- components/version_ui_strings.grdp | 4 +- content/browser/browser_interface_binders.cc | 6 +- .../render_frame_audio_input_stream_factory.cc | 2 +- .../renderer_host/render_process_host_impl.cc | 2 +- device/bluetooth/BUILD.gn | 2 +- .../shell/browser/certificate_manager_model.cc | 4 + electron/shell/browser/certificate_manager_model.h | 4 + headless/BUILD.gn | 2 +- packaging/chromium-efl.spec | 120 ++++++++++----------- printing/printing_context_linux.cc | 6 +- services/device/geolocation/location_arbitrator.cc | 2 +- .../modulescript/document_module_script_fetcher.cc | 2 +- tizen_src/build/common.sh | 8 +- tizen_src/build/config/tizen_features.gni | 2 +- tizen_src/downloadable/ewk_interface_main.cc | 12 +++ tizen_src/ewk/chromium-ewk.filter | 2 + tizen_src/ewk/efl_integration/BUILD.gn | 4 +- .../pepper/pepper_shared_memory_message_filter.cc | 4 + .../pepper/pepper_shared_memory_message_filter.h | 4 + tools/grit/grit_args.gni | 3 + wrt/BUILD.gn | 93 +++++++++------- 30 files changed, 270 insertions(+), 145 deletions(-) diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 6f5ac4f..7b48894 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -221,10 +221,6 @@ config("default_libs") { "rt", ] - if (is_tizen && is_clang) { - libs += [ "atomic" ] - ldflags = [ "-Wl,-rpath=/usr/local/lib/" ] - } } } diff --git a/build/config/linux/libffi/BUILD.gn b/build/config/linux/libffi/BUILD.gn index 7052491..771170c 100644 --- a/build/config/linux/libffi/BUILD.gn +++ b/build/config/linux/libffi/BUILD.gn @@ -3,9 +3,6 @@ # found in the LICENSE file. import("//build/config/linux/pkg_config.gni") -if (use_efl) { - import("//tizen_src/build/config/tizen_features.gni") -} declare_args() { # Controls whether the build should use the version of libffi library shipped @@ -13,8 +10,7 @@ declare_args() { # on Linux, libffi must be statically linked to prevent a situation where the # runtime version of libffi is different from the build-time version from the # sysroot. - use_system_libffi = - default_toolchain == "//build/toolchain/cros:target" || build_chrome + use_system_libffi = default_toolchain == "//build/toolchain/cros:target" } if (use_system_libffi) { diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index ea0b7d9..2131b35 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -1457,6 +1457,92 @@ if (is_win) { group("chrome_dsym_archive") { } } +} else if (is_tizen) { + executable("chrome_tizen") { + testonly = true + deps = [ "//tizen_src/ewk/efl_integration:libchromium-ewk" ] + sources = [ + "app/chrome_exe_main_aura.cc", + "app/chrome_exe_resource.h", + ] + ldflags = [ + "-pie", + "-Wl,--export-dynamic", + ] + cflags = [ "-fPIC" ] + configs += [ "//tizen_src/build/config/tizen:executable_config" ] + } + + static_library("chrome_lib") { + sources = [ "app/chrome_exe_resource.h" ] + defines = [] + public_deps = [] + deps = [ + "//build:chromeos_buildflags", + "//printing/buildflags", + ] + data = [ "$root_out_dir/resources.pak" ] + data_deps = [] + + sources += [ + "app/chrome_dll_resource.h", + "app/chrome_main.cc", + "app/chrome_main_delegate.cc", + "app/chrome_main_delegate.h", + "app/chrome_main_linux.cc", + "app/chrome_main_linux.h", + ] + + deps += [ + # On Linux, link the dependencies (libraries) that make up actual + # Chromium functionality directly into the executable. + ":dependencies", + + # For configuring PartitionAlloc + "//base/allocator:buildflags", + + # For the sampling profiler. + "//chrome/common/profiler", + + # Needed to use the master_preferences functions + "//chrome/installer/util:with_no_strings", + "//content/public/app", + + # For headless mode. + "//headless:headless_shell_lib", + ] + + public_deps = [ "//chrome/common:buildflags" ] + + if (!is_fuchsia) { + public_deps += [ + ":xdg_mime", # Needs to be public for installer to consume files. + ] + + data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ] + } + + ldflags = [] + + if ((is_linux || is_chromeos_lacros) && !is_component_build && + !using_sanitizer) { + version_script = "//build/linux/chrome.map" + inputs = [ version_script ] + ldflags += [ "-Wl,--version-script=" + + rebase_path(version_script, root_build_dir) ] + } + + # These files are used by the installer so we need a public dep. + public_deps += [ ":packed_resources" ] + + # The step's output are needed at runtime, so we also need a data_dep. + data_deps += [ ":packed_resources" ] + + data_deps += [ + "//chrome/browser/resources/media/mei_preload:component", + "//third_party/widevine/cdm", + ] + } } group("dependencies") { diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 723b3ef..295ac32 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc @@ -2372,14 +2372,11 @@ bool PasswordAutofillAgent::SupportAutoLogin() { // org.tizen.browser, com.samsung.tv.knox-browser // Only org.tizen.browser app need AutoLogin behavior according to their spec. // The latter just wants Autofill. -#if defined(BUILD_CHROME) - return false; -#else + const std::string tizen_app_id = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kTizenAppId); return tizen_app_id == "org.tizen.browser"; -#endif } #endif diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp index 55754a3..4d331f3 100644 --- a/components/autofill_strings.grdp +++ b/components/autofill_strings.grdp @@ -23,7 +23,7 @@ - + Remove copy diff --git a/components/components_strings.grd b/components/components_strings.grd index fb29e4b..5d2e302 100644 --- a/components/components_strings.grd +++ b/components/components_strings.grd @@ -285,7 +285,7 @@ - + @@ -295,14 +295,14 @@ - + - + @@ -336,7 +336,7 @@ - + @@ -361,7 +361,7 @@ - + Cancel @@ -382,7 +382,7 @@ OK - + Reload @@ -528,7 +528,7 @@ JSON Parser - + Restore diff --git a/components/omnibox_strings.grdp b/components/omnibox_strings.grdp index bee4840..bba574c 100644 --- a/components/omnibox_strings.grdp +++ b/components/omnibox_strings.grdp @@ -32,7 +32,7 @@ Image you copied - + $1Paypal Inc. [$2US] @@ -64,7 +64,7 @@ Search or type URL - + $1 - $2 diff --git a/components/password_manager_strings.grdp b/components/password_manager_strings.grdp index 32d04bf..13dd105 100644 --- a/components/password_manager_strings.grdp +++ b/components/password_manager_strings.grdp @@ -87,6 +87,8 @@ Suggest Strong Password… + + Never saved diff --git a/components/policy_strings.grdp b/components/policy_strings.grdp index 0130f34..29a7fab 100644 --- a/components/policy_strings.grdp +++ b/components/policy_strings.grdp @@ -387,7 +387,7 @@ Additional details: Policies is loaded - + Export to JSON @@ -614,7 +614,7 @@ Additional details: Device local account override - + Full Admin Access diff --git a/components/version_ui_strings.grdp b/components/version_ui_strings.grdp index 89453a3..b55edca 100644 --- a/components/version_ui_strings.grdp +++ b/components/version_ui_strings.grdp @@ -1,6 +1,6 @@ - + About Version @@ -11,7 +11,7 @@ Developer Build - + (32-bit) diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index 9899337..df54bce 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc @@ -247,8 +247,8 @@ #include "third_party/blink/public/mojom/badging/badging.mojom.h" #endif -#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP) -#include "tizen_src/chromium_impl/components/xwalk_extensions/browser/xwalk_extension_manager.h" +#if BUILDFLAG(IS_TIZEN) +#include "components/xwalk_extensions/browser/xwalk_extension_manager.h" #endif namespace blink { @@ -1416,7 +1416,7 @@ void PopulateDedicatedWorkerBinders(DedicatedWorkerHost* host, host->GetAncestorRenderFrameHostId(), RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker, host)); -#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP) +#if BUILDFLAG(IS_TIZEN) map->Add(base::BindRepeating( &wrt::XWalkExtensionManager::Bind)); #endif diff --git a/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc b/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc index 6af445d..0e0488e 100644 --- a/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc +++ b/content/browser/renderer_host/media/render_frame_audio_input_stream_factory.cc @@ -163,7 +163,7 @@ class RenderFrameAudioInputStreamFactory::Core final const std::string& raw_output_device_id); #if BUILDFLAG(IS_TIZEN_TV) - void OnMediaStateChanged(uint32_t previous, uint32_t current); + void OnMediaStateChanged(uint32_t previous, uint32_t current) final; void NotifyMediaStateChanged(uint32_t previous, uint32_t current); #endif diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 8d834f5..ec8e9ec 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -3569,7 +3569,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kDiscardableMemoryLimit, switches::kDiscardableMemoryPurgeDelay, #endif -#if BUILDFLAG(IS_TIZEN_TV) && !defined(BUILD_CHROME) +#if BUILDFLAG(IS_TIZEN_TV) switches::kTizenAppId, switches::kXWalkExtensionPath, #endif diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn index 978a59f..847c3e9 100644 --- a/device/bluetooth/BUILD.gn +++ b/device/bluetooth/BUILD.gn @@ -46,7 +46,7 @@ source_set("deprecated_experimental_mojo") { "socket.h", ] - if (is_chromeos || is_linux || is_tizen) { + if (is_chromeos || is_linux) { sources += [ "bluez/metrics_recorder.cc", "bluez/metrics_recorder.h", diff --git a/electron/shell/browser/certificate_manager_model.cc b/electron/shell/browser/certificate_manager_model.cc index e2c09a5..78cc91b 100644 --- a/electron/shell/browser/certificate_manager_model.cc +++ b/electron/shell/browser/certificate_manager_model.cc @@ -45,6 +45,8 @@ net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext( } // namespace +namespace electron { + // CertificateManagerModel is created on the UI thread. It needs a // NSSCertDatabase handle (and on ChromeOS it needs to get the TPM status) which // needs to be done on the IO thread. @@ -167,3 +169,5 @@ void CertificateManagerModel::GetCertDBOnIOThread( if (cert_db) std::move(split_callback.second).Run(cert_db); } + +} // namespace electron diff --git a/electron/shell/browser/certificate_manager_model.h b/electron/shell/browser/certificate_manager_model.h index 91f7f3c..a6c2fe8 100644 --- a/electron/shell/browser/certificate_manager_model.h +++ b/electron/shell/browser/certificate_manager_model.h @@ -18,6 +18,8 @@ class BrowserContext; class ResourceContext; } // namespace content +namespace electron { + // CertificateManagerModel provides the data to be displayed in the certificate // manager dialog, and processes changes from the view. class CertificateManagerModel { @@ -114,4 +116,6 @@ class CertificateManagerModel { bool is_user_db_available_; }; +} // namespace electron + #endif // ELECTRON_SHELL_BROWSER_CERTIFICATE_MANAGER_MODEL_H_ diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 1fc8258..dadca05 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn @@ -862,7 +862,7 @@ static_library("headless_shell_lib") { ] defines = [] - if (!is_component_build) { + if (!is_component_build && !build_chrome) { sources += [ "lib/utility/headless_content_utility_client.cc", "lib/utility/headless_content_utility_client.h", diff --git a/packaging/chromium-efl.spec b/packaging/chromium-efl.spec index 07a9f5c..ccc8e52 100644 --- a/packaging/chromium-efl.spec +++ b/packaging/chromium-efl.spec @@ -537,7 +537,6 @@ touch ./tizen_src/downloadable/ewk_api_wrapper_generator.py "build_chrome=true" \ %else "build_chrome=false" \ - "ozone_auto_platforms=false" \ %endif %if "%{?tizen_profile_name}" == "tv" "lib_dir_path=\"%{_libdir}\"" \ @@ -548,9 +547,12 @@ touch ./tizen_src/downloadable/ewk_api_wrapper_generator.py %if 0%{?__enable_ewk_interface} "enable_ewk_interface=true" \ %endif + "ozone_auto_platforms=false" \ "enable_wrt_js=%{macro_to_bool __enable_wrt_js}" \ +%if 0%{?__enable_wrt_js} "xwalk_extension_path=\"%{__xwalk_extension_path}\"" \ "xwalk_extension_service_path=\"%{__xwalk_extension_service_path}\"" \ +%endif %if %{__enable_network_camera} "enable_network_camera=true" \ %endif @@ -579,11 +581,10 @@ ninja %{_smp_mflags} -C "%{OUTPUT_FOLDER}" \ %if 0%{?__enable_squashfs_image} && "%{?tizen_profile_name}" == "tv" chromium-efl-install \ %endif -%if %{__build_chrome} == 1 - content_shell chrome -%else - efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser +%if 0%{?__build_chrome} + chrome_tizen \ %endif + efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser %if 0%{?_enable_unittests} ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" angle_unittests env_chromium_unittests cacheinvalidation_unittests \ @@ -704,22 +705,17 @@ install -m 0644 %{_libdir}/libscl-common.so "%{buildroot}"%{_libdir} %endif %if %{__build_chrome} == 1 - install -m 0755 "%{OUTPUT_FOLDER}"/content_shell "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/ - sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/content_shell#' %{SOURCE1} > "%{buildroot}"%{_bindir}/content_shell - - install -m 0755 "%{OUTPUT_FOLDER}"/chrome "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/chrome - sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/chrome#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome - + install -m 0755 "%{OUTPUT_FOLDER}"/chrome_tizen "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/chrome_tizen + sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/chrome_tizen#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome_tizen install -m 0755 "%{OUTPUT_FOLDER}"/chrome_crashpad_handler "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/chrome_crashpad_handler sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/chrome_crashpad_handler#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome_crashpad_handler - install -m 0644 "%{OUTPUT_FOLDER}"/ui_resources_100_percent.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/ install -m 0644 "%{OUTPUT_FOLDER}"/locales/*.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/locales install -m 0644 "%{OUTPUT_FOLDER}"/chrome_100_percent.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/ install -m 0644 "%{OUTPUT_FOLDER}"/resources.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/ - - install -m 0755 "%{OUTPUT_FOLDER}"/libminigbm.so "%{buildroot}"%{_libdir} %else install -m 0644 "%{OUTPUT_FOLDER}"/locales/efl/*.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/locales/ +%endif + install -m 0755 "%{OUTPUT_FOLDER}"/libtest_trace_processor.so "%{buildroot}"%{_libdir} install -m 0755 "%{OUTPUT_FOLDER}"/efl_webprocess "%{buildroot}"%{_bindir}/ %if "%{?profile}" == "tv" @@ -748,16 +744,15 @@ install -m 0644 %{_libdir}/libscl-common.so "%{buildroot}"%{_libdir} %endif %endif - # org.tizen.chromium-efl Tizen App package - install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/ - install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/ - install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/ +# org.tizen.chromium-efl Tizen App package +install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/ +install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/ +install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser "%{buildroot}"%{CHROMIUM_APP_DIR}/bin/ - %if 0%{?__enable_ewk_interface} - install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-impl.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/ - %else - install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-ewk.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/ - %endif +%if 0%{?__enable_ewk_interface} + install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-impl.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/ +%else + install -m 0644 "%{OUTPUT_FOLDER}"/libchromium-ewk.so "%{buildroot}"%{CHROMIUM_LIB_DIR}/lib/ %endif install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj "%{buildroot}"%{CHROMIUM_LIB_DIR}/res/themes/ @@ -782,10 +777,7 @@ install -m 0644 "%{OUTPUT_FOLDER}"/tizen-manifest.xml "%{buildroot}"%{_xmldir}/% %define tizen_dist_sign 1 %endif -%if %{__build_chrome} != 1 install -m 0644 "%{OUTPUT_FOLDER}"/images/*.png "%{buildroot}"%{CHROMIUM_LIB_DIR}/res/images/ -%endif - install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj "%{buildroot}"%{CHROMIUM_LIB_DIR}/res/themes/ %if "%{?__use_system_icu}" != "1" @@ -817,12 +809,10 @@ install -m 0644 tizen_src/ewk/efl_integration/public/*.h "%{buildroot}"%{_includ install -d "%{buildroot}"%{_includedir}/v8 install -m 0644 v8/include/*.h "%{buildroot}"%{_includedir}/v8/ -%if %{__build_chrome} != 1 - # The native applications using ewk API from Tizen 2.x have a dependency about libewebkit2.so. - # The chromium-efl should support the backward compatibility of the native applications. - ln -s %{_libdir}/libchromium-ewk.so %{buildroot}%{_libdir}/libewebkit2.so.0 - ln -s %{_libdir}/libewebkit2.so.0 %{buildroot}%{_libdir}/libewebkit2.so -%endif +# The native applications using ewk API from Tizen 2.x have a dependency about libewebkit2.so. +# The chromium-efl should support the backward compatibility of the native applications. +ln -s %{_libdir}/libchromium-ewk.so %{buildroot}%{_libdir}/libewebkit2.so.0 +ln -s %{_libdir}/libewebkit2.so.0 %{buildroot}%{_libdir}/libewebkit2.so %if 0%{?__make_squashfs_rpm} install -d "%{buildroot}"%{CHROMIUM_APP_DIR}/res @@ -937,6 +927,8 @@ 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} @@ -1100,15 +1092,11 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk %if %{__build_chrome} == 1 %{CHROMIUM_LIB_DIR}/bin/chrome_100_percent.pak %{CHROMIUM_LIB_DIR}/bin/resources.pak - %{CHROMIUM_LIB_DIR}/bin/ui_resources_100_percent.pak - %{CHROMIUM_LIB_DIR}/bin/content_shell - %{_bindir}/content_shell - %{CHROMIUM_LIB_DIR}/bin/chrome - %{_bindir}/chrome + %{CHROMIUM_LIB_DIR}/bin/chrome_tizen + %{_bindir}/chrome_tizen %{CHROMIUM_LIB_DIR}/bin/chrome_crashpad_handler %{_bindir}/chrome_crashpad_handler - %{_libdir}/libminigbm.so -%else +%endif %{CHROMIUM_LIB_DIR}/res/locale/* %{_libdir}/libchromium-ewk.so %{_libdir}/libtest_trace_processor.so @@ -1116,33 +1104,37 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk %if 0%{?__enable_squashfs_image} %if "%{?tizen_profile_name}" == "tv" %{_bindir}/chromium-efl-install - %{_unitdir_user}/chromium-efl-vd.service - %{_unitdir_user}/default.target.wants/chromium-efl-vd.service - %dir %{CHROMIUM_LIB_UPGRADE_DIR} - %else - %{_unitdir}/chromium-efl.service - %{_unitdir}/multi-user.target.wants/chromium-efl.service - %{_unitdir}/chromium-efl-update.service - %{_unitdir}/multi-user.target.wants/chromium-efl-update.service - %endif - %endif - %{CHROMIUM_APP_DIR}/bin/efl_webview_app - %{CHROMIUM_APP_DIR}/bin/mini_browser - %{CHROMIUM_APP_DIR}/bin/ubrowser - - %if "%{?tizen_profile_name}" == "tv" - %caps(cap_mac_admin,cap_mac_override,cap_setgid=ei) %{_bindir}/efl_webprocess - %{_bindir}/efl_pluginprocess - %else - %{_bindir}/efl_webprocess - %endif - %if 0%{?__enable_ewk_interface} - %{CHROMIUM_LIB_DIR}/lib/libchromium-impl.so + %{_unitdir_user}/chromium-efl-vd.service + %{_unitdir_user}/default.target.wants/chromium-efl-vd.service + %dir %{CHROMIUM_LIB_UPGRADE_DIR} %else - %{CHROMIUM_LIB_DIR}/lib/libchromium-ewk.so + %{_unitdir}/chromium-efl.service + %{_unitdir}/multi-user.target.wants/chromium-efl.service + %{_unitdir}/chromium-efl-update.service + %{_unitdir}/multi-user.target.wants/chromium-efl-update.service %endif - %{CHROMIUM_LIB_DIR}/res/images/*.png %endif +%{CHROMIUM_APP_DIR}/bin/efl_webview_app +%{CHROMIUM_APP_DIR}/bin/mini_browser +%{CHROMIUM_APP_DIR}/bin/ubrowser + +%if "%{?tizen_profile_name}" == "tv" + %caps(cap_mac_admin,cap_mac_override,cap_setgid=ei) %{_bindir}/efl_webprocess + %{_bindir}/efl_pluginprocess +%else + %{_bindir}/efl_webprocess +%endif + +%if 0%{?__enable_ewk_interface} + %{CHROMIUM_LIB_DIR}/lib/libchromium-impl.so +%else + %{CHROMIUM_LIB_DIR}/lib/libchromium-ewk.so +%endif + +%{CHROMIUM_LIB_DIR}/res/images/*.png + +%{CHROMIUM_LIB_DIR}/res/themes/*.edj +%{CHROMIUM_LIB_DIR}/res/locale %if "%{?__use_system_icu}" != "1" %{CHROMIUM_LIB_DIR}/bin/icudtl.dat @@ -1157,7 +1149,7 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk %endif %else %{_bindir}/wrt - %endif +%endif %{_bindir}/wrt-client %{_sysconfdir}/profile.d/wrt_env.sh %if %{__build_chrome} != 1 diff --git a/printing/printing_context_linux.cc b/printing/printing_context_linux.cc index 2bb8fbf..73fe985 100644 --- a/printing/printing_context_linux.cc +++ b/printing/printing_context_linux.cc @@ -72,7 +72,7 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() { ResetSettings(); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_TIZEN) if (!ui::LinuxUi::instance()) return mojom::ResultCode::kSuccess; @@ -88,7 +88,7 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() { } gfx::Size PrintingContextLinux::GetPdfPaperSizeDeviceUnits() { -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_TIZEN) if (ui::LinuxUi::instance()) return ui::LinuxUi::instance()->GetPdfPaperSize(this); #endif @@ -101,7 +101,7 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings( DCHECK(!printer_settings.show_system_dialog); DCHECK(!in_print_job_); -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_TIZEN) if (!ui::LinuxUi::instance()) return mojom::ResultCode::kSuccess; diff --git a/services/device/geolocation/location_arbitrator.cc b/services/device/geolocation/location_arbitrator.cc index 6ef49eb..cf3b855 100644 --- a/services/device/geolocation/location_arbitrator.cc +++ b/services/device/geolocation/location_arbitrator.cc @@ -198,7 +198,7 @@ LocationArbitrator::NewNetworkLocationProvider( std::unique_ptr LocationArbitrator::NewSystemLocationProvider() { -#if BUILDFLAG(IS_TIZEN) && !defined(BUILD_CHROME) +#if BUILDFLAG(IS_TIZEN) if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableOffscreenRendering)) { return device::NewSystemLocationProvider(main_task_runner_, diff --git a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc index a51bb34..a0f074f 100644 --- a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc +++ b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc @@ -37,7 +37,7 @@ void DocumentModuleScriptFetcher::Fetch( DCHECK(!client_); client_ = client; expected_module_type_ = expected_module_type; -#if defined(ENABLE_WRT_JS) && !defined(BUILD_CHROME) +#if defined(ENABLE_WRT_JS) if (wrt::WRTModuleScriptFetcher::Fetch(fetch_params, client)) return; #endif diff --git a/tizen_src/build/common.sh b/tizen_src/build/common.sh index c0b3c33..1dd2645 100755 --- a/tizen_src/build/common.sh +++ b/tizen_src/build/common.sh @@ -242,6 +242,7 @@ function setupAndExecuteTargetBuild() { local LOCAL_BUILD=1 local RELEASE_BUILD=0 local MAKE_SQUASHFS_RPM=0 + local BUILD_CHROME=0 # "|| :" means "or always succeeding built-in command" PROFILE=$(echo "$@" | grep -Po "(?<=\-P\s)[^\s]*" | head -1 || :) @@ -313,6 +314,7 @@ function setupAndExecuteTargetBuild() { --tizen*) ;; --build-chrome) + BUILD_CHROME=1 ARGS+=(--define "_build_chrome 1") ;; *) @@ -388,7 +390,11 @@ function setupAndExecuteTargetBuild() { if [ "$USE_GLOBAL_GBS_CONF" == "" ]; then CONF_FLAG="--conf ${SCRIPTDIR}/gbs.conf" if [ "$GBS_ROOT" == "" ]; then - GBS_ROOT_OPT="-B ~/GBS-ROOT-M${CHROMIUM_VERSION}-${PROFILE^^}-TIZEN_${DEFAULT_TIZEN_VERSION^^}-${BRANCH^^}" + if [ "$BUILD_CHROME" == "1" ]; then + GBS_ROOT_OPT="-B ~/GBS-ROOT-M${CHROMIUM_VERSION}-${PROFILE^^}-TIZEN_${DEFAULT_TIZEN_VERSION^^}-CHROME-${BRANCH^^}" + else + GBS_ROOT_OPT="-B ~/GBS-ROOT-M${CHROMIUM_VERSION}-${PROFILE^^}-TIZEN_${DEFAULT_TIZEN_VERSION^^}-${BRANCH^^}" + fi else GBS_ROOT_OPT="-B $GBS_ROOT" fi diff --git a/tizen_src/build/config/tizen_features.gni b/tizen_src/build/config/tizen_features.gni index afc058c..c754301 100644 --- a/tizen_src/build/config/tizen_features.gni +++ b/tizen_src/build/config/tizen_features.gni @@ -76,7 +76,7 @@ declare_args() { drm_mapi_aarch_64 = false } -if (use_efl && !build_chrome) { +if (use_efl) { tizen_autofill = true if (tizen_product_tv) { tizen_autofill_fw = true diff --git a/tizen_src/downloadable/ewk_interface_main.cc b/tizen_src/downloadable/ewk_interface_main.cc index cf16835..2857e01 100644 --- a/tizen_src/downloadable/ewk_interface_main.cc +++ b/tizen_src/downloadable/ewk_interface_main.cc @@ -470,6 +470,18 @@ int WRTServiceMain(int argc, char** argv) { } #endif +#if defined(BUILD_CHROME) +__attribute__((visibility("default"))) int ChromeMain(int argc, + const char** argv) { + LOG(INFO) << "EWK-INTERFACE : ChromeMain called.."; + typedef int (*func_ptr_t)(int argc, const char** argv); + func_ptr_t fp = reinterpret_cast(ewk_dlsym("ChromeMain")); + if (fp) + return fp(argc, argv); + return 0; +} +#endif // defined(BUILD_CHROME) + #ifdef __cplusplus } #endif diff --git a/tizen_src/ewk/chromium-ewk.filter b/tizen_src/ewk/chromium-ewk.filter index 18a1d58..52f4727 100644 --- a/tizen_src/ewk/chromium-ewk.filter +++ b/tizen_src/ewk/chromium-ewk.filter @@ -42,6 +42,8 @@ WRTServiceMain; ime_app_main; node_module_register; + # CHROMIUM BROWSER + ChromeMain; local: *; }; diff --git a/tizen_src/ewk/efl_integration/BUILD.gn b/tizen_src/ewk/efl_integration/BUILD.gn index 2a2f56e..b09d396 100644 --- a/tizen_src/ewk/efl_integration/BUILD.gn +++ b/tizen_src/ewk/efl_integration/BUILD.gn @@ -115,7 +115,9 @@ shared_library("chromium-ewk") { "//ui/views:test_support", "//v8", ] - + if (build_chrome && is_tizen) { + deps += [ "//chrome:chrome_lib" ] + } if (enable_basic_printing) { deps += [ "//printing" ] } diff --git a/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.cc b/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.cc index 987c2c6..1fd507c 100644 --- a/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.cc +++ b/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.cc @@ -21,6 +21,8 @@ #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/shared_impl/var_tracker.h" +namespace pepper { + PepperSharedMemoryMessageFilter::PepperSharedMemoryMessageFilter( content::RendererPpapiHost* host) : InstanceMessageFilter(host->GetPpapiHost()), host_(host) {} @@ -63,3 +65,5 @@ void PepperSharedMemoryMessageFilter::OnHostMsgCreateSharedMemory( ->GetVarTracker() ->TrackSharedMemoryRegion(instance, std::move(shm), size); } + +} // namespace pepper diff --git a/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.h b/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.h index c425868..11b224b 100644 --- a/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.h +++ b/tizen_src/ewk/efl_integration/renderer/pepper/pepper_shared_memory_message_filter.h @@ -25,6 +25,8 @@ class SerializedHandle; } } // namespace ppapi +namespace pepper { + // Implements the backend for shared memory messages from a plugin process. class PepperSharedMemoryMessageFilter : public ppapi::host::InstanceMessageFilter { @@ -48,4 +50,6 @@ class PepperSharedMemoryMessageFilter content::RendererPpapiHost* host_; }; +} // namespace pepper + #endif // RENDERER_PEPPER_PEPPER_SHARED_MEMORY_MESSAGE_FILTER_H_ diff --git a/tools/grit/grit_args.gni b/tools/grit/grit_args.gni index 52f0fc5..eadb5a3 100644 --- a/tools/grit/grit_args.gni +++ b/tools/grit/grit_args.gni @@ -6,6 +6,7 @@ import("//build/config/chrome_build.gni") import("//build/config/chromeos/ui_mode.gni") import("//build/config/devtools.gni") import("//build/config/ui.gni") +import("//tizen_src/build/config/tizen_features.gni") shared_intermediate_dir = rebase_path(root_gen_dir, root_build_dir) devtools_grd_path = "$shared_intermediate_dir/$devtools_grd_location" @@ -33,6 +34,8 @@ _grit_defines = [ "toolkit_views=${toolkit_views}", "use_aura=${use_aura}", "use_ozone=${use_ozone}", + "is_tizen=${is_tizen}", + "build_chrome=${build_chrome}", # Mac and iOS want Title Case strings. "use_titlecase=${is_apple}", diff --git a/wrt/BUILD.gn b/wrt/BUILD.gn index 2c97238..b6ba21d 100644 --- a/wrt/BUILD.gn +++ b/wrt/BUILD.gn @@ -388,43 +388,6 @@ static_library("wrt_lib") { } sources = wrt_lib_sources + [ - "//chrome/browser/app_mode/app_mode_utils.cc", - "//chrome/browser/app_mode/app_mode_utils.h", - "//chrome/browser/browser_features.cc", - "//chrome/browser/browser_features.h", - "//chrome/browser/browser_process.cc", - "//chrome/browser/browser_process.h", - "//chrome/browser/devtools/devtools_contents_resizing_strategy.cc", - "//chrome/browser/devtools/devtools_contents_resizing_strategy.h", - "//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc", - "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h", - "//chrome/browser/devtools/devtools_file_system_indexer.cc", - "//chrome/browser/devtools/devtools_file_system_indexer.h", - "//chrome/browser/icon_loader.cc", - "//chrome/browser/icon_loader.h", - "//chrome/browser/icon_loader_auralinux.cc", - "//chrome/browser/icon_manager.cc", - "//chrome/browser/icon_manager.h", - "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc", - "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h", - "//chrome/browser/net/proxy_config_monitor.cc", - "//chrome/browser/net/proxy_config_monitor.h", - "//chrome/browser/net/proxy_service_factory.cc", - "//chrome/browser/net/proxy_service_factory.h", - "//chrome/browser/process_singleton.h", - "//chrome/browser/process_singleton_posix.cc", - "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc", - "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h", - "//chrome/browser/ui/exclusive_access/exclusive_access_manager.cc", - "//chrome/browser/ui/exclusive_access/exclusive_access_manager.h", - "//chrome/browser/ui/exclusive_access/fullscreen_controller.cc", - "//chrome/browser/ui/exclusive_access/fullscreen_controller.h", - "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.cc", - "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h", - "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.cc", - "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h", - "//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc", - "//chrome/browser/ui/exclusive_access/mouse_lock_controller.h", "//electron/shell/browser/certificate_manager_model.cc", "//electron/shell/browser/certificate_manager_model.h", "//electron/shell/browser/lib/power_observer_linux.cc", @@ -432,6 +395,47 @@ static_library("wrt_lib") { "//electron/shell/common/node_bindings_linux.cc", ] sources += rebase_path(electron_override_sources, ".", "overrides/electron") + if (!build_chrome) { + sources += [ + "//chrome/browser/app_mode/app_mode_utils.cc", + "//chrome/browser/app_mode/app_mode_utils.h", + "//chrome/browser/browser_features.cc", + "//chrome/browser/browser_features.h", + "//chrome/browser/browser_process.cc", + "//chrome/browser/browser_process.h", + "//chrome/browser/devtools/devtools_contents_resizing_strategy.cc", + "//chrome/browser/devtools/devtools_contents_resizing_strategy.h", + "//chrome/browser/devtools/devtools_embedder_message_dispatcher.cc", + "//chrome/browser/devtools/devtools_embedder_message_dispatcher.h", + "//chrome/browser/devtools/devtools_file_system_indexer.cc", + "//chrome/browser/devtools/devtools_file_system_indexer.h", + "//chrome/browser/icon_loader.cc", + "//chrome/browser/icon_loader.h", + "//chrome/browser/icon_loader_auralinux.cc", + "//chrome/browser/icon_manager.cc", + "//chrome/browser/icon_manager.h", + "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.cc", + "//chrome/browser/net/chrome_mojo_proxy_resolver_factory.h", + "//chrome/browser/net/proxy_config_monitor.cc", + "//chrome/browser/net/proxy_config_monitor.h", + "//chrome/browser/net/proxy_service_factory.cc", + "//chrome/browser/net/proxy_service_factory.h", + "//chrome/browser/process_singleton.h", + "//chrome/browser/process_singleton_posix.cc", + "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc", + "//chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h", + "//chrome/browser/ui/exclusive_access/exclusive_access_manager.cc", + "//chrome/browser/ui/exclusive_access/exclusive_access_manager.h", + "//chrome/browser/ui/exclusive_access/fullscreen_controller.cc", + "//chrome/browser/ui/exclusive_access/fullscreen_controller.h", + "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.cc", + "//chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h", + "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.cc", + "//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h", + "//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc", + "//chrome/browser/ui/exclusive_access/mouse_lock_controller.h", + ] + } if (tizen_product_tv) { sources += wrt_lib_sources_tv } else { @@ -480,10 +484,12 @@ static_library("wrt_lib") { ] sources += wrt_lib_sources_chrome_extensions } else { - sources += wrt_lib_sources_without_chrome_extensions + if (!build_chrome) { + sources += wrt_lib_sources_without_chrome_extensions + } } - if (enable_printing) { + if (enable_printing && !build_chrome) { deps += [ "//chrome/services/printing:lib", "//chrome/services/printing/public/mojom", @@ -518,6 +524,7 @@ static_library("wrt_lib") { "//electron/shell/renderer/printing/print_render_frame_helper_delegate.cc", "//electron/shell/renderer/printing/print_render_frame_helper_delegate.h", ] + if (enable_oop_printing) { sources += [ "//chrome/browser/printing/print_backend_service_manager.cc", @@ -533,6 +540,14 @@ static_library("wrt_lib") { ] } } + else { + sources += [ + "//electron/shell/browser/printing/print_view_manager_electron.cc", + "//electron/shell/browser/printing/print_view_manager_electron.h", + "//electron/shell/renderer/printing/print_render_frame_helper_delegate.cc", + "//electron/shell/renderer/printing/print_render_frame_helper_delegate.h", + ] +} unused_electron_sources = [ "shell/browser/api/electron_api_desktop_capturer.cc", -- 2.7.4