From c6061608566a8bc31d459cf70044a9925a143222 Mon Sep 17 00:00:00 2001 From: Gajendra N Date: Mon, 27 Feb 2023 13:54:52 +0530 Subject: [PATCH 01/16] fixup! [M108 Migration][clang] set default value for _clang variable This commit enables clang build by default for both VD QB and SR QB. Signed-off-by: Gajendra N Change-Id: I481464121e0d500829b714f94920db5000e25523 --- packaging/chromium-efl.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/packaging/chromium-efl.spec b/packaging/chromium-efl.spec index 49fb87b..351af4f 100755 --- a/packaging/chromium-efl.spec +++ b/packaging/chromium-efl.spec @@ -176,9 +176,7 @@ BuildRequires: binutils-gold %define ARCHITECTURE x86_64 %endif -%if "%{?tizen_profile_name}" == "tv" %{!?_clang: %define _clang 1} -%endif %if "%{?_clang}" == "1" && "%{ARCHITECTURE}" == "armv7l" %define __use_clang 1 -- 2.7.4 From a3181f69eee3eee1c1ecb6e6bdaff1c9f5b36a87 Mon Sep 17 00:00:00 2001 From: xiaofang Date: Mon, 27 Feb 2023 10:19:08 +0800 Subject: [PATCH 02/16] [M108 Aura Migration] Add media playback ewk api ewk api: ewk_view_stop_video ewk_view_broadcast_decoder_set ewk_view_media_device_list_get ewk_settings_default_audio_input_device_set ewk_view_is_video_playing Refer: https://review.tizen.org/gerrit/#/c/270947/ https://review.tizen.org/gerrit/#/c/271619/ https://review.tizen.org/gerrit/#/c/284880/ https://review.tizen.org/gerrit/#/c/284853/ https://review.tizen.org/gerrit/#/c/276711/ https://review.tizen.org/gerrit/#/c/270211/ Change-Id: I406d049dca2b07ae4f4757c6412f0ceff9509e81 Signed-off-by: xiaofang --- .../ewk/efl_integration/eweb_view_callbacks.h | 26 +++++ .../public/ewk_media_playback_info.cc | 23 +++++ .../public/ewk_media_playback_info.h | 114 +++++++++++++++++++++ .../public/ewk_media_playback_info_product.h | 28 +++++ .../public/ewk_media_subtitle_info.h | 99 ++++++++++++++++++ .../ewk/efl_integration/public/ewk_settings.cc | 5 + .../efl_integration/public/ewk_settings_product.h | 1 + .../public/ewk_user_media_internal.h | 12 +++ tizen_src/ewk/efl_integration/public/ewk_view.cc | 23 +++++ .../ewk/efl_integration/public/ewk_view_internal.h | 20 ++++ .../ewk/efl_integration/public/ewk_view_product.h | 10 ++ 11 files changed, 361 insertions(+) create mode 100644 tizen_src/ewk/efl_integration/public/ewk_media_playback_info.h create mode 100644 tizen_src/ewk/efl_integration/public/ewk_media_subtitle_info.h diff --git a/tizen_src/ewk/efl_integration/eweb_view_callbacks.h b/tizen_src/ewk/efl_integration/eweb_view_callbacks.h index 36b1345..7ab0b9d 100644 --- a/tizen_src/ewk/efl_integration/eweb_view_callbacks.h +++ b/tizen_src/ewk/efl_integration/eweb_view_callbacks.h @@ -107,6 +107,16 @@ enum CallbackType { EdgeRight, EdgeTop, EdgeBottom, +#if BUILDFLAG(IS_TIZEN_TV) + DeviceConnectionChanged, + PlaybackLoad, + PlaybackVideoReady, + PlaybackReady, + PlaybackStart, + PlaybackFinish, + PlaybackStop, + UserMediaState, +#endif OverscrolledLeft, OverscrolledRight, OverscrolledTop, @@ -251,6 +261,22 @@ DECLARE_EWK_VIEW_CALLBACK(EdgeLeft, "edge,left", void); DECLARE_EWK_VIEW_CALLBACK(EdgeTop, "edge,top", void); DECLARE_EWK_VIEW_CALLBACK(EdgeBottom, "edge,bottom", void); DECLARE_EWK_VIEW_CALLBACK(EdgeRight, "edge,right", void); +#if BUILDFLAG(IS_TIZEN_TV) +DECLARE_EWK_VIEW_CALLBACK(DeviceConnectionChanged, + "device,connection,changed", + int*); +DECLARE_EWK_VIEW_CALLBACK(PlaybackLoad, "notification,playback,load", void*); +DECLARE_EWK_VIEW_CALLBACK(PlaybackVideoReady, + "notification,playback,videoready", + void*); +DECLARE_EWK_VIEW_CALLBACK(PlaybackReady, "notification,playback,ready", void*); +DECLARE_EWK_VIEW_CALLBACK(PlaybackStart, "notification,playback,start", void*); +DECLARE_EWK_VIEW_CALLBACK(PlaybackStop, "notification,playback,stop", void*); +DECLARE_EWK_VIEW_CALLBACK(PlaybackFinish, + "notification,playback,finish", + void*); +DECLARE_EWK_VIEW_CALLBACK(UserMediaState, "usermedia,state", void*); +#endif DECLARE_EWK_VIEW_CALLBACK(OverscrolledLeft, "overscrolled,left", void); DECLARE_EWK_VIEW_CALLBACK(OverscrolledRight, "overscrolled,right", void); DECLARE_EWK_VIEW_CALLBACK(OverscrolledTop, "overscrolled,top", void); diff --git a/tizen_src/ewk/efl_integration/public/ewk_media_playback_info.cc b/tizen_src/ewk/efl_integration/public/ewk_media_playback_info.cc index b7baf7e..1d7d318 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_media_playback_info.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_media_playback_info.cc @@ -28,6 +28,16 @@ #include "build/build_config.h" #include "private/ewk_private.h" +struct _Ewk_Media_Playback_Info { + int video_id; + const char* media_url; + const char* mime_type; + Eina_Bool media_resource_acquired; + const char* translated_url; + const char* drm_info; + Ewk_Hardware_Decoders decoder; +}; + const char* ewk_media_playback_info_media_url_get( Ewk_Media_Playback_Info* data) { LOG_EWK_API_MOCKUP(); @@ -68,6 +78,19 @@ void ewk_media_playback_info_drm_info_set(Ewk_Media_Playback_Info* data, LOG_EWK_API_MOCKUP(); } +Ewk_Hardware_Decoders ewk_media_playback_info_decoder_get( + Ewk_Media_Playback_Info* data) { + EINA_SAFETY_ON_NULL_RETURN_VAL(data, EWK_HARDWARE_DECODERS_NONE); + return data->decoder; +} + +void ewk_media_playback_info_decoder_set( + Ewk_Media_Playback_Info* data, + Ewk_Hardware_Decoders decoder) { + if (data) + data->decoder = decoder; +} + const int ewk_media_playback_info_video_id_get(Ewk_Media_Playback_Info* data) { LOG_EWK_API_MOCKUP(); diff --git a/tizen_src/ewk/efl_integration/public/ewk_media_playback_info.h b/tizen_src/ewk/efl_integration/public/ewk_media_playback_info.h new file mode 100644 index 0000000..b12341e --- /dev/null +++ b/tizen_src/ewk/efl_integration/public/ewk_media_playback_info.h @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2022 Samsung Electronics. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY SAMSUNG ELECTRONICS. AND ITS CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SAMSUNG ELECTRONICS. OR ITS + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file ewk_media_playback_info.h + * @brief This file describes the ewk media playback info API. + */ + +#ifndef ewk_media_playback_info_h +#define ewk_media_playback_info_h +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _Ewk_Media_Playback_Info Ewk_Media_Playback_Info; + +/** + * Get url of media. + * + * @param meia playback info's structure + * + * @return @c media url + */ +EXPORT_API const char* ewk_media_playback_info_media_url_get( + Ewk_Media_Playback_Info* data); + +/** + * Get mime type of media. + * + * @param meia playback info's structure + * + * @return @c mime type + */ +EXPORT_API const char* ewk_media_playback_info_mime_type_get( + Ewk_Media_Playback_Info* data); + +/** + * Get translated url of media. + * + * @param media playback info's structure + * + * @return @c translated url + */ +EXPORT_API const char* ewk_media_playback_info_translated_url_get( + Ewk_Media_Playback_Info* data); + +/** + * Get drm info of media. + * + * @param media playback info's structure + * + * @return @c drm info + */ +EXPORT_API const char* ewk_media_playback_info_drm_info_get( + Ewk_Media_Playback_Info* data); + +/** + * Set media resource acquired of media. + * + * @param media playback info's structure + */ +EXPORT_API void ewk_media_playback_info_media_resource_acquired_set( + Ewk_Media_Playback_Info* data, + Eina_Bool media_resource_acquired); + +/** + * Set translated url of media. + * + * @param media playback info's structure + */ +EXPORT_API void ewk_media_playback_info_translated_url_set( + Ewk_Media_Playback_Info* data, + const char* translated_url); + +/** + * Set drm info of media. + * + * @param media playback info's structure + */ +EXPORT_API void ewk_media_playback_info_drm_info_set( + Ewk_Media_Playback_Info* data, + const char* drm_info); + +#ifdef __cplusplus +} +#endif +#endif // ewk_media_playback_info_h + diff --git a/tizen_src/ewk/efl_integration/public/ewk_media_playback_info_product.h b/tizen_src/ewk/efl_integration/public/ewk_media_playback_info_product.h index a7689d5..3fbc080 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_media_playback_info_product.h +++ b/tizen_src/ewk/efl_integration/public/ewk_media_playback_info_product.h @@ -39,6 +39,15 @@ extern "C" { #endif +/** + * Enum values used to inform webengine about decoder used by broadcast. + */ +typedef enum Ewk_Hardware_Decoders { + EWK_HARDWARE_DECODERS_NONE, + EWK_HARDWARE_DECODERS_MAIN, + EWK_HARDWARE_DECODERS_SUB, +} Ewk_Hardware_Decoders; + typedef struct _Ewk_Media_Playback_Info Ewk_Media_Playback_Info; /** @@ -92,6 +101,16 @@ EXPORT_API const char* ewk_media_playback_info_drm_info_get( Ewk_Media_Playback_Info* data); /** + * Get decoder info of media. + * + * @param data playback info's structure + * + * @return @c decoder name + */ +EXPORT_API Ewk_Hardware_Decoders ewk_media_playback_info_decoder_get( + Ewk_Media_Playback_Info* data); + +/** * Set media resource acquired of media. * * @param media playback info's structure @@ -118,6 +137,15 @@ EXPORT_API void ewk_media_playback_info_drm_info_set( Ewk_Media_Playback_Info* data, const char* drm_info); +/** + * Set decoder info of media. + * + * @param media playback info's structure + */ +EXPORT_API void ewk_media_playback_info_decoder_set( + Ewk_Media_Playback_Info* data, + Ewk_Hardware_Decoders decoder); + Ewk_Media_Playback_Info* ewkMediaPlaybackInfoCreate(const int player_id, const char* url, const char* mime_type); diff --git a/tizen_src/ewk/efl_integration/public/ewk_media_subtitle_info.h b/tizen_src/ewk/efl_integration/public/ewk_media_subtitle_info.h new file mode 100644 index 0000000..ed82339 --- /dev/null +++ b/tizen_src/ewk/efl_integration/public/ewk_media_subtitle_info.h @@ -0,0 +1,99 @@ +// Copyright 2022 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** +* @file ewk_media_subtitle_info.h +* @brief . +*/ + +#ifndef ewk_media_subtitle_info_h +#define ewk_media_subtitle_info_h +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _Ewk_Media_Subtitle_Info Ewk_Media_Subtitle_Info; + +/** +* Get id of subtitle. +* +* @param meia subtitle info's structure +* +* @return @c subtitle id +*/ +EXPORT_API int ewk_media_subtitle_info_id_get(Ewk_Media_Subtitle_Info *data); + +/** +* Get url of subtitle. +* +* @param meia subtitle info's structure +* +* @return @c subtitle url +*/ +EXPORT_API const char *ewk_media_subtitle_info_url_get(Ewk_Media_Subtitle_Info *data); + +/** +* Get srcLang of subtitle. +* +* @param meia subtitle info's structure +* +* @return @c subtitle srcLang +*/ +EXPORT_API const char *ewk_media_subtitle_info_lang_get(Ewk_Media_Subtitle_Info *data); + +/** +* Get label of subtitle. +* +* @param meia subtitle info's structure +* +* @return @c subtitle label +*/ +EXPORT_API const char *ewk_media_subtitle_info_label_get(Ewk_Media_Subtitle_Info *data); + +typedef struct _Ewk_Media_Subtitle_Data Ewk_Media_Subtitle_Data; + +/** +* Get id of subtitle. +* +* @param meia subtitle data's structure +* +* @return @c subtitle id +*/ +EXPORT_API int ewk_media_subtitle_data_id_get(Ewk_Media_Subtitle_Data *data); + +/** +* Get timestamp of subtitle. +* +* @param meia subtitle data's structure +* +* @return @c subtitle timestamp +*/ +EXPORT_API double ewk_media_subtitle_data_timestamp_get(Ewk_Media_Subtitle_Data *data); + +/** +* Get data size of subtitle. +* +* @param meia subtitle data's structure +* +* @return @c subtitle data size +*/ +EXPORT_API unsigned ewk_media_subtitle_data_size_get(Ewk_Media_Subtitle_Data *data); + +/** +* Get data of subtitle. +* +* @param meia subtitle data's structure +* +* @return @c subtitle data +*/ +EXPORT_API const void* ewk_media_subtitle_data_get(Ewk_Media_Subtitle_Data *data); + +#ifdef __cplusplus +} +#endif +#endif // ewk_media_subtitle_info_h \ No newline at end of file diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings.cc b/tizen_src/ewk/efl_integration/public/ewk_settings.cc index 2891773..3fdb1e9 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_settings.cc @@ -716,6 +716,11 @@ Eina_Bool ewk_settings_uses_scrollbar_thumb_focus_notifications_set(Ewk_Settings return EINA_FALSE; } +void ewk_settings_default_audio_input_device_set(Ewk_Settings* settings, const char* device_id) +{ + LOG_EWK_API_MOCKUP(); +} + void ewk_settings_media_playback_notification_set(Ewk_Settings* settings, Eina_Bool enabled) { LOG_EWK_API_MOCKUP(); diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings_product.h b/tizen_src/ewk/efl_integration/public/ewk_settings_product.h index 7f6bdfa..ed82333 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings_product.h +++ b/tizen_src/ewk/efl_integration/public/ewk_settings_product.h @@ -869,6 +869,7 @@ EXPORT_API void ewk_settings_clipboard_enabled_set(Ewk_Settings* settings, Eina_ */ EXPORT_API Eina_Bool ewk_settings_clipboard_enabled_get(const Ewk_Settings* settings); +EXPORT_API void ewk_settings_default_audio_input_device_set(Ewk_Settings* settings, const char* device_id); #ifdef __cplusplus } diff --git a/tizen_src/ewk/efl_integration/public/ewk_user_media_internal.h b/tizen_src/ewk/efl_integration/public/ewk_user_media_internal.h index d6c0ce6..9b933e9 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_user_media_internal.h +++ b/tizen_src/ewk/efl_integration/public/ewk_user_media_internal.h @@ -55,6 +55,18 @@ enum _Ewk_User_Media_Device_Type { typedef enum _Ewk_User_Media_Device_Type Ewk_User_Media_Device_Type; /** + * struct _Ewk_User_Media_State_Info + * @brief Get user media device usability status. + * + */ +struct _Ewk_User_Media_State_Info { + Ewk_User_Media_Device_Type device_type; + uint32_t previous_state; + uint32_t current_state; +}; +typedef struct _Ewk_User_Media_State_Info Ewk_User_Media_State_Info; + +/** * Requests for getting origin of local media permission request. * * @param request Ewk_User_Media_Permission_Request object to get origin for diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index e2c3269..de1b81a 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -1503,12 +1503,31 @@ Eina_Bool ewk_view_key_system_whitelist_set(Evas_Object* ewkView, const char** l return EINA_FALSE; } +Eina_Bool ewk_view_is_video_playing(Evas_Object* o, Ewk_Is_Video_Playing_Callback callback, void* user_data) +{ + LOG_EWK_API_MOCKUP(); + return EINA_FALSE; +} + Eina_Bool ewk_view_active_drm_set(Evas_Object* view, const char* drm_system_id) { LOG_EWK_API_MOCKUP(); return EINA_FALSE; } +void ewk_view_broadcast_decoder_set( + Evas_Object* view, + Ewk_Hardware_Decoders decoder) +{ +#if BUILDFLAG(IS_TIZEN_TV) + EWK_VIEW_IMPL_GET_OR_RETURN(view, impl); + /* waiting for implement*/ + //impl->SetBroadcastDecoder(decoder); +#else + LOG_EWK_API_MOCKUP("Only for Tizen TV."); +#endif +} + void ewk_media_set_subtitle_lang(Evas_Object* ewkView, const char* lang_list) { LOG_EWK_API_MOCKUP(); @@ -1629,3 +1648,7 @@ void ewk_view_request_manifest(Evas_Object* o, EWK_VIEW_IMPL_GET_OR_RETURN(o, impl); impl->RequestManifest(callback, user_data); } + +void ewk_view_media_device_list_get(Evas_Object* o, Ewk_Media_Device_List_Get_Callback callback, void* user_data) { + //TODO +} \ No newline at end of file diff --git a/tizen_src/ewk/efl_integration/public/ewk_view_internal.h b/tizen_src/ewk/efl_integration/public/ewk_view_internal.h index 986e3ef..a7ba801 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view_internal.h +++ b/tizen_src/ewk/efl_integration/public/ewk_view_internal.h @@ -33,6 +33,8 @@ #ifndef ewk_view_internal_h #define ewk_view_internal_h +#include + #include "ewk_app_installation_request_internal.h" #include "ewk_auth_challenge_internal.h" #include "ewk_context_internal.h" @@ -157,6 +159,20 @@ enum Ewk_Mouse_Button_Type { }; typedef enum Ewk_Mouse_Button_Type Ewk_Mouse_Button_Type; +typedef enum _EwkMediaDeviceType{ + MEDIA_DEVICE_TYPE_AUDIO_INPUT, + MEDIA_DEVICE_TYPE_VIDEO_INPUT, + MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, + NUM_MEDIA_DEVICE_TYPES, +} EwkMediaDeviceType; + +typedef struct _EwkMediaDeviceInfo{ + const char* device_id; + const char* label; + EwkMediaDeviceType type; + bool connected; +} EwkMediaDeviceInfo; + /// Ewk view's class, to be overridden by sub-classes. struct Ewk_View_Smart_Class { Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */ @@ -285,6 +301,8 @@ typedef void (*Ewk_View_Scale_Changed_Callback)(Evas_Object *o, double scale_fac */ typedef void (*Ewk_View_SmartRC_Mic_Notification_Callback)(Evas_Object *o, Eina_Bool show, void *user_data); +typedef void (*Ewk_Media_Device_List_Get_Callback)(EwkMediaDeviceInfo* device_list, int size, void* user_data); + /** * The version you have to put into the version field * in the @a Ewk_View_Smart_Class structure. @@ -1487,6 +1505,8 @@ EXPORT_API void ewk_view_feed_mouse_wheel(Evas_Object* o, int x, int y); +EXPORT_API void ewk_view_media_device_list_get(Evas_Object* o, Ewk_Media_Device_List_Get_Callback callback, void* user_data); + #ifdef __cplusplus } #endif diff --git a/tizen_src/ewk/efl_integration/public/ewk_view_product.h b/tizen_src/ewk/efl_integration/public/ewk_view_product.h index 18b8752..6afdf45 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view_product.h +++ b/tizen_src/ewk/efl_integration/public/ewk_view_product.h @@ -34,6 +34,7 @@ #define ewk_view_product_h #include "ewk_context_product.h" +#include "ewk_media_playback_info_product.h" #include "ewk_value_product.h" #include "ewk_view_internal.h" @@ -792,6 +793,15 @@ EXPORT_API Eina_Bool ewk_view_key_system_whitelist_set(Evas_Object* ewkView, EXPORT_API Eina_Bool ewk_view_active_drm_set(Evas_Object* view, const char* drm_system_id); /** + * Inform webengine about decoder used by broadcast for dual decoding. + * + * @param view View object + * @param decoder Identifier of used decoder + */ +EXPORT_API void ewk_view_broadcast_decoder_set(Evas_Object* view, + Ewk_Hardware_Decoders decoder); + +/** * Set the selected text track language to media player. * * @param ewkView view object -- 2.7.4 From a5b0fde42064791f3490c4dba3361116ed145238 Mon Sep 17 00:00:00 2001 From: "feifei08.liu" Date: Mon, 27 Feb 2023 10:03:46 +0800 Subject: [PATCH 03/16] Dummy Implementation for EWK APIs ewk_settings_mixed_contents_set ewk_context_time_offset_set, ewk_context_timezone_offset_set ewk_check_chromium_ready ewk_view_run_mixed_content_confirm_callback_set ewk_settings_mixed_contents_set ewk_view_error_page_load_callback_set ewk_view_add_item_to_back_forward_list ewk_view_poweroff_suspend : empy implement, need check history ewk_view_set_cursor_by_client ewk_settings_ime_handle_key_event_enabled_get/set Change-Id: Ib75af16280c2389be7c22cd9b84e637f54d30d3c Signed-off-by: feifei08.liu --- .../ewk/efl_integration/public/ewk_context.cc | 4 +++ tizen_src/ewk/efl_integration/public/ewk_main.cc | 4 +++ .../ewk/efl_integration/public/ewk_main_internal.h | 12 +++++++ .../ewk/efl_integration/public/ewk_settings.cc | 10 ++++++ .../efl_integration/public/ewk_settings_product.h | 21 ++++++++++++ tizen_src/ewk/efl_integration/public/ewk_view.cc | 16 +++++++++- .../ewk/efl_integration/public/ewk_view_product.h | 37 ++++++++++++++++++++++ 7 files changed, 103 insertions(+), 1 deletion(-) diff --git a/tizen_src/ewk/efl_integration/public/ewk_context.cc b/tizen_src/ewk/efl_integration/public/ewk_context.cc index 545869b..438dc40 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_context.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_context.cc @@ -1054,6 +1054,10 @@ Ewk_Application_Type ewk_context_application_type_get(Ewk_Context* ewkContext) { #endif } +void ewk_context_time_offset_set(Ewk_Context* context, double time_offset) {} +void ewk_context_timezone_offset_set(Ewk_Context* context, + double time_zone_offset, + double daylight_saving_time) {} void ewk_context_default_zoom_factor_set(Ewk_Context* context, double zoom_factor) { EINA_SAFETY_ON_NULL_RETURN(context); diff --git a/tizen_src/ewk/efl_integration/public/ewk_main.cc b/tizen_src/ewk/efl_integration/public/ewk_main.cc index 5900023..841e303 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_main.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_main.cc @@ -261,3 +261,7 @@ void _ewk_force_acceleration() setenv("ELM_ACCEL", "hw", 1); } +Eina_Bool ewk_check_chromium_ready() { + return false; +} + diff --git a/tizen_src/ewk/efl_integration/public/ewk_main_internal.h b/tizen_src/ewk/efl_integration/public/ewk_main_internal.h index c0d7498..8a9b396 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_main_internal.h +++ b/tizen_src/ewk/efl_integration/public/ewk_main_internal.h @@ -161,6 +161,18 @@ EINA_DEPRECATED EXPORT_API void ewk_home_directory_set(const char* path); */ EXPORT_API int ewk_set_version_policy(int preference); +/** + * @brief Check if the chromium mount is done. + * + * @details Check if the chromium mount is complete by calling LwipcIsDone. + * + * @since_tizen 5.5 + * + * @return @c true if chromium mount is done, otherwise @c false + * + */ +EXPORT_API Eina_Bool ewk_check_chromium_ready(); + #ifdef __cplusplus } #endif diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings.cc b/tizen_src/ewk/efl_integration/public/ewk_settings.cc index 3fdb1e9..9d012e0 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_settings.cc @@ -804,6 +804,11 @@ void ewk_settings_disclose_set_cookie_headers_enabled(Ewk_Settings* settings, Ei LOG_EWK_API_MOCKUP(); } +Eina_Bool ewk_settings_mixed_contents_set(const Ewk_Settings* settings, Eina_Bool allow) +{ + return EINA_FALSE; +} + Eina_Bool ewk_settings_viewport_meta_tag_set(Ewk_Settings* settings, Eina_Bool enable) { LOG_EWK_API_MOCKUP(); @@ -928,3 +933,8 @@ Eina_Bool ewk_settings_multiple_windows_support_get(Ewk_Settings* settings) { EINA_SAFETY_ON_NULL_RETURN_VAL(settings, EINA_FALSE); return settings->getPreferences().supports_multiple_windows; } +void ewk_settings_ime_handle_key_event_enabled_set(Ewk_Settings* settings, Eina_Bool Enabled) {} +Eina_Bool ewk_settings_ime_handle_key_event_enabled_get(const Ewk_Settings* settings) +{ + return EINA_FALSE; +} diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings_product.h b/tizen_src/ewk/efl_integration/public/ewk_settings_product.h index ed82333..9f97dc9 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings_product.h +++ b/tizen_src/ewk/efl_integration/public/ewk_settings_product.h @@ -871,6 +871,27 @@ EXPORT_API Eina_Bool ewk_settings_clipboard_enabled_get(const Ewk_Settings* sett EXPORT_API void ewk_settings_default_audio_input_device_set(Ewk_Settings* settings, const char* device_id); +/** + * Request to set enable/disable use ime to handle key event + * + * By default, use ime to handle key event is enabled + * Some Apps want to disable use ime to handle key event + * + * @param settings setting object + * @param Enabled @c EINA_TRUE to enable use ime to handle key event + * @c EINA_FALSE to disable use ime to handle key event + * + */ +EXPORT_API void ewk_settings_ime_handle_key_event_enabled_set(Ewk_Settings* settings, Eina_Bool Enabled); + +/** + * Returns whether use ime to handle key event is enabled or disabled + * + * @param settings setting object + * + * @return @c EINA_TRUE enable use ime to handle key event or @c EINA_FALSE disable use ime to handle key event + */ +EXPORT_API Eina_Bool ewk_settings_ime_handle_key_event_enabled_get(const Ewk_Settings *settings); #ifdef __cplusplus } #endif diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index de1b81a..84d42d0 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -1457,6 +1457,8 @@ Eina_Bool ewk_view_set_support_video_hole(Evas_Object* ewkView, #endif } +void ewk_view_set_cursor_by_client(Evas_Object* ewkView, Eina_Bool enable) {} + void ewk_view_widget_pepper_extension_callback_set(Evas_Object* ewk_view, Generic_Sync_Call_Callback cb, void* user_data) { LOG_EWK_API_MOCKUP(); } @@ -1651,4 +1653,16 @@ void ewk_view_request_manifest(Evas_Object* o, void ewk_view_media_device_list_get(Evas_Object* o, Ewk_Media_Device_List_Get_Callback callback, void* user_data) { //TODO -} \ No newline at end of file +} +void ewk_view_run_mixed_content_confirm_callback_set( + Evas_Object* /* ewkView */, + Ewk_View_Run_Mixed_Content_Confirm_Callback /* callback */, + void* /* user_data */) {} +void ewk_view_error_page_load_callback_set(Evas_Object* ewk_view, Ewk_View_Error_Page_Load_Callback callback, void* user_data) {} + +Eina_Bool ewk_view_add_item_to_back_forward_list(Evas_Object* o, const Ewk_Back_Forward_List_Item* item) +{ + return EINA_FALSE; +} + +void ewk_view_poweroff_suspend(Evas_Object *item) {} diff --git a/tizen_src/ewk/efl_integration/public/ewk_view_product.h b/tizen_src/ewk/efl_integration/public/ewk_view_product.h index 6afdf45..bf42a4a 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view_product.h +++ b/tizen_src/ewk/efl_integration/public/ewk_view_product.h @@ -35,6 +35,7 @@ #include "ewk_context_product.h" #include "ewk_media_playback_info_product.h" +#include "ewk_error.h" #include "ewk_value_product.h" #include "ewk_view_internal.h" @@ -1360,6 +1361,42 @@ EXPORT_API void ewk_view_floating_window_state_changed(const Evas_Object *o, Ein EXPORT_API void ewk_view_auto_login(Evas_Object *view, const char* user_name, const char* password); /** + * @brief A ErrorPage contains information that get from app side. + * + * @since_tizen 6.5 + */ +struct _Ewk_Error_Page { + const char* content; /**< The content of error page */ +}; + +/** + * @brief A struct that creates a type name for the #Ewk_Error_Page. + * @since_tizen 6.5 + */ +typedef struct _Ewk_Error_Page Ewk_Error_Page; + +/** + * Callback for ewk_view_error_page_load_callback_set + * + * @param o view object. + * @param error_info Query failing URL for this error. + * @param error_page Get customer error page from app side. + * @param user_data user data will be passed while ewk_view_error_page_load_callback_set is called. + */ +typedef void (*Ewk_View_Error_Page_Load_Callback)(Evas_Object* o, const Ewk_Error* error_info, Ewk_Error_Page* error_page, void* user_data); + +/** + * @brief Get customer error page html string while app set callback. + * + * @since_tizen 6.5 + * + * @param[in] o view object + * @param callback callback function + * @param user_data user data will be passed when the callback is called + */ +EXPORT_API void ewk_view_error_page_load_callback_set(Evas_Object* ewk_view, Ewk_View_Error_Page_Load_Callback callback, void* user_data); + +/** * @} */ -- 2.7.4 From 1e6177d524c5c2dbab08d5d0a343e14417ba7070 Mon Sep 17 00:00:00 2001 From: v-saha Date: Fri, 17 Feb 2023 18:04:31 +0530 Subject: [PATCH 04/16] [M108 Migration] Selection & Context menu controller. This change migrates below fixes related to context menu/text selection. 1. Uses GetSelectedText in RWHVA. 2. Avoid hiding context menu during potrait to landscape and vice versa. 3. Do not restore context popup when in caret mode. Reference: https://review.tizen.org/gerrit/282457 Change-Id: Iadc9cb3c5bb9948b867c24ba825e658260908a8c Signed-off-by: v-saha --- .../browser/selection/selection_controller_efl.cc | 28 +++++--- .../browser/selection/selection_controller_efl.h | 4 +- .../efl_integration/context_menu_controller_efl.cc | 80 +++++++++++++++++----- .../web_contents_view_delegate_ewk.cc | 2 +- 4 files changed, 83 insertions(+), 31 deletions(-) diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc index efca84b..225550c 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc +++ b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc @@ -137,9 +137,8 @@ bool SelectionControllerEfl::GetCaretSelectionStatus() const { return selection_mode_ == SelectionMode::CARET; } -void SelectionControllerEfl::SetControlsTemporarilyHidden( - bool value, - bool from_custom_scroll_callback) { +void SelectionControllerEfl::SetControlsTemporarilyHidden(bool value, + bool set_forcefully) { TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "controls are hidden:", value); if (controls_temporarily_hidden_ == value) @@ -147,7 +146,7 @@ void SelectionControllerEfl::SetControlsTemporarilyHidden( // Make sure to show selection controls only when no finger // is left touching the screen. if (!value && rwhva_->event_handler()->pointer_state().GetPointerCount() && - !from_custom_scroll_callback) { + !set_forcefully) { return; } controls_temporarily_hidden_ = value; @@ -164,13 +163,14 @@ void SelectionControllerEfl::SetIsAnchorFirst(bool value) { } void SelectionControllerEfl::TriggerOnSelectionChange() { + triggered_selection_change_ = true; OnSelectionChanged(start_selection_, end_selection_); } void SelectionControllerEfl::OnSelectionChanged( const gfx::SelectionBound& start, const gfx::SelectionBound& end) { if (start_selection_ == start && end_selection_ == end && - selection_change_reason_ != Reason::RequestedByContextMenu) + !triggered_selection_change_) return; if (selection_change_reason_ != Reason::HandleDragged) @@ -202,11 +202,12 @@ void SelectionControllerEfl::OnSelectionChanged( bool show = (selection_change_reason_ != Reason::Irrelevant) && !finger_down; UpdateSelectionDataAndShow( truncated_start, truncated_end, show); + triggered_selection_change_ = false; selection_change_reason_ = Reason::Irrelevant; // In case of the selected text contains only line break and no other // characters, we should use caret selection mode. - if (GetSelectionEditable() && !handle_being_dragged_ && + if (GetSelectionEditable() && !handle_being_dragged_ && rwhva_ && rwhva_->GetSelectedText() == (u"\n")) { rwhva_->offscreen_helper()->MoveCaret( selection_data_->GetLeftRect().origin()); @@ -238,6 +239,11 @@ void SelectionControllerEfl::OnTextInputStateChanged() { HideHandleAndContextMenu(); ClearSelection(); } + + if (selection_change_reason_ == Reason::CaretModeForced) { + is_caret_mode_forced_ = false; + selection_change_reason_ = Reason::Irrelevant; + } } void SelectionControllerEfl::UpdateSelectionData(const std::u16string& text) { @@ -308,10 +314,8 @@ bool SelectionControllerEfl::UpdateSelectionDataAndShow( return false; } - if (selection_changed || - selection_change_reason_ == Reason::RequestedByContextMenu) { + if (selection_changed || triggered_selection_change_) ShowHandleAndContextMenuIfRequired(); - } return true; } @@ -389,6 +393,11 @@ void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired( selection_change_reason_ = saved_reason; ShowContextMenu(); } + + // In order to keep selection controlls showing up, + // Reason::CaretModeForced should be used as a reason of selection change. + if (is_caret_mode_forced_) + selection_change_reason_ = Reason::CaretModeForced; return; } input_handle_->Hide(); @@ -709,7 +718,6 @@ void SelectionControllerEfl::HandlePostponedGesture(int x, bool SelectionControllerEfl::HandleLongPressEvent( const gfx::Point& touch_point, const content::ContextMenuParams& params) { - if (params.is_editable) { // If one long press on an empty form, do not enter selection mode. // Instead, context menu will be shown if needed for clipboard actions. diff --git a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h index b41234c..c687da4 100644 --- a/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h +++ b/tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.h @@ -86,8 +86,7 @@ class CONTENT_EXPORT SelectionControllerEfl { void HideHandleAndContextMenu(); bool IsAnyHandleVisible() const; - void SetControlsTemporarilyHidden(bool hidden, - bool from_custom_scroll_callback = false); + void SetControlsTemporarilyHidden(bool hidden, bool set_forcefully = false); gfx::Rect GetLeftRect() const; gfx::Rect GetRightRect() const; @@ -240,6 +239,7 @@ class CONTENT_EXPORT SelectionControllerEfl { enum ContextMenuStatus context_menu_status_ = ContextMenuStatus::NONE; enum SelectionMode selection_mode_ = SelectionMode::NONE; + bool triggered_selection_change_ = false; gfx::SelectionBound start_selection_; gfx::SelectionBound end_selection_; }; diff --git a/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc b/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc index 0590549..838a328 100644 --- a/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc +++ b/tizen_src/ewk/efl_integration/context_menu_controller_efl.cc @@ -225,24 +225,66 @@ void ContextMenuControllerEfl::GetProposedContextMenu() { params_.link_url.spec(), params_.link_url.spec()); } - RenderWidgetHostViewAura* rwhva = static_cast( - web_contents_.GetRenderWidgetHostView()); - if ((params_.media_type != ContextMenuDataMediaType::kImage && - !params_.selection_text.empty()) || - (params_.is_editable && - (rwhva && rwhva->offscreen_helper()->HasSelectableText()))) { - AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SELECT_WORD, - std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ABB"))); - AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, EWK_CONTEXT_MENU_ITEM_TAG_SELECT_ALL, - std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ALL_ABB"))); -#if BUILDFLAG(IS_TIZEN) - if (!params_.is_editable && !params_.selection_text.empty()) { - // TODO: IDS_WEBVIEW_OPT_SHARE should be added for all po files. - AddItemToProposedList(EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, - EWK_CONTEXT_MENU_ITEM_TAG_SHARE, - dgettext("WebKit", "IDS_WEBVIEW_OPT_SHARE")); + if (params_.is_editable) { + RenderWidgetHostViewAura* rwhva = static_cast( + web_contents_.GetRenderWidgetHostView()); + const SelectionControllerEfl* controller = + webview_->GetSelectionController(); + bool should_add_select_and_select_all = + (!controller) ? true : !controller->IsCaretModeForced(); + + if (rwhva && rwhva->offscreen_helper()->HasSelectableText() && + should_add_select_and_select_all) { + if (params_.selection_text.empty() && + params_.input_field_type != + blink::mojom::ContextMenuDataInputFieldType::kPassword) { + AddItemToProposedList( + EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, + EWK_CONTEXT_MENU_ITEM_TAG_SELECT_WORD, + std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ABB"))); + } + + // This is a tricky way to check if everything in the editable field is + // selected, because there is no other known way. + // + // * params_.selection_text contains selected text + // * rwhva->GetSelectedText() contains selected + // text and some text around selection + // + // If both strings are the same length, it means that the selection has + // no more text around it, so everything is already selected. + // + // There is also one more issue with this hack: if the last character of + // textarea is '\n', there will be additional '\n' reported in selection + // with surrounding characters, which isn't reported in selection text + // from params_. This means that lengths aren't equal, so normal length + // check won't work. + // + // To work around this, we assume that everything is already selected if + // selection with surroundings is one character longer than selection, + // and that last character is '\n'. + size_t surroundings_length = rwhva->GetSelectedText().length(); + size_t selection_length = params_.selection_text.length(); + char16_t surroundings_last_char = + rwhva->GetSelectedText()[surroundings_length - 1]; + + if (surroundings_length != selection_length && + !(surroundings_length == selection_length + 1 && + surroundings_last_char == '\n')) { + AddItemToProposedList( + EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, + EWK_CONTEXT_MENU_ITEM_TAG_SELECT_ALL, + std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ALL_ABB"))); + } + } + } else { + if (params_.media_type != ContextMenuDataMediaType::kImage && + is_text_selection_) { + AddItemToProposedList( + EWK_CONTEXT_MENU_ITEM_TYPE_ACTION, + EWK_CONTEXT_MENU_ITEM_TAG_SELECT_ALL, + std::string(dgettext("WebKit", "IDS_WEBVIEW_OPT_SELECT_ALL_ABB"))); } -#endif } #if BUILDFLAG(IS_TIZEN) if (IsMobileProfile() && params_.is_draggable && @@ -437,8 +479,10 @@ Eina_Bool ContextMenuControllerEfl::RestoreTimerCallback(void* data) { menu_controller->webview_->GetSelectionController(); if (menu_controller->popup_ && selection_controller && - selection_controller->GetSelectionStatus()) + selection_controller->GetSelectionStatus() && + !selection_controller->IsCaretMode()) { evas_object_show(menu_controller->popup_); + } menu_controller->restore_timer_ = nullptr; diff --git a/tizen_src/ewk/efl_integration/web_contents_view_delegate_ewk.cc b/tizen_src/ewk/efl_integration/web_contents_view_delegate_ewk.cc index f4433aa..e3b770e 100644 --- a/tizen_src/ewk/efl_integration/web_contents_view_delegate_ewk.cc +++ b/tizen_src/ewk/efl_integration/web_contents_view_delegate_ewk.cc @@ -19,7 +19,7 @@ WebContentsViewDelegateEwk::WebContentsViewDelegateEwk(EWebView* wv) void WebContentsViewDelegateEwk::ShowContextMenu( content::RenderFrameHost& render_frame_host, const content::ContextMenuParams& params) { - if (params.source_type == ui::MENU_SOURCE_TOUCH) { + if (params.source_type == ui::MENU_SOURCE_LONG_PRESS) { CHECK(web_view_->TouchEventsEnabled()); web_view_->HandleLongPressGesture(params); } else { -- 2.7.4 From 64a65afa2043ece77891a3af6ac1949a987c83c0 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Fri, 24 Feb 2023 13:44:45 +0800 Subject: [PATCH 05/16] [M108 Migration] Implement ewk_settings_do_not_track_set() API Set to add http head DNT(do not track). Reference: - https://review.tizen.org/gerrit/#/c/279422/ Change-Id: Iee5403811413d091d53aa14b8ab4033ac576be0a Signed-off-by: Jie Zhang --- tizen_src/ewk/efl_integration/eweb_view.cc | 21 +++++++++++++++++++++ tizen_src/ewk/efl_integration/eweb_view.h | 1 + .../ewk/efl_integration/public/ewk_settings.cc | 10 ++++++++++ 3 files changed, 32 insertions(+) diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index cfac19e..e561e8b 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -2989,6 +2989,27 @@ bool EWebView::SetVisibility(bool enable) { return true; } +void EWebView::SetDoNotTrack(Eina_Bool enable) { + // enable: 0 User tend to allow tracking on the target site. + // enable: 1 User tend to not be tracked on the target site. + if (web_contents_->GetMutableRendererPrefs()->enable_do_not_track == enable) + return; + + // Set navigator.doNotTrack attribute + web_contents_->GetMutableRendererPrefs()->enable_do_not_track = enable; + web_contents_->SyncRendererPrefs(); + + // Set or remove DNT HTTP header, the effects will depend on design of target + // site. + if (!context()) + return; + + if (enable) + context()->HTTPCustomHeaderAdd("DNT", "1"); + else + context()->HTTPCustomHeaderRemove("DNT"); +} + #if defined(TIZEN_ATK_SUPPORT) void EWebView::UpdateSpatialNavigationStatus(Eina_Bool enable) { if (settings_->getPreferences().spatial_navigation_enabled == enable) diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index 3df69fb..0b98cfc 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -650,6 +650,7 @@ class EWebView { const gfx::Vector2dF& latest_overscroll_delta); bool SetVisibility(bool enable); + void SetDoNotTrack(Eina_Bool); #if defined(TIZEN_ATK_SUPPORT) void UpdateSpatialNavigationStatus(Eina_Bool enable); diff --git a/tizen_src/ewk/efl_integration/public/ewk_settings.cc b/tizen_src/ewk/efl_integration/public/ewk_settings.cc index 9d012e0..62ddad1 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_settings.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_settings.cc @@ -809,6 +809,16 @@ Eina_Bool ewk_settings_mixed_contents_set(const Ewk_Settings* settings, Eina_Boo return EINA_FALSE; } +Eina_Bool ewk_settings_do_not_track_set(Ewk_Settings* settings, Eina_Bool enabled) +{ + EWK_VIEW_IMPL_GET_OR_RETURN( + const_cast(settings)->getEvasObject(), webview, + EINA_FALSE); + LOG(INFO) << "set do not track : " << enabled; + webview->SetDoNotTrack(enabled); + return EINA_TRUE; +} + Eina_Bool ewk_settings_viewport_meta_tag_set(Ewk_Settings* settings, Eina_Bool enable) { LOG_EWK_API_MOCKUP(); -- 2.7.4 From bb36f32fd42542a54e047bcd7c5c7ee300ec18d2 Mon Sep 17 00:00:00 2001 From: zhaosy Date: Tue, 28 Feb 2023 13:25:55 +0800 Subject: [PATCH 06/16] [M108 Migration][WRTjs][VD] define lib_dir_path lib_dir_path is not defined, so mount app is fail. Reference: https://review.tizen.org/gerrit/281394/ Change-Id: I2835bf83f2498615db3a5f728fd0979fca1225b1 Signed-off-by: zhaosy --- packaging/chromium-efl.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packaging/chromium-efl.spec b/packaging/chromium-efl.spec index 351af4f..3de8812 100755 --- a/packaging/chromium-efl.spec +++ b/packaging/chromium-efl.spec @@ -390,6 +390,9 @@ fi %else "build_chrome=false" \ %endif +%if "%{?tizen_profile_name}" == "tv" + "lib_dir_path=\"%{_libdir}\"" \ +%endif %if "%{?_ttrace}" == "1" "use_ttrace=true" \ %endif -- 2.7.4 From 65811819a9d642863612b84bcc7d74eb4b9bf3f4 Mon Sep 17 00:00:00 2001 From: "fr.fang" Date: Tue, 28 Feb 2023 09:15:08 +0800 Subject: [PATCH 07/16] [M108 Migration][VD][HBBTV][API] Support DVB scheme for HBBTV 1.This CL implement api ewk_context_register_url_schemes_as_cors_enabled. With this CL, WebEngine can parse dvb url host as CORS. 2.Remove WRT dependency of injected bundle, only HbbTV uses it. 3.Fix the loss of IPC message caused by multithreading. This patch includes : 1) Added protection for NULL message in IPC. There was no exception handling for the NULL message in low memory situation. 2) Fix the issue the deleted message is used again. When multiple render process exit ,the message is deleted after it send to one render process. Copy the message before it is sent to render process. References: https://review.tizen.org/gerrit/#/c/251270/ https://review.tizen.org/gerrit/#/c/250990 https://review.tizen.org/gerrit/#/c/255829 Change-Id: Iaf0084a385649fda71d2c0856398b0c26458c919 Signed-off-by: fr.fang --- ipc/ipc_channel_mojo.cc | 10 ++- third_party/blink/public/web/web_security_policy.h | 4 ++ .../renderer/core/exported/web_security_policy.cc | 7 +- .../renderer/platform/weborigin/scheme_registry.cc | 7 ++ .../renderer/platform/weborigin/scheme_registry.h | 3 + tizen_src/ewk/efl_integration/BUILD.gn | 6 ++ .../efl_integration/common/content_switches_efl.cc | 2 + .../efl_integration/common/content_switches_efl.h | 2 + .../efl_integration/common/render_messages_ewk.h | 6 ++ .../efl_integration/content_browser_client_efl.cc | 22 +++---- tizen_src/ewk/efl_integration/eweb_context.cc | 27 ++++++-- tizen_src/ewk/efl_integration/eweb_context.h | 1 + .../efl_integration/private/ewk_context_private.cc | 5 ++ .../efl_integration/private/ewk_context_private.h | 3 + .../ewk/efl_integration/public/ewk_context.cc | 8 ++- .../renderer/content_renderer_client_efl.cc | 4 ++ tizen_src/ewk/efl_integration/wrt/dynamicplugin.cc | 8 +++ tizen_src/ewk/efl_integration/wrt/dynamicplugin.h | 2 +- .../ewk/efl_integration/wrt/hbbtv_dynamicplugin.cc | 44 +++++++++++++ .../ewk/efl_integration/wrt/hbbtv_dynamicplugin.h | 43 +++++++++++++ tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc | 75 ++++++++++++++++++++++ tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h | 30 +++++++++ .../ewk/efl_integration/wrt/hbbtv_widget_host.cc | 55 ++++++++++++++++ .../ewk/efl_integration/wrt/hbbtv_widget_host.h | 27 ++++++++ tizen_src/ewk/efl_integration/wrt/v8widget.cc | 7 ++ .../ewk/efl_integration/wrt/wrt_widget_host.cc | 3 +- 26 files changed, 384 insertions(+), 27 deletions(-) create mode 100644 tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.cc create mode 100644 tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.h create mode 100644 tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc create mode 100644 tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h create mode 100644 tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc create mode 100644 tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h diff --git a/ipc/ipc_channel_mojo.cc b/ipc/ipc_channel_mojo.cc index 2189911..2aabd6e 100644 --- a/ipc/ipc_channel_mojo.cc +++ b/ipc/ipc_channel_mojo.cc @@ -268,12 +268,6 @@ void ChannelMojo::OnAssociatedInterfaceRequest( } bool ChannelMojo::Send(Message* message) { - DVLOG(2) << "sending message @" << message << " on channel @" << this - << " with type " << message->type(); -#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) - Logging::GetInstance()->OnSendMessage(message); -#endif - std::unique_ptr scoped_message = base::WrapUnique(message); if (!message_reader_) return false; @@ -326,6 +320,10 @@ MojoResult ChannelMojo::ReadFromMessageAttachmentSet( DCHECK(!*handles); MojoResult result = MOJO_RESULT_OK; +#if BUILDFLAG(IS_TIZEN_TV) + if (!message) + return MOJO_RESULT_INVALID_ARGUMENT; +#endif if (!message->HasAttachments()) return result; diff --git a/third_party/blink/public/web/web_security_policy.h b/third_party/blink/public/web/web_security_policy.h index 0d2516e..f134b97 100644 --- a/third_party/blink/public/web/web_security_policy.h +++ b/third_party/blink/public/web/web_security_policy.h @@ -131,6 +131,10 @@ class BLINK_EXPORT WebSecurityPolicy { // renderer whether the script content has changed rather than relying on a // response time match from the network cache. static void RegisterURLSchemeAsCodeCacheWithHashing(const WebString&); +#if BUILDFLAG(IS_TIZEN_TV) + // Registers a non-HTTP URL scheme which can be sent CORS requests. + BLINK_EXPORT static void RegisterURLSchemeAsCORSEnabled(const WebString&); +#endif private: WebSecurityPolicy() = delete; diff --git a/third_party/blink/renderer/core/exported/web_security_policy.cc b/third_party/blink/renderer/core/exported/web_security_policy.cc index f6782f5..0a39346 100644 --- a/third_party/blink/renderer/core/exported/web_security_policy.cc +++ b/third_party/blink/renderer/core/exported/web_security_policy.cc @@ -157,5 +157,10 @@ void WebSecurityPolicy::RegisterURLSchemeAsCodeCacheWithHashing( const WebString& scheme) { SchemeRegistry::RegisterURLSchemeAsCodeCacheWithHashing(scheme); } - +#if BUILDFLAG(IS_TIZEN_TV) +void WebSecurityPolicy::RegisterURLSchemeAsCORSEnabled( + const WebString& scheme) { + SchemeRegistry::RegisterURLSchemeAsCORSEnabled(scheme); +} +#endif } // namespace blink diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc index 4eadf46..d8d2a37 100644 --- a/third_party/blink/renderer/platform/weborigin/scheme_registry.cc +++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.cc @@ -270,6 +270,13 @@ bool SchemeRegistry::ShouldTreatURLSchemeAsAllowingServiceWorkers( return GetURLSchemesRegistry().service_worker_schemes.Contains(scheme); } +#if BUILDFLAG(IS_TIZEN_TV) +void SchemeRegistry::RegisterURLSchemeAsCORSEnabled(const String& scheme) { + DCHECK_EQ(scheme, scheme.LowerASCII()); + GetMutableURLSchemesRegistry().cors_enabled_schemes.insert(scheme); +} +#endif + void SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI( const String& scheme) { DCHECK_EQ(scheme, scheme.LowerASCII()); diff --git a/third_party/blink/renderer/platform/weborigin/scheme_registry.h b/third_party/blink/renderer/platform/weborigin/scheme_registry.h index fa56039..ef51319 100644 --- a/third_party/blink/renderer/platform/weborigin/scheme_registry.h +++ b/third_party/blink/renderer/platform/weborigin/scheme_registry.h @@ -76,6 +76,9 @@ class PLATFORM_EXPORT SchemeRegistry { const String& scheme); static bool ShouldTreatURLSchemeAsCorsEnabled(const String& scheme); +#if BUILDFLAG(IS_TIZEN_TV) + static void RegisterURLSchemeAsCORSEnabled(const String& scheme); +#endif // Serialize the registered schemes in a comma-separated list. static String ListOfCorsEnabledURLSchemes(); diff --git a/tizen_src/ewk/efl_integration/BUILD.gn b/tizen_src/ewk/efl_integration/BUILD.gn index 2624586..78b2eb7 100755 --- a/tizen_src/ewk/efl_integration/BUILD.gn +++ b/tizen_src/ewk/efl_integration/BUILD.gn @@ -615,6 +615,12 @@ shared_library("chromium-ewk") { sources += [ "common/application_type.cc", "common/application_type.h", + "wrt/hbbtv_dynamicplugin.cc", + "wrt/hbbtv_dynamicplugin.h", + "wrt/hbbtv_widget.cc", + "wrt/hbbtv_widget.h", + "wrt/hbbtv_widget_host.cc", + "wrt/hbbtv_widget_host.h", ] } diff --git a/tizen_src/ewk/efl_integration/common/content_switches_efl.cc b/tizen_src/ewk/efl_integration/common/content_switches_efl.cc index d7f83f9..230c974 100644 --- a/tizen_src/ewk/efl_integration/common/content_switches_efl.cc +++ b/tizen_src/ewk/efl_integration/common/content_switches_efl.cc @@ -16,6 +16,8 @@ const char kInjectedBundlePath[] = "injected-bundle-path"; #if BUILDFLAG(IS_TIZEN_TV) // Save ApplicationType in command line. const char kApplicationType[] = "application-type"; +// CORS enabled URL schemes +const char kCORSEnabledURLSchemes[] = "cors-enabled-url-schemes"; #endif // Widget Info diff --git a/tizen_src/ewk/efl_integration/common/content_switches_efl.h b/tizen_src/ewk/efl_integration/common/content_switches_efl.h index ff0b1a2..75318c7 100644 --- a/tizen_src/ewk/efl_integration/common/content_switches_efl.h +++ b/tizen_src/ewk/efl_integration/common/content_switches_efl.h @@ -21,6 +21,8 @@ CONTENT_EXPORT extern const char kInjectedBundlePath[]; #if BUILDFLAG(IS_TIZEN_TV) // Save ApplicationType in command line. CONTENT_EXPORT extern const char kApplicationType[]; +// CORS enabled url schemes +CONTENT_EXPORT extern const char kCORSEnabledURLSchemes[]; #endif CONTENT_EXPORT extern const char kTizenAppId[]; CONTENT_EXPORT extern const char kTizenAppVersion[]; diff --git a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h index ecc54df..6162bc0 100644 --- a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h +++ b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h @@ -253,3 +253,9 @@ IPC_MESSAGE_CONTROL2(EwkProcessMsg_SetExtensibleAPI, bool /* enable */) IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript) + +#if BUILDFLAG(IS_TIZEN_TV) +IPC_MESSAGE_CONTROL1(HbbtvMsg_RegisterURLSchemesAsCORSEnabled, + std::string /* scheme */) + +#endif diff --git a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc index 5107d5a..a3c723d 100644 --- a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc +++ b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc @@ -54,6 +54,10 @@ #include "content/browser/speech/tizen_speech_recognition_manager_delegate.h" #endif +#if BUILDFLAG(IS_TIZEN_TV) +#include "wrt/hbbtv_widget_host.h" +#endif + using web_contents_utils::WebContentsFromFrameID; using web_contents_utils::WebContentsFromViewID; using web_contents_utils::WebViewFromWebContents; @@ -121,6 +125,13 @@ void AppendExtraCommandLineSwitchesInternal(base::CommandLine* command_line, command_line->AppendSwitchASCII( switches::kApplicationType, base::NumberToString(static_cast(application_type))); + + const std::string& cors_enabled_url_schemes = + HbbtvWidgetHost::Get().GetCORSEnabledURLSchemes(); + if (!cors_enabled_url_schemes.empty()) { + command_line->AppendSwitchASCII(switches::kCORSEnabledURLSchemes, + cors_enabled_url_schemes); + } #endif const std::string& injectedBundlePath = context->GetInjectedBundlePath(); @@ -134,17 +145,6 @@ void AppendExtraCommandLineSwitchesInternal(base::CommandLine* command_line, command_line->AppendSwitchASCII(switches::kTizenAppId, tizen_app_id); command_line->AppendSwitchASCII(switches::kTizenAppVersion, context->GetTizenAppVersion()); - - double scale = context->GetWidgetScale(); - command_line->AppendSwitchASCII(switches::kWidgetScale, - base::NumberToString(scale)); - - const std::string& widget_theme = context->GetWidgetTheme(); - command_line->AppendSwitchASCII(switches::kWidgetTheme, widget_theme); - - const std::string& widget_encoded_bundle = context->GetWidgetEncodedBundle(); - command_line->AppendSwitchASCII(switches::kWidgetEncodedBundle, - widget_encoded_bundle); } void DispatchPopupBlockedOnUIThread(int render_process_id, diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index 1af63b7..a85d627 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -52,7 +52,6 @@ #include "ewk_global_data.h" #include "private/ewk_favicon_database_private.h" #include "private/ewk_security_origin_private.h" -#include "wrt/dynamicplugin.h" #include "wrt/wrt_widget_host.h" #if BUILDFLAG(IS_TIZEN) @@ -67,6 +66,8 @@ #if BUILDFLAG(IS_TIZEN_TV) #include "common/application_type.h" +#include "wrt/hbbtv_dynamicplugin.h" +#include "wrt/hbbtv_widget_host.h" #endif using content::BrowserThread; @@ -264,14 +265,15 @@ void EWebContext::SetTizenAppId(const std::string& tizen_app_id) { // because it is handled in crosswalk side in single process mode. content::GetGenericZygote()->DropProcessPrivileges(tizen_app_id_); } -#if !defined(EWK_BRINGUP) // FIXME: m108 bringup - // Set DynamicPlugin to convert file scheme(file://) for Tizen HbbTV. +#if BUILDFLAG(IS_TIZEN_TV) + // Set DynamicPlugin to convert file scheme(file://) for HbbTV // Important: WRT doesn't use 'injected bundle' anymore - if (!tizen_app_id_.empty() && !injected_bundle_path_.empty()) { - DynamicPlugin* plugin = &DynamicPlugin::Get(V8Widget::Type::WRT); + if (application_type_ == EWK_APPLICATION_TYPE_HBBTV && + !injected_bundle_path_.empty()) { + auto* plugin = &HbbtvDynamicPlugin::Get(); plugin->Init(injected_bundle_path_); } -#endif // EWK_BRINGUP +#endif // IS_TIZEN_TV #endif // IS_TIZEN } @@ -986,6 +988,19 @@ void EWebContext::SetApplicationType( break; } } + +void EWebContext::RegisterURLSchemesAsCORSEnabled( + const Eina_List* schemes_list) { + std::string schemes; + const Eina_List* it; + const void* scheme; + EINA_LIST_FOREACH(schemes_list, it, scheme) { + schemes += static_cast(scheme); + schemes += ","; + } + + HbbtvWidgetHost::Get().RegisterURLSchemesAsCORSEnabled(schemes); +} #endif void EWebContext::SetMaxRefreshRate(int max_refresh_rate) { diff --git a/tizen_src/ewk/efl_integration/eweb_context.h b/tizen_src/ewk/efl_integration/eweb_context.h index a2162df..8d3d772 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.h +++ b/tizen_src/ewk/efl_integration/eweb_context.h @@ -202,6 +202,7 @@ class EWebContext { #if BUILDFLAG(IS_TIZEN_TV) void SetApplicationType(const Ewk_Application_Type application_type); Ewk_Application_Type GetApplicationType() const { return application_type_; } + void RegisterURLSchemesAsCORSEnabled(const Eina_List* schemes_list); #endif void EnableAppControl(bool enabled); diff --git a/tizen_src/ewk/efl_integration/private/ewk_context_private.cc b/tizen_src/ewk/efl_integration/private/ewk_context_private.cc index 1215b15..cd5a2e9 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.cc @@ -339,6 +339,11 @@ void Ewk_Context::SetApplicationType( Ewk_Application_Type Ewk_Context::GetApplicationType() const { return impl->GetApplicationType(); } + +void Ewk_Context::RegisterURLSchemesAsCORSEnabled( + const Eina_List* schemes_list) { + impl->RegisterURLSchemesAsCORSEnabled(schemes_list); +} #endif void Ewk_Context::SetMaxRefreshRate(int max_refresh_rate) { diff --git a/tizen_src/ewk/efl_integration/private/ewk_context_private.h b/tizen_src/ewk/efl_integration/private/ewk_context_private.h index 294f21e..1748281 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.h @@ -158,6 +158,9 @@ struct Ewk_Context : public base::RefCounted { // Application Type void SetApplicationType(const Ewk_Application_Type application_type); Ewk_Application_Type GetApplicationType() const; + + // Registers url scheme as CORS enabled for HBBTV + void RegisterURLSchemesAsCORSEnabled(const Eina_List* schemes_list); #endif void EnableAppControl(bool enabled); diff --git a/tizen_src/ewk/efl_integration/public/ewk_context.cc b/tizen_src/ewk/efl_integration/public/ewk_context.cc index 438dc40..64da8fa 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_context.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_context.cc @@ -859,7 +859,13 @@ Eina_Bool ewk_context_check_accessible_path_callback_set(Ewk_Context* context, E void ewk_context_register_url_schemes_as_cors_enabled(Ewk_Context* context, const Eina_List* schemes) { - LOG_EWK_API_MOCKUP(); +#if BUILDFLAG(IS_TIZEN_TV) + EINA_SAFETY_ON_NULL_RETURN(context); + EINA_SAFETY_ON_NULL_RETURN(schemes); + context->RegisterURLSchemesAsCORSEnabled(schemes); +#else + LOG_EWK_API_MOCKUP("Only for Tizen TV"); +#endif } void ewk_context_register_jsplugin_mime_types(Ewk_Context* context, const Eina_List* mime_types) diff --git a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc index 2e0016e..3c0120d 100644 --- a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc @@ -102,6 +102,10 @@ void ContentRendererClientEfl::RenderThreadStarted() { if (command_line.HasSwitch(switches::kInjectedBundlePath)) { V8Widget::Type type = V8Widget::Type::WRT; +#if BUILDFLAG(IS_TIZEN_TV) + if (content::IsHbbTV()) + type = V8Widget::Type::HBBTV; +#endif widget_.reset(V8Widget::CreateWidget(type, command_line)); if (widget_->GetObserver()) thread->AddObserver(widget_->GetObserver()); diff --git a/tizen_src/ewk/efl_integration/wrt/dynamicplugin.cc b/tizen_src/ewk/efl_integration/wrt/dynamicplugin.cc index 4520178..5900e9d 100644 --- a/tizen_src/ewk/efl_integration/wrt/dynamicplugin.cc +++ b/tizen_src/ewk/efl_integration/wrt/dynamicplugin.cc @@ -9,6 +9,9 @@ #include "base/logging.h" #include "common/content_switches_efl.h" #include "wrt/wrt_dynamicplugin.h" +#if BUILDFLAG(IS_TIZEN_TV) +#include "wrt/hbbtv_dynamicplugin.h" +#endif namespace { const char* const kStartSessionFunction = "DynamicPluginStartSession"; @@ -113,5 +116,10 @@ DynamicPlugin::~DynamicPlugin() { } DynamicPlugin& DynamicPlugin::Get(V8Widget::Type type) { +#if BUILDFLAG(IS_TIZEN_TV) + if (type == V8Widget::Type::HBBTV) + return HbbtvDynamicPlugin::Get(); +#endif + DCHECK_EQ(type, V8Widget::Type::WRT); return WrtDynamicPlugin::Get(); } diff --git a/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h b/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h index c822bd9..29d4835 100644 --- a/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h +++ b/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h @@ -24,7 +24,7 @@ class DynamicPlugin { virtual bool InitRenderer(const std::string& injected_bundle_path); // Interface for WebApp URL Conversion - virtual void SetWidgetInfo(const std::string& tizen_app_id) = 0; + virtual void SetWidgetInfo(const std::string& tizen_app_id) {}; virtual bool CanHandleParseUrl(const std::string& scheme) const = 0; virtual void ParseURL(std::string* old_url, std::string* new_url, diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.cc b/tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.cc new file mode 100644 index 0000000..6ddfb90 --- /dev/null +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.cc @@ -0,0 +1,44 @@ +// Copyright 2023 Samsung Electronics. All rights resemicPlugin::ParseURL +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "wrt/hbbtv_dynamicplugin.h" + +namespace { +const char* const kHbbtvUrlParsingFunction = "DynamicHbbTVUrlParsing"; +const char* const kHbbtvGetFileDecryptedDataBuffer = + "DynamicHbbTVGetFileDecryptedDataBuffer"; +} // namespace + +HbbtvDynamicPlugin::HbbtvDynamicPlugin() + : DynamicPlugin(), + parse_hbbtv_url_(nullptr), + get_file_decrypted_data_buffer_(nullptr) {} + +bool HbbtvDynamicPlugin::Init(const std::string& injected_bundle_path) { + if (!DynamicPlugin::Init(injected_bundle_path)) + return false; + parse_hbbtv_url_ = + reinterpret_cast(GetFunction(kHbbtvUrlParsingFunction)); + get_file_decrypted_data_buffer_ = + reinterpret_cast( + GetFunction(kHbbtvGetFileDecryptedDataBuffer)); + return parse_hbbtv_url_ && get_file_decrypted_data_buffer_; +} + +void HbbtvDynamicPlugin::ParseURL(std::string* old_url, + std::string* new_url, + const char* tizen_app_id, + bool* is_decrypted_file) { + if (!parse_hbbtv_url_) + return; + + parse_hbbtv_url_(old_url, new_url, tizen_app_id, is_decrypted_file); +} + +HbbtvDynamicPlugin::~HbbtvDynamicPlugin() {} + +HbbtvDynamicPlugin& HbbtvDynamicPlugin::Get() { + static HbbtvDynamicPlugin dynamic_plugin; + return dynamic_plugin; +} diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.h b/tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.h new file mode 100644 index 0000000..ba69e20 --- /dev/null +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_dynamicplugin.h @@ -0,0 +1,43 @@ +// Copyright 2023 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EWK_EFL_INTEGRATION_WRT_HBBTV_DYNAMICPLUGIN_H_ +#define EWK_EFL_INTEGRATION_WRT_HBBTV_DYNAMICPLUGIN_H_ + +#include +#include +#include "wrt/dynamicplugin.h" + +typedef void (*HbbtvParseUrlFun)(std::string* old_url, + std::string* new_url, + const char* tizen_app_id, + bool* is_decrypted_file); +typedef bool (*HbbtvGetFileDecryptedDataBufferFun)(const std::string* url, + std::vector* data); + +class HbbtvDynamicPlugin : public DynamicPlugin { + public: + bool Init(const std::string& injected_bundle_path) override; + bool CanHandleParseUrl(const std::string& scheme) const override { + return true; + } + void ParseURL(std::string* old_url, + std::string* new_url, + const char* tizen_app_id, + bool* is_decrypted_file = nullptr) override; + + static HbbtvDynamicPlugin& Get(); + ~HbbtvDynamicPlugin() override; + + private: + HbbtvDynamicPlugin(); + + HbbtvDynamicPlugin(const HbbtvDynamicPlugin&) = delete; + HbbtvDynamicPlugin& operator=(const HbbtvDynamicPlugin&) = delete; + + HbbtvParseUrlFun parse_hbbtv_url_; + HbbtvGetFileDecryptedDataBufferFun get_file_decrypted_data_buffer_; +}; + +#endif // EWK_EFL_INTEGRATION_WRT_WRT_DYNAMICPLUGIN_H_ diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc new file mode 100644 index 0000000..93f5a49 --- /dev/null +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc @@ -0,0 +1,75 @@ +// Copyright 2023 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "hbbtv_widget.h" + +#include "command_line_efl.h" +#include "common/content_switches_efl.h" +#include "common/render_messages_ewk.h" +#include "content/public/renderer/render_thread.h" +#include "content/renderer/render_thread_impl.h" +#include "third_party/blink/public/web/web_security_policy.h" +#include "wrt/hbbtv_dynamicplugin.h" + +class HbbtvRenderThreadObserver : public content::RenderThreadObserver { + public: + explicit HbbtvRenderThreadObserver(HbbtvWidget* hbbtv_widget) + : hbbtv_widget_(hbbtv_widget) {} + + bool OnControlMessageReceived(const IPC::Message& message) override { + bool handled = true; + IPC_BEGIN_MESSAGE_MAP(HbbtvRenderThreadObserver, message) + IPC_MESSAGE_FORWARD(HbbtvMsg_RegisterURLSchemesAsCORSEnabled, hbbtv_widget_, + HbbtvWidget::RegisterURLSchemesAsCORSEnabled) + IPC_MESSAGE_UNHANDLED(handled = false) + IPC_END_MESSAGE_MAP() + return handled; + } + + private: + HbbtvWidget* hbbtv_widget_; +}; + +HbbtvWidget::HbbtvWidget(const base::CommandLine& command_line) + : V8Widget(V8Widget::Type::HBBTV) { + DCHECK(content::RenderThread::Get()) + << "HbbtvWidget must be constructed on the render thread"; + + id_ = command_line.GetSwitchValueASCII(switches::kTizenAppId); + if (id_.empty()) + return; + observer_.reset(new HbbtvRenderThreadObserver(this)); + + std::string injected_bundle_path = + command_line.GetSwitchValueASCII(switches::kInjectedBundlePath); + CHECK(!injected_bundle_path.empty()); + HbbtvDynamicPlugin::Get().InitRenderer(injected_bundle_path); + SetPlugin(&HbbtvDynamicPlugin::Get()); + + if (command_line.HasSwitch(switches::kCORSEnabledURLSchemes)) { + std::string cors_enabled_url_schemes = + command_line.GetSwitchValueASCII(switches::kCORSEnabledURLSchemes); + RegisterURLSchemesAsCORSEnabled(cors_enabled_url_schemes); + } +} + +HbbtvWidget::~HbbtvWidget() {} + +content::RenderThreadObserver* HbbtvWidget::GetObserver() { + return observer_.get(); +} + +void HbbtvWidget::RegisterURLSchemesAsCORSEnabled(std::string schemes) { + LOG(INFO) << "schemes = " << schemes; + if (schemes_ == schemes) + return; + + schemes_ = schemes; + std::stringstream stream(schemes); + std::string scheme; + while (std::getline(stream, scheme, ',')) { + blink::WebSecurityPolicy::RegisterURLSchemeAsCORSEnabled( + blink::WebString::FromUTF8(scheme)); + } +} diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h new file mode 100644 index 0000000..9329bcf --- /dev/null +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h @@ -0,0 +1,30 @@ +// Copyright 2023 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EWK_EFL_INTEGRATION_WRT_HBBTV_WIDGET_H_ +#define EWK_EFL_INTEGRATION_WRT_HBBTV_WIDGET_H_ + +#include + +#include "content/public/renderer/render_thread_observer.h" +#include "url/gurl.h" +#include "wrt/v8widget.h" + +class HbbtvRenderThreadObserver; + +// Have to be created on the RenderThread. +class HbbtvWidget : public V8Widget { + public: + HbbtvWidget(const base::CommandLine& command_line); + ~HbbtvWidget() override; + + content::RenderThreadObserver* GetObserver() override; + void RegisterURLSchemesAsCORSEnabled(std::string scheme); + + private: + std::string schemes_; + std::unique_ptr observer_; +}; + +#endif // EWK_EFL_INTEGRATION_WRT_HBBTV_WIDGET_H_ diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc new file mode 100644 index 0000000..1505311 --- /dev/null +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc @@ -0,0 +1,55 @@ +// Copyright 2023 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "hbbtv_widget_host.h" + +#include "base/lazy_instance.h" +#include "common/render_messages_ewk.h" +#include "content/public/browser/render_process_host.h" + +using content::RenderProcessHost; + +HbbtvWidgetHost::HbbtvWidgetHost() {} + +HbbtvWidgetHost::~HbbtvWidgetHost() {} + +class HbbtvWidgetHostGetter { + public: + HbbtvWidgetHost& Host() { return host_; } + + private: + HbbtvWidgetHost host_; +}; + +void SendToAllRenderers(IPC::Message* message) { + content::RenderProcessHost::iterator it = + content::RenderProcessHost::AllHostsIterator(); + while (!it.IsAtEnd()) { + it.GetCurrentValue()->Send(new IPC::Message(*message)); + it.Advance(); + } + delete message; +} + +base::LazyInstance::Leaky g_hbbtv_widget_host_getter = + LAZY_INSTANCE_INITIALIZER; + +HbbtvWidgetHost& HbbtvWidgetHost::Get() { + return g_hbbtv_widget_host_getter.Get().Host(); +} + +void HbbtvWidgetHost::RegisterURLSchemesAsCORSEnabled( + const std::string& schemes) { + if (cors_enabled_url_schemes_ == schemes) + return; + + cors_enabled_url_schemes_ = schemes; + LOG(INFO) << "schemes = " << schemes; + SendToAllRenderers( + new HbbtvMsg_RegisterURLSchemesAsCORSEnabled(cors_enabled_url_schemes_)); +} + +const std::string& HbbtvWidgetHost::GetCORSEnabledURLSchemes() { + return cors_enabled_url_schemes_; +} diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h new file mode 100644 index 0000000..096c385 --- /dev/null +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h @@ -0,0 +1,27 @@ +// Copyright 2023 Samsung Electronics. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EWK_EFL_INTEGRATION_WRT_HBBTV_WIDGET_HOST +#define EWK_EFL_INTEGRATION_WRT_HBBTV_WIDGET_HOST + +#include + +class HbbtvWidgetHostGetter; + +class HbbtvWidgetHost { + public: + static HbbtvWidgetHost& Get(); + ~HbbtvWidgetHost(); + + void RegisterURLSchemesAsCORSEnabled(const std::string& schemes); + const std::string& GetCORSEnabledURLSchemes(); + + private: + HbbtvWidgetHost(); + + std::string cors_enabled_url_schemes_; + friend class HbbtvWidgetHostGetter; +}; + +#endif // EWK_EFL_INTEGRATION_WRT_HBBTV_WIDGET_HOST diff --git a/tizen_src/ewk/efl_integration/wrt/v8widget.cc b/tizen_src/ewk/efl_integration/wrt/v8widget.cc index e2b99b5..80b92ea 100644 --- a/tizen_src/ewk/efl_integration/wrt/v8widget.cc +++ b/tizen_src/ewk/efl_integration/wrt/v8widget.cc @@ -7,10 +7,17 @@ #include "base/notreached.h" #include "wrt/dynamicplugin.h" #include "wrt/wrtwidget.h" +#if BUILDFLAG(IS_TIZEN_TV) +#include "wrt/hbbtv_widget.h" +#endif // static V8Widget* V8Widget::CreateWidget(Type type, const base::CommandLine& command_line) { +#if BUILDFLAG(IS_TIZEN_TV) + if (type == Type::HBBTV) + return new HbbtvWidget(command_line); +#endif return new WrtWidget(command_line); } diff --git a/tizen_src/ewk/efl_integration/wrt/wrt_widget_host.cc b/tizen_src/ewk/efl_integration/wrt/wrt_widget_host.cc index 53a4e2d..1513e10 100644 --- a/tizen_src/ewk/efl_integration/wrt/wrt_widget_host.cc +++ b/tizen_src/ewk/efl_integration/wrt/wrt_widget_host.cc @@ -25,10 +25,11 @@ bool SendToAllRenderers(IPC::Message* message) { content::RenderProcessHost::iterator it = content::RenderProcessHost::AllHostsIterator(); while (!it.IsAtEnd()) { - if (it.GetCurrentValue()->Send(message)) + if (it.GetCurrentValue()->Send(new IPC::Message(*message))) result = true; it.Advance(); } + delete message; return result; } -- 2.7.4 From bf6d87c169308515ade6dbea793167ead957a7ae Mon Sep 17 00:00:00 2001 From: Chandan Padhi Date: Wed, 22 Feb 2023 21:19:24 +0530 Subject: [PATCH 08/16] fixup! [M108 Migration][API] Bring up autofill This commit fixes webview crash at launch when autofill is enabled. Reverts commit fe2ff5b. Change-Id: I187180dd09bd1595e94a0b33d02fdf3299182938 Signed-off-by: Chandan Padhi --- .../browser/content_autofill_driver_factory.cc | 7 +++- tizen_src/build/config/tizen_features.gni | 6 ++++ .../browser/autofill/autofill_client_efl.cc | 17 +++++++++ .../browser/autofill/autofill_client_efl.h | 40 ++++++++++++++-------- .../password_manager/password_manager_client_efl.h | 12 ++++--- .../ewk/efl_integration/browser_context_efl.cc | 3 ++ 6 files changed, 66 insertions(+), 19 deletions(-) diff --git a/components/autofill/content/browser/content_autofill_driver_factory.cc b/components/autofill/content/browser/content_autofill_driver_factory.cc index 0b05eb3..528e832 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory.cc +++ b/components/autofill/content/browser/content_autofill_driver_factory.cc @@ -44,7 +44,12 @@ void BrowserDriverInitHook(AutofillClient* client, ContentAutofillDriver* driver) { driver->set_autofill_manager(std::make_unique( driver, client, app_locale, - AutofillManager::EnableDownloadManager(true))); +#if defined(TIZEN_AUTOFILL_SUPPORT) + AutofillManager::EnableDownloadManager(false) +#else + AutofillManager::EnableDownloadManager(true) +#endif + )); if (client && ShouldEnableHeavyFormDataScraping(client->GetChannel())) driver->GetAutofillAgent()->EnableHeavyFormDataScraping(); } diff --git a/tizen_src/build/config/tizen_features.gni b/tizen_src/build/config/tizen_features.gni index 8d2dd87..d2ce969 100644 --- a/tizen_src/build/config/tizen_features.gni +++ b/tizen_src/build/config/tizen_features.gni @@ -61,6 +61,12 @@ declare_args() { tizen_autofill_support = false } +if (tizen_product_tv) { + tizen_autofill_support = false +} else { + tizen_autofill_support = true +} + if (use_ttrace) { use_ttrace_chrome_trace = true } diff --git a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc index 5252edf..8b671fe 100644 --- a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.cc @@ -453,6 +453,23 @@ void AutofillClientEfl::LoadRiskData( NOTIMPLEMENTED(); } +url::Origin AutofillClientEfl::GetLastCommittedPrimaryMainFrameOrigin() const { + NOTREACHED(); + return url::Origin(); +} + +void AutofillClientEfl::HideFastCheckout() { + NOTIMPLEMENTED(); +} + +void AutofillClientEfl::OpenPromoCodeOfferDetailsURL(const GURL& url) { + NOTIMPLEMENTED(); +} + +void AutofillClientEfl::HideTouchToFillCreditCard() { + NOTIMPLEMENTED(); +} + WEB_CONTENTS_USER_DATA_KEY_IMPL(AutofillClientEfl); } // namespace autofill diff --git a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h index fc70981..b0b3894 100644 --- a/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h +++ b/tizen_src/ewk/efl_integration/browser/autofill/autofill_client_efl.h @@ -117,22 +117,34 @@ class AutofillClientEfl AutofillClient::SaveAddressProfilePromptOptions options, AddressProfileSavePromptCallback callback) override; payments::PaymentsClient* GetPaymentsClient() override; - url::Origin GetLastCommittedPrimaryMainFrameOrigin() const {}; - bool IsFastCheckoutSupported() {} + url::Origin GetLastCommittedPrimaryMainFrameOrigin() const override; + bool IsFastCheckoutSupported() override { return false; } bool IsFastCheckoutTriggerForm(const FormData& form, - const FormFieldData& field) {} + const FormFieldData& field) override { + return false; + } bool FastCheckoutScriptSupportsConsentlessExecution( - const url::Origin& origin) {} - bool FastCheckoutClientSupportsConsentlessExecution() {} - bool ShowFastCheckout(base::WeakPtr delegate) {} - - bool IsTouchToFillCreditCardSupported() {} - void HideFastCheckout() {} - bool ShowTouchToFillCreditCard(base::WeakPtr delegate) {} - void OpenPromoCodeOfferDetailsURL(const GURL& url) {} - - bool IsPasswordManagerEnabled() {} - void HideTouchToFillCreditCard() {} + const url::Origin& origin) override { + return false; + } + bool FastCheckoutClientSupportsConsentlessExecution() override { + return false; + } + bool ShowFastCheckout(base::WeakPtr delegate) override { + return false; + } + + bool IsTouchToFillCreditCardSupported() override { return false; } + bool ShowTouchToFillCreditCard( + base::WeakPtr delegate) override { + return false; + } + bool IsPasswordManagerEnabled() override { return false; } + + void HideFastCheckout() override; + void HideTouchToFillCreditCard() override; + + void OpenPromoCodeOfferDetailsURL(const GURL& url) override; // content::WebContentsObserver implementation. void PrimaryMainFrameWasResized(bool width_changed) override; diff --git a/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h b/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h index 1690168..c60d1c5 100644 --- a/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h +++ b/tizen_src/ewk/efl_integration/browser/password_manager/password_manager_client_efl.h @@ -108,10 +108,14 @@ class PasswordManagerClientEfl const override { return &password_feature_manager_; } - PrefService* GetLocalStatePrefs() const {} - const syncer::SyncService* GetSyncService() const {} - PasswordScriptsFetcher* GetPasswordScriptsFetcher() {} - PasswordChangeSuccessTracker* GetPasswordChangeSuccessTracker() {} + PrefService* GetLocalStatePrefs() const override { return nullptr; } + const syncer::SyncService* GetSyncService() const override { return nullptr; } + PasswordScriptsFetcher* GetPasswordScriptsFetcher() override { + return nullptr; + } + PasswordChangeSuccessTracker* GetPasswordChangeSuccessTracker() override { + return nullptr; + } private: explicit PasswordManagerClientEfl(content::WebContents* web_contents, diff --git a/tizen_src/ewk/efl_integration/browser_context_efl.cc b/tizen_src/ewk/efl_integration/browser_context_efl.cc index 04b4762..10f6c53 100644 --- a/tizen_src/ewk/efl_integration/browser_context_efl.cc +++ b/tizen_src/ewk/efl_integration/browser_context_efl.cc @@ -161,6 +161,9 @@ BrowserContextEfl::BrowserContextEfl(EWebContext* web_context, bool incognito) pref_registry->RegisterBooleanPref(kAutofillProfileEnabled, true); pref_registry->RegisterBooleanPref(kAutofillWalletImportEnabled, true); pref_registry->RegisterBooleanPref(kAutofillCreditCardEnabled, true); + pref_registry->RegisterIntegerPref(kAutocompleteLastVersionRetentionPolicy, + 0); + pref_registry->RegisterIntegerPref(kAutofillLastVersionDeduped, 0); // password manager preferences pref_registry->RegisterBooleanPref(kCredentialsEnableService, true); -- 2.7.4 From 6ec0539eef5c881d299988f812069beff175f4a8 Mon Sep 17 00:00:00 2001 From: Gajendra N Date: Tue, 28 Feb 2023 15:19:32 +0530 Subject: [PATCH 09/16] fixup! Enable content shell with aura for desktop This patch reverts a change related to ThreadLocalStorage 'tls_model' done in patch [1], as the change was causing error [2] when our chromium-efl library is being loaded with dlopen from another library. As per the comment description mentioned in file third_party/blink/renderer/platform/heap/thread_local.h, it is suggested to use "local-exec" type for Linux platform, hence reverting back to original type, which avoids the error [2]. [1] https://review.tizen.org/gerrit/284216 [2] "cannot allocate memory in static tls block" Change-Id: I683859fff133217eec91e285a09d9430e6c4d4e7 Signed-off-by: Gajendra N --- third_party/blink/renderer/platform/heap/thread_local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/blink/renderer/platform/heap/thread_local.h b/third_party/blink/renderer/platform/heap/thread_local.h index 57455c5..6993877 100644 --- a/third_party/blink/renderer/platform/heap/thread_local.h +++ b/third_party/blink/renderer/platform/heap/thread_local.h @@ -36,7 +36,7 @@ #if BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY #define BLINK_HEAP_THREAD_LOCAL_MODEL "local-dynamic" #else -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_EFL) +#if BUILDFLAG(IS_WIN) #define BLINK_HEAP_THREAD_LOCAL_MODEL "initial-exec" #elif BUILDFLAG(IS_ANDROID) #define BLINK_HEAP_THREAD_LOCAL_MODEL "local-dynamic" -- 2.7.4 From b381a9861c923c8b85885d1f69d6b6309337fcb4 Mon Sep 17 00:00:00 2001 From: Surya Kumar Date: Tue, 28 Feb 2023 16:39:39 +0530 Subject: [PATCH 10/16] [WRTJS] Fix a gcc build error caused by function/class ambiguity 1. Existing function name had the same signature as a class's constructor leading to gcc causing build break. Made changes to resolve the confusion. 2. Added a missing function definition that otherwise made a class incomplete. Reference: https://github.com/electron/electron/pull/36096/commits/e50ab4a4db4042cbc007cd8d832f61b9c8bc0449 Change-Id: I3e6c27b8bbb450ab3ac908b9c985153e73526ff0 Signed-off-by: Surya Kumar --- electron/shell/browser/javascript_environment.cc | 2 +- gin/public/v8_platform.h | 2 +- gin/v8_platform.cc | 2 +- wrt/src/browser/wrt_render_message_filter.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/electron/shell/browser/javascript_environment.cc b/electron/shell/browser/javascript_environment.cc index cddfcd9..7e1e248 100644 --- a/electron/shell/browser/javascript_environment.cc +++ b/electron/shell/browser/javascript_environment.cc @@ -305,7 +305,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) { if (cmd->GetProgram() == base::FilePath("wrt-service")) { platform_ = node::CreatePlatform( base::RecommendedMaxNumberOfThreadsInThreadGroup(3, 8, 0.1, 0), - tracing_controller, gin::V8Platform::PageAllocator()); + tracing_controller, gin::V8Platform::GetCurrentPageAllocator()); v8::V8::InitializePlatform(platform_); if (wrt::WRTService::IsGlobalService()) { diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h index 23a9d7f..feffa5a 100644 --- a/gin/public/v8_platform.h +++ b/gin/public/v8_platform.h @@ -31,7 +31,7 @@ class GIN_EXPORT V8Platform : public v8::Platform { // verified in the tests for gin::PageAllocator. PageAllocator* GetPageAllocator() override; #if defined(ENABLE_WRT_JS) - static v8::PageAllocator* PageAllocator(); + static v8::PageAllocator* GetCurrentPageAllocator(); #endif void OnCriticalMemoryPressure() override; v8::ZoneBackingAllocator* GetZoneBackingAllocator() override; diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc index 3bc39121..f8f2b5f 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc @@ -374,7 +374,7 @@ PageAllocator* V8Platform::GetPageAllocator() { } #if defined(ENABLE_WRT_JS) -v8::PageAllocator* V8Platform::PageAllocator() { +v8::PageAllocator* V8Platform::GetCurrentPageAllocator() { return g_page_allocator.Pointer(); } #endif diff --git a/wrt/src/browser/wrt_render_message_filter.h b/wrt/src/browser/wrt_render_message_filter.h index d74d96f..ef3b992 100755 --- a/wrt/src/browser/wrt_render_message_filter.h +++ b/wrt/src/browser/wrt_render_message_filter.h @@ -13,7 +13,7 @@ class BrowserMessageFilterCommon : public content::BrowserMessageFilter { public: bool OnMessageReceived(const IPC::Message& message) override { return false; } virtual void OnDecideNavigationPolicy(const NavigationPolicyParams&, - bool* handled); + bool* handled) {} }; } #else -- 2.7.4 From a8d93c60e97f13b9450a806b05f36c597414121b Mon Sep 17 00:00:00 2001 From: jiangyuwei Date: Tue, 28 Feb 2023 11:14:01 +0800 Subject: [PATCH 11/16] [M108 Migration] Add an ewk api logs for debugging Important and frequently used ewk api logs are lacking, add logs for debugging. Reference: https://review.tizen.org/gerrit/#/c/283987/ Change-Id: I661b4cf68f037a96b5b60cf2e72567815f100ea4 Signed-off-by: jiangyuwei --- .../ewk/efl_integration/public/ewk_context.cc | 18 ++++++++- tizen_src/ewk/efl_integration/public/ewk_view.cc | 45 ++++++++++++++++++++-- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/tizen_src/ewk/efl_integration/public/ewk_context.cc b/tizen_src/ewk/efl_integration/public/ewk_context.cc index 64da8fa..2eee282 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_context.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_context.cc @@ -101,6 +101,7 @@ Ewk_Context* ewk_context_new() Ewk_Context *ewk_context_new_with_injected_bundle_path(const char *path) { EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); + LOG(INFO) << "path: " << path; // To create new Ewk_Context with default incognito = false. return Ewk_Context::Create(false,std::string(path)); } @@ -202,6 +203,7 @@ Evas_Object* ewk_context_icon_database_icon_object_add(Ewk_Context* context, con Eina_Bool ewk_context_local_file_system_all_delete(Ewk_Context *context) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context; context->FileSystemDelete(GURL("")); return true; } @@ -210,6 +212,7 @@ Eina_Bool ewk_context_local_file_system_delete(Ewk_Context *context, Ewk_Securit { EINA_SAFETY_ON_NULL_RETURN_VAL(origin, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context; std::ostringstream ss; ss << ewk_security_origin_protocol_get(origin) << "://" << ewk_security_origin_host_get(origin); @@ -229,6 +232,7 @@ Eina_Bool ewk_context_local_file_system_origins_get(const Ewk_Context *context, Eina_Bool ewk_context_web_database_delete_all(Ewk_Context* context) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context; context->WebDBDelete(GURL()); return true; } @@ -237,6 +241,7 @@ Eina_Bool ewk_context_web_database_delete(Ewk_Context* context, Ewk_Security_Ori { EINA_SAFETY_ON_NULL_RETURN_VAL(origin, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context; std::ostringstream ss; ss << ewk_security_origin_protocol_get(origin) << "://" << ewk_security_origin_host_get(origin); @@ -269,6 +274,7 @@ Eina_Bool ewk_context_web_database_quota_for_origin_set(Ewk_Context* context, Ew Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* context) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context; context->IndexedDBDelete(); return true; } @@ -276,6 +282,7 @@ Eina_Bool ewk_context_web_indexed_database_delete_all(Ewk_Context* context) Eina_Bool ewk_context_web_storage_delete_all(Ewk_Context* context) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context; context->WebStorageDelete(); return true; } @@ -284,7 +291,7 @@ Eina_Bool ewk_context_web_storage_origin_delete(Ewk_Context* context, Ewk_Securi { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(origin, EINA_FALSE); - + LOG(INFO) << "context: " << context; context->WebStorageDelete(origin->GetURL()); return EINA_TRUE; } @@ -338,6 +345,7 @@ Ewk_Cache_Model ewk_context_cache_model_get(const Ewk_Context* context) Eina_Bool ewk_context_cache_disabled_set(Ewk_Context* context, Eina_Bool cacheDisabled) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context << ", cacheDisabled:" << (bool)cacheDisabled; context->SetNetworkCacheEnable(!cacheDisabled); return true; } @@ -352,6 +360,7 @@ Eina_Bool ewk_context_certificate_file_set(Ewk_Context* context, const char* certificate_path) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(certificate_path, EINA_FALSE); + LOG(INFO) << "context: " << context << ", certificate_path:" << certificate_path; context->SetCertificatePath(certificate_path); return true; } @@ -365,6 +374,7 @@ const char* ewk_context_certificate_file_get(const Ewk_Context* context) Eina_Bool ewk_context_cache_clear(Ewk_Context* context) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, EINA_FALSE); + LOG(INFO) << "context: " << context; context->ClearNetworkCache(); context->ClearWebkitCache(); return EINA_TRUE; @@ -582,6 +592,7 @@ int ewk_context_pixmap_get(Ewk_Context *context) unsigned int ewk_context_inspector_server_start(Ewk_Context* ewkContext, unsigned int port) { EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0); + LOG(INFO) << "context: " << ewkContext; return ewkContext->InspectorServerStart(port); } @@ -607,7 +618,7 @@ void ewk_context_tizen_app_id_set(Ewk_Context* context, const char* tizen_app_id) { EINA_SAFETY_ON_NULL_RETURN(context); EINA_SAFETY_ON_NULL_RETURN(tizen_app_id); - LOG(INFO) << "tizen_app_id:" << tizen_app_id; + LOG(INFO) << "context: " << context << ", tizen_app_id:" << tizen_app_id; context->SetTizenAppId(tizen_app_id); } @@ -634,6 +645,7 @@ Ewk_Favicon_Database* ewk_context_favicon_database_get(const Ewk_Context* ewkCon void ewk_context_resource_cache_clear(Ewk_Context* ewkContext) { EINA_SAFETY_ON_NULL_RETURN(ewkContext); + LOG(INFO) << "context: " << ewkContext; ewkContext->ClearNetworkCache(); ewkContext->ClearWebkitCache(); } @@ -707,6 +719,7 @@ void ewk_context_intercept_request_callback_set( Ewk_Context_Intercept_Request_Callback callback, void* user_data) { EINA_SAFETY_ON_NULL_RETURN(context); + LOG(INFO) << "context: " << context; context->SetContextInterceptRequestCallback(callback, user_data); } @@ -1067,6 +1080,7 @@ void ewk_context_timezone_offset_set(Ewk_Context* context, void ewk_context_default_zoom_factor_set(Ewk_Context* context, double zoom_factor) { EINA_SAFETY_ON_NULL_RETURN(context); + LOG(INFO) << "context: " << context << ", zoom_factor:" << zoom_factor; context->SetDefaultZoomFactor(zoom_factor); } diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index 84d42d0..58518f7 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -100,7 +100,7 @@ Evas_Object* ewk_view_add_with_context(Evas* e, Ewk_Context* context) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0); Evas_Object* ewk_view = CreateWebViewAsEvasObject(context, e); - + LOG(INFO) << "evas: " << e << ", context: " << context << ", ewk_view:" << ewk_view; if (ewk_view) { #if !BUILDFLAG(IS_TIZEN_TV) ewk_view_user_media_permission_callback_set(ewk_view, @@ -125,6 +125,7 @@ Evas_Object* ewk_view_add(Evas* e) // default web context. It won't be released by destroyed eweb_view because // ewk_context_default_get does AddRef Ewk_Context* context = ewk_context_default_get(); + LOG(INFO) << "evas: " << e << ", context: " << context; return ewk_view_add_with_context(e, context); } @@ -132,6 +133,7 @@ Evas_Object* ewk_view_add_in_incognito_mode(Evas* e) { EINA_SAFETY_ON_NULL_RETURN_VAL(e, nullptr); Ewk_Context* context = Ewk_Context::IncognitoContext(); + LOG(INFO) << "evas: " << e << ", context: " << context; EINA_SAFETY_ON_NULL_RETURN_VAL(context, nullptr); return ewk_view_add_with_context(e, context); } @@ -145,6 +147,7 @@ Ewk_Context *ewk_view_context_get(const Evas_Object *view) Eina_Bool ewk_view_url_set(Evas_Object* view, const char* url_string) { TTRACE_WEB("ewk_view_url_set url: %s", url_string); + LOG(INFO) << "view: " << view << ", url: " << url_string; EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false); EINA_SAFETY_ON_NULL_RETURN_VAL(url_string, false); GURL url(url_string); @@ -167,6 +170,7 @@ const char* ewk_view_original_url_get(const Evas_Object* view) Eina_Bool ewk_view_reload(Evas_Object *view) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false); + LOG(INFO) << "view: " << view; impl->Reload(); return true; } @@ -210,6 +214,7 @@ Eina_Bool ewk_view_scale_set(Evas_Object* view, double scale_factor, int x, int EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE); impl->SetScale(scale_factor); impl->SetScroll(x, y); + LOG(INFO) << "view: " << view << ", scale_factor: " << scale_factor << ", x:" << x << ", y:" << y; return EINA_TRUE; } @@ -230,12 +235,14 @@ double ewk_view_scale_get(const Evas_Object *view) Eina_Bool ewk_view_back(Evas_Object *view) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false); + LOG(INFO) << "view: " << view; return impl->GoBack(); } Eina_Bool ewk_view_forward(Evas_Object *view) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false); + LOG(INFO) << "view: " << view; return impl->GoForward(); } @@ -261,6 +268,7 @@ Eina_Bool ewk_view_html_string_load(Evas_Object* view, const char* html, const c { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(html, EINA_FALSE); + LOG(INFO) << "view: " << view; impl->LoadHTMLString(html, base_uri, unreachable_uri); return EINA_TRUE; } @@ -321,6 +329,7 @@ void ewk_view_scale_range_get(Evas_Object* view, double* min_scale, double* max_ void ewk_view_suspend(Evas_Object* ewkView) { EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl); + LOG(INFO) << "view: " << ewkView; impl->Suspend(); } @@ -384,7 +393,7 @@ Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* ewkView, Ewk_Page_Visi Eina_Bool ewk_view_user_agent_set(Evas_Object* ewkView, const char* user_agent) { EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false); - + LOG(INFO) << "view: " << ewkView << ", user_agent: " << user_agent; return impl->SetUserAgent(user_agent); } @@ -436,6 +445,7 @@ Eina_Bool ewk_view_custom_header_clear(const Evas_Object* ewkView) Eina_Bool ewk_view_visibility_set(Evas_Object* view, Eina_Bool enable) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE); + LOG(INFO) << "view: " << view << ", enable:" << (bool)enable; return impl->SetVisibility(enable); } @@ -443,6 +453,7 @@ Evas_Object* ewk_view_screenshot_contents_get(const Evas_Object* view, Eina_Rect { EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, NULL); EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, NULL); + LOG(INFO) << "view: " << view; return impl->GetSnapshot(view_area, scale_factor); } @@ -451,6 +462,7 @@ Eina_Bool ewk_view_screenshot_contents_get_async(const Evas_Object* view, Eina_R { EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EINA_FALSE); EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE); + LOG(INFO) << "view: " << view; return impl->GetSnapshotAsync(view_area, callback, user_data, scale_factor) ? EINA_TRUE : EINA_FALSE; @@ -459,12 +471,14 @@ Eina_Bool ewk_view_screenshot_contents_get_async(const Evas_Object* view, Eina_R unsigned int ewk_view_inspector_server_start(Evas_Object* ewkView, unsigned int port) { EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false); + LOG(INFO) << "view: " << ewkView << ", port:" << port; return impl->StartInspectorServer(port); } Eina_Bool ewk_view_inspector_server_stop(Evas_Object* ewkView) { EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false); + LOG(INFO) << "view: " << ewkView; return impl->StopInspectorServer(); } @@ -477,7 +491,7 @@ Eina_Bool ewk_view_cache_image_get(const Evas_Object* o, const char* image_url, void ewk_view_scroll_by(Evas_Object* ewkView, int deltaX, int deltaY) { int x, y; - + LOG(INFO) << "view: " << ewkView << ", deltaX:" << deltaX << ", deltaY:" << deltaY; if (EINA_TRUE == ewk_view_scroll_pos_get(ewkView, &x, &y)) { ewk_view_scroll_set(ewkView, x + deltaX, y + deltaY); } @@ -492,6 +506,7 @@ Eina_Bool ewk_view_scroll_pos_get(Evas_Object* ewkView, int* x, int* y) Eina_Bool ewk_view_scroll_set(Evas_Object* view, int x, int y) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE); + LOG(INFO) << "view: " << view << ", x:" << x << ", y:" << y; impl->SetScroll(x, y); return EINA_TRUE; @@ -526,6 +541,7 @@ void ewk_view_password_confirm_popup_reply(Evas_Object* ewkView, Ewk_Password_Po void ewk_view_javascript_alert_callback_set(Evas_Object* view, Ewk_View_JavaScript_Alert_Callback callback, void* user_data) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl); + LOG(INFO) << "view: " << view; if (callback) impl->SetJavaScriptAlertCallback(callback, user_data); } @@ -533,12 +549,14 @@ void ewk_view_javascript_alert_callback_set(Evas_Object* view, Ewk_View_JavaScri void ewk_view_javascript_alert_reply(Evas_Object* view) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl); + LOG(INFO) << "view: " << view; impl->JavaScriptAlertReply(); } void ewk_view_javascript_confirm_callback_set(Evas_Object* view, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl); + LOG(INFO) << "view: " << view; if (callback) impl->SetJavaScriptConfirmCallback(callback, user_data); } @@ -546,12 +564,14 @@ void ewk_view_javascript_confirm_callback_set(Evas_Object* view, Ewk_View_JavaSc void ewk_view_javascript_confirm_reply(Evas_Object* view, Eina_Bool result) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl); + LOG(INFO) << "view: " << view; impl->JavaScriptConfirmReply(result); } void ewk_view_javascript_prompt_callback_set(Evas_Object* view, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl); + LOG(INFO) << "view: " << view; if (callback) impl->SetJavaScriptPromptCallback(callback, user_data); } @@ -559,6 +579,7 @@ void ewk_view_javascript_prompt_callback_set(Evas_Object* view, Ewk_View_JavaScr void ewk_view_javascript_prompt_reply(Evas_Object* view, const char* result) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl); + LOG(INFO) << "view: " << view; impl->JavaScriptPromptReply(result); } @@ -633,6 +654,7 @@ Eina_Bool ewk_view_script_execute(Evas_Object* ewkView, const char* script, Ewk_ { EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false); EINA_SAFETY_ON_NULL_RETURN_VAL(script, false); + LOG(INFO) << "view: " << ewkView; // callback can be null, so do not test it for null if (0 != strcmp(script, "")) //check for empty string return impl->ExecuteJavaScript(script, callback, user_data); @@ -693,6 +715,7 @@ Eina_Bool ewk_view_popup_menu_multiple_select(Evas_Object* ewkView, Eina_Inarray void ewk_view_orientation_send(Evas_Object* ewkView, int orientation) { EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl); + LOG(INFO) << "view: " << ewkView << ", orientation:" << orientation; impl->SetOrientation(orientation); } @@ -997,6 +1020,7 @@ char* ewk_view_get_cookies_for_url(Evas_Object* view, const char* url) Eina_Bool ewk_view_fullscreen_exit(Evas_Object* view) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE); + LOG(INFO) << "view: " << view; impl->ExitFullscreen(); return EINA_TRUE; } @@ -1115,6 +1139,7 @@ Eina_Bool ewk_view_page_zoom_set(Evas_Object* ewkView, double zoomFactor) Evas_Object* ewk_view_smart_add(Evas* canvas, Evas_Smart* smart, Ewk_Context* context, Ewk_Page_Group* pageGroup) { EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0); + LOG(INFO) << "evas: " << canvas << ", context:" << context; return CreateWebViewAsEvasObject(context, canvas, smart); } @@ -1143,6 +1168,7 @@ void ewk_view_quota_permission_request_cancel(const Ewk_Quota_Permission_Request Eina_Bool ewk_view_focus_set(const Evas_Object* view, Eina_Bool focused) { EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE); + LOG(INFO) << "view: " << view << ", focused:" << (bool)focused; impl->SetFocus(focused); return EINA_TRUE; } @@ -1430,7 +1456,11 @@ Eina_Bool ewk_view_bg_color_get(Evas_Object* view, } void ewk_view_clear_all_tiles_resources(Evas_Object* ewkView) { +#if BUILDFLAG(IS_TIZEN_TV) + LOG(INFO) << "view: " << ewkView; +#else LOG_EWK_API_MOCKUP(); +#endif } Eina_Bool ewk_view_edge_scroll_by(Evas_Object *ewkView, int dx, int dy) @@ -1446,6 +1476,7 @@ Eina_Bool ewk_view_set_support_video_hole(Evas_Object* ewkView, LOG_EWK_API_MOCKUP(); #if defined(TIZEN_VIDEO_HOLE) EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, EINA_FALSE); + LOG(INFO) << "view: " << ewkView << ", enable:" << (bool)enable; impl->SetVideoHoleSupport(enable); media::VideoPlaneController::SetSharedVideoWindowHandle( window, @@ -1583,7 +1614,11 @@ void ewk_view_360video_set_current_time(Evas_Object* ewkView, double current_tim Eina_Bool ewk_view_script_execute_all_frames(Evas_Object *o, const char *script, Ewk_View_Script_Execute_Cb callback, void *user_data) { +#if BUILDFLAG(IS_TIZEN_TV) + LOG(INFO) << ", view: " << o; +#else LOG_EWK_API_MOCKUP(); +#endif return EINA_FALSE; } @@ -1610,7 +1645,11 @@ void ewk_view_voicemanager_labels_clear(Evas_Object* view) { void ewk_view_floating_window_state_changed(const Evas_Object *o, Eina_Bool status) { +#if BUILDFLAG(IS_TIZEN_TV) + EWK_VIEW_IMPL_GET_OR_RETURN(o, impl); +#else LOG_EWK_API_MOCKUP(); +#endif } void ewk_view_feed_mouse_down(Evas_Object* view, -- 2.7.4 From e9fb3449aa2a85dac01e04b078b595c034742937 Mon Sep 17 00:00:00 2001 From: Gajendra N Date: Wed, 1 Mar 2023 10:27:36 +0530 Subject: [PATCH 12/16] fixup! fixup! Enable content shell with aura for desktop The fixup commit 6ec053 caused linker error on desktop build. It seems for deskop version, tls_model type 'initial-exec' is suitable. This patch makes necessary changes to handle both profiles. Change-Id: I2de65051f01a2c9d9444450fa0a5bb301ea85a71 Signed-off-by: Gajendra N --- third_party/blink/renderer/platform/heap/thread_local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/blink/renderer/platform/heap/thread_local.h b/third_party/blink/renderer/platform/heap/thread_local.h index 6993877..0cfab88 100644 --- a/third_party/blink/renderer/platform/heap/thread_local.h +++ b/third_party/blink/renderer/platform/heap/thread_local.h @@ -36,7 +36,7 @@ #if BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY #define BLINK_HEAP_THREAD_LOCAL_MODEL "local-dynamic" #else -#if BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_EFL) && !BUILDFLAG(IS_TIZEN)) #define BLINK_HEAP_THREAD_LOCAL_MODEL "initial-exec" #elif BUILDFLAG(IS_ANDROID) #define BLINK_HEAP_THREAD_LOCAL_MODEL "local-dynamic" -- 2.7.4 From d22929e2d5c1ecb92375d06349bfd2f0058467e9 Mon Sep 17 00:00:00 2001 From: xiaofang Date: Wed, 1 Mar 2023 13:20:13 +0800 Subject: [PATCH 13/16] fixup! [M108 Aura Migration] Add media playback ewk api add ewk_view_stop_video impl Change-Id: Ie02d39d39c43089b9a78c34b2696fde2816b7527 Signed-off-by: xiaofang --- tizen_src/ewk/efl_integration/public/ewk_view.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index 58518f7..71820fe 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -1542,6 +1542,12 @@ Eina_Bool ewk_view_is_video_playing(Evas_Object* o, Ewk_Is_Video_Playing_Callbac return EINA_FALSE; } +Eina_Bool ewk_view_stop_video(Evas_Object* o, Ewk_Stop_Video_Callback callback, void* user_data) +{ + LOG_EWK_API_MOCKUP(); + return EINA_FALSE; +} + Eina_Bool ewk_view_active_drm_set(Evas_Object* view, const char* drm_system_id) { LOG_EWK_API_MOCKUP(); -- 2.7.4 From 6347e67c61fb9e51f69fed3df4106de898ade35f Mon Sep 17 00:00:00 2001 From: Venugopal S M Date: Mon, 27 Feb 2023 18:55:02 +0530 Subject: [PATCH 14/16] fixup! [M108 Migration] Enable video hole feature Call decode unset method in IDLE state. Reference: https://review.tizen.org/gerrit/283277 Change-Id: Ice0d1ad64e65aca47275df01ad550c73748a22c6 Signed-off-by: wuxiaoliang Signed-off-by: Venugopal S M --- .../chromium_impl/media/base/tizen/media_player_bridge_capi.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.cc b/tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.cc index 4e37d58..14136ef 100644 --- a/tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.cc +++ b/tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.cc @@ -272,13 +272,17 @@ void MediaPlayerBridgeCapi::Release() { player_unset_interrupted_cb(player_); player_unset_error_cb(player_); player_unset_buffering_cb(player_); - player_unset_media_packet_video_frame_decoded_cb(player_); if (GetPlayerState() > PLAYER_STATE_READY && player_stop(player_) != PLAYER_ERROR_NONE) { LOG(ERROR) << "|player_stop| failed"; } +#if defined(TIZEN_VIDEO_HOLE) + if (!is_video_hole_) +#endif + player_unset_media_packet_video_frame_decoded_cb(player_); + if (GetPlayerState() > PLAYER_STATE_IDLE && player_unprepare(player_) != PLAYER_ERROR_NONE) LOG(ERROR) << "|player_unprepare| failed"; -- 2.7.4 From 80189791dae677fe1f7232851453ee4515898d0b Mon Sep 17 00:00:00 2001 From: "fr.fang" Date: Tue, 28 Feb 2023 20:20:54 +0800 Subject: [PATCH 15/16] [M108 Migration][HBBTV] Implement ewk_context_register_jsplugin_mime_types API This is required to prevent the renderer from creating frames to handle JS plugins mimetypes, if those mime types are supported by the renderer by default. Reference: https://review.tizen.org/gerrit/#/c/282683 Change-Id: I4ffbcccac84b5dc0ec531fbbcf67de18bef9e569 Signed-off-by: fr.fang --- third_party/blink/common/mime_util/mime_util.cc | 33 ++++++++++++++++++++++ .../blink/public/common/mime_util/mime_util.h | 6 ++++ third_party/blink/public/web/web_security_policy.h | 2 +- .../renderer/core/html/html_object_element.cc | 5 ++++ .../renderer/core/html/html_plugin_element.cc | 4 +++ .../platform/network/mime/mime_type_registry.cc | 6 ++++ .../platform/network/mime/mime_type_registry.h | 5 ++++ .../efl_integration/common/content_switches_efl.cc | 2 ++ .../efl_integration/common/content_switches_efl.h | 2 ++ .../efl_integration/common/render_messages_ewk.h | 3 ++ tizen_src/ewk/efl_integration/eweb_context.cc | 11 ++++++++ tizen_src/ewk/efl_integration/eweb_context.h | 1 + .../efl_integration/private/ewk_context_private.cc | 4 +++ .../efl_integration/private/ewk_context_private.h | 2 ++ .../ewk/efl_integration/public/ewk_context.cc | 8 +++++- .../renderer/content_renderer_client_efl.cc | 32 +++++++++++++++------ tizen_src/ewk/efl_integration/wrt/dynamicplugin.h | 2 +- tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc | 8 ++++++ tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h | 1 + .../ewk/efl_integration/wrt/hbbtv_widget_host.cc | 13 +++++++++ .../ewk/efl_integration/wrt/hbbtv_widget_host.h | 4 +++ 21 files changed, 142 insertions(+), 12 deletions(-) diff --git a/third_party/blink/common/mime_util/mime_util.cc b/third_party/blink/common/mime_util/mime_util.cc index a3a7b9e..cac1bee 100644 --- a/third_party/blink/common/mime_util/mime_util.cc +++ b/third_party/blink/common/mime_util/mime_util.cc @@ -125,6 +125,11 @@ class MimeUtil { bool IsSupportedMimeType(const std::string& mime_type) const; +#if BUILDFLAG(IS_TIZEN_TV) + void RegisterJavascriptPluginMimeTypes(const std::string& mime_type); + bool IsSupportedJavascriptPluginMimeType(const std::string& mime_type) const; +#endif + private: friend struct base::LazyInstanceTraitsBase; @@ -136,6 +141,9 @@ class MimeUtil { MimeTypes non_image_types_; MimeTypes unsupported_text_types_; MimeTypes javascript_types_; +#if BUILDFLAG(IS_TIZEN_TV) + MimeTypes javascript_plugin_types_; +#endif }; MimeUtil::MimeUtil() { @@ -200,6 +208,22 @@ bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { IsSupportedNonImageMimeType(mime_type); } +#if BUILDFLAG(IS_TIZEN_TV) +void MimeUtil::RegisterJavascriptPluginMimeTypes( + const std::string& mime_types) { + std::stringstream stream(mime_types); + std::string mime_type; + while (std::getline(stream, mime_type, ',')) + javascript_plugin_types_.insert(base::ToLowerASCII(mime_type)); +} + +bool MimeUtil::IsSupportedJavascriptPluginMimeType( + const std::string& mime_type) const { + return javascript_plugin_types_.find(base::ToLowerASCII(mime_type)) != + javascript_plugin_types_.end(); +} +#endif + // This variable is Leaky because it is accessed from WorkerPool threads. static base::LazyInstance::Leaky g_mime_util = LAZY_INSTANCE_INITIALIZER; @@ -230,4 +254,13 @@ bool IsSupportedMimeType(const std::string& mime_type) { return g_mime_util.Get().IsSupportedMimeType(mime_type); } +#if BUILDFLAG(IS_TIZEN_TV) +void RegisterJavascriptPluginMimeTypes(const std::string& mime_type) { + g_mime_util.Get().RegisterJavascriptPluginMimeTypes(mime_type); +} + +bool IsSupportedJavascriptPluginMimeType(const std::string& mime_type) { + return g_mime_util.Get().IsSupportedJavascriptPluginMimeType(mime_type); +} +#endif } // namespace blink diff --git a/third_party/blink/public/common/mime_util/mime_util.h b/third_party/blink/public/common/mime_util/mime_util.h index 9675518..037936e 100644 --- a/third_party/blink/public/common/mime_util/mime_util.h +++ b/third_party/blink/public/common/mime_util/mime_util.h @@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_PUBLIC_COMMON_MIME_UTIL_MIME_UTIL_H_ #include +#include "build/build_config.h" #include "third_party/blink/public/common/common_export.h" namespace blink { @@ -23,6 +24,11 @@ bool BLINK_COMMON_EXPORT IsJSONMimeType(const std::string& mime_type); // Convenience function. bool BLINK_COMMON_EXPORT IsSupportedMimeType(const std::string& mime_type); +#if BUILDFLAG(IS_TIZEN_TV) +void BLINK_COMMON_EXPORT RegisterJavascriptPluginMimeTypes(const std::string&); +bool BLINK_COMMON_EXPORT +IsSupportedJavascriptPluginMimeType(const std::string&); +#endif } // namespace blink diff --git a/third_party/blink/public/web/web_security_policy.h b/third_party/blink/public/web/web_security_policy.h index f134b97..e0a7094 100644 --- a/third_party/blink/public/web/web_security_policy.h +++ b/third_party/blink/public/web/web_security_policy.h @@ -132,7 +132,7 @@ class BLINK_EXPORT WebSecurityPolicy { // response time match from the network cache. static void RegisterURLSchemeAsCodeCacheWithHashing(const WebString&); #if BUILDFLAG(IS_TIZEN_TV) - // Registers a non-HTTP URL scheme which can be sent CORS requests. + // Registers a non-HTTP URL scheme which can be sent CORS requests. BLINK_EXPORT static void RegisterURLSchemeAsCORSEnabled(const WebString&); #endif diff --git a/third_party/blink/renderer/core/html/html_object_element.cc b/third_party/blink/renderer/core/html/html_object_element.cc index 98010b5..f3b0121 100644 --- a/third_party/blink/renderer/core/html/html_object_element.cc +++ b/third_party/blink/renderer/core/html/html_object_element.cc @@ -105,7 +105,12 @@ void HTMLObjectElement::ParseAttribute( // specified? ReloadPluginOnAttributeChange(name); } else if (name == html_names::kDataAttr) { +#if BUILDFLAG(IS_TIZEN_TV) + if (!MIMETypeRegistry::IsSupportedJavaScriptPluginMIMEType(service_type_)) + url_ = StripLeadingAndTrailingHTMLSpaces(params.new_value); +#else SetUrl(StripLeadingAndTrailingHTMLSpaces(params.new_value)); +#endif if (GetLayoutObject() && IsImageType()) { SetNeedsPluginUpdate(true); if (!image_loader_) diff --git a/third_party/blink/renderer/core/html/html_plugin_element.cc b/third_party/blink/renderer/core/html/html_plugin_element.cc index e62d977..cbf08b5 100644 --- a/third_party/blink/renderer/core/html/html_plugin_element.cc +++ b/third_party/blink/renderer/core/html/html_plugin_element.cc @@ -534,6 +534,10 @@ bool HTMLPlugInElement::IsFocusableStyle() const { HTMLPlugInElement::ObjectContentType HTMLPlugInElement::GetObjectContentType() const { +#if BUILDFLAG(IS_TIZEN_TV) + if (MIMETypeRegistry::IsSupportedJavaScriptPluginMIMEType(service_type_)) + return ObjectContentType::kNone; +#endif String mime_type = service_type_; KURL url = GetDocument().CompleteURL(url_); if (mime_type.empty()) { diff --git a/third_party/blink/renderer/platform/network/mime/mime_type_registry.cc b/third_party/blink/renderer/platform/network/mime/mime_type_registry.cc index 646a485..19fce52 100644 --- a/third_party/blink/renderer/platform/network/mime/mime_type_registry.cc +++ b/third_party/blink/renderer/platform/network/mime/mime_type_registry.cc @@ -259,4 +259,10 @@ bool MIMETypeRegistry::IsPlainTextMIMEType(const String& mime_type) { EqualIgnoringASCIICase(mime_type, "text/xsl")); } +#if BUILDFLAG(IS_TIZEN_TV) +bool MIMETypeRegistry::IsSupportedJavaScriptPluginMIMEType( + const String& mime_type) { + return IsSupportedJavascriptPluginMimeType(ToASCIIOrEmpty(mime_type)); +} +#endif } // namespace blink diff --git a/third_party/blink/renderer/platform/network/mime/mime_type_registry.h b/third_party/blink/renderer/platform/network/mime/mime_type_registry.h index 845c8b5..edce9a6 100644 --- a/third_party/blink/renderer/platform/network/mime/mime_type_registry.h +++ b/third_party/blink/renderer/platform/network/mime/mime_type_registry.h @@ -121,6 +121,11 @@ class PLATFORM_EXPORT MIMETypeRegistry { // Checks to see if a mime type is suitable for being loaded as plain text. static bool IsPlainTextMIMEType(const String& mime_type); +#if BUILDFLAG(IS_TIZEN_TV) + // Check to see if a mime type is a valid registered JavaScript plugin mime + // type. + static bool IsSupportedJavaScriptPluginMIMEType(const String&); +#endif }; } // namespace blink diff --git a/tizen_src/ewk/efl_integration/common/content_switches_efl.cc b/tizen_src/ewk/efl_integration/common/content_switches_efl.cc index 230c974..5e8a04a1 100644 --- a/tizen_src/ewk/efl_integration/common/content_switches_efl.cc +++ b/tizen_src/ewk/efl_integration/common/content_switches_efl.cc @@ -18,6 +18,8 @@ const char kInjectedBundlePath[] = "injected-bundle-path"; const char kApplicationType[] = "application-type"; // CORS enabled URL schemes const char kCORSEnabledURLSchemes[] = "cors-enabled-url-schemes"; +// JS plugin mime types +const char kJSPluginMimeTypes[] = "jsplugin-mime-types"; #endif // Widget Info diff --git a/tizen_src/ewk/efl_integration/common/content_switches_efl.h b/tizen_src/ewk/efl_integration/common/content_switches_efl.h index 75318c7..569fe0d 100644 --- a/tizen_src/ewk/efl_integration/common/content_switches_efl.h +++ b/tizen_src/ewk/efl_integration/common/content_switches_efl.h @@ -23,6 +23,8 @@ CONTENT_EXPORT extern const char kInjectedBundlePath[]; CONTENT_EXPORT extern const char kApplicationType[]; // CORS enabled url schemes CONTENT_EXPORT extern const char kCORSEnabledURLSchemes[]; +// JS plugin mime types +CONTENT_EXPORT extern const char kJSPluginMimeTypes[]; #endif CONTENT_EXPORT extern const char kTizenAppId[]; CONTENT_EXPORT extern const char kTizenAppVersion[]; diff --git a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h index 6162bc0..c3430cd 100644 --- a/tizen_src/ewk/efl_integration/common/render_messages_ewk.h +++ b/tizen_src/ewk/efl_integration/common/render_messages_ewk.h @@ -255,6 +255,9 @@ IPC_MESSAGE_CONTROL2(EwkProcessMsg_SetExtensibleAPI, IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript) #if BUILDFLAG(IS_TIZEN_TV) +IPC_MESSAGE_CONTROL1(HbbtvMsg_RegisterJSPluginMimeTypes, + std::string /* mime types */) + IPC_MESSAGE_CONTROL1(HbbtvMsg_RegisterURLSchemesAsCORSEnabled, std::string /* scheme */) diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index a85d627..5940a6f 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -989,6 +989,17 @@ void EWebContext::SetApplicationType( } } +void EWebContext::RegisterJSPluginMimeTypes(const Eina_List* mime_types_list) { + std::string mime_types; + const Eina_List* it; + const void* mime_type; + EINA_LIST_FOREACH(mime_types_list, it, mime_type) { + mime_types += static_cast(mime_type); + mime_types += ","; + } + HbbtvWidgetHost::Get().RegisterJSPluginMimeTypes(mime_types); +} + void EWebContext::RegisterURLSchemesAsCORSEnabled( const Eina_List* schemes_list) { std::string schemes; diff --git a/tizen_src/ewk/efl_integration/eweb_context.h b/tizen_src/ewk/efl_integration/eweb_context.h index 8d3d772..c97389e 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.h +++ b/tizen_src/ewk/efl_integration/eweb_context.h @@ -202,6 +202,7 @@ class EWebContext { #if BUILDFLAG(IS_TIZEN_TV) void SetApplicationType(const Ewk_Application_Type application_type); Ewk_Application_Type GetApplicationType() const { return application_type_; } + void RegisterJSPluginMimeTypes(const Eina_List*); void RegisterURLSchemesAsCORSEnabled(const Eina_List* schemes_list); #endif diff --git a/tizen_src/ewk/efl_integration/private/ewk_context_private.cc b/tizen_src/ewk/efl_integration/private/ewk_context_private.cc index cd5a2e9..b685586 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.cc @@ -340,6 +340,10 @@ Ewk_Application_Type Ewk_Context::GetApplicationType() const { return impl->GetApplicationType(); } +void Ewk_Context::RegisterJSPluginMimeTypes(const Eina_List* mime_types) { + impl->RegisterJSPluginMimeTypes(mime_types); +} + void Ewk_Context::RegisterURLSchemesAsCORSEnabled( const Eina_List* schemes_list) { impl->RegisterURLSchemesAsCORSEnabled(schemes_list); diff --git a/tizen_src/ewk/efl_integration/private/ewk_context_private.h b/tizen_src/ewk/efl_integration/private/ewk_context_private.h index 1748281..83991a0 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.h @@ -159,6 +159,8 @@ struct Ewk_Context : public base::RefCounted { void SetApplicationType(const Ewk_Application_Type application_type); Ewk_Application_Type GetApplicationType() const; + // Registers JS plugins mime types + void RegisterJSPluginMimeTypes(const Eina_List*); // Registers url scheme as CORS enabled for HBBTV void RegisterURLSchemesAsCORSEnabled(const Eina_List* schemes_list); #endif diff --git a/tizen_src/ewk/efl_integration/public/ewk_context.cc b/tizen_src/ewk/efl_integration/public/ewk_context.cc index 2eee282..2d20da3 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_context.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_context.cc @@ -883,7 +883,13 @@ void ewk_context_register_url_schemes_as_cors_enabled(Ewk_Context* context, cons void ewk_context_register_jsplugin_mime_types(Ewk_Context* context, const Eina_List* mime_types) { - LOG_EWK_API_MOCKUP(); +#if BUILDFLAG(IS_TIZEN_TV) + EINA_SAFETY_ON_NULL_RETURN(context); + EINA_SAFETY_ON_NULL_RETURN(mime_types); + context->RegisterJSPluginMimeTypes(mime_types); +#else + LOG_EWK_API_MOCKUP("Only for Tizen TV"); +#endif } void ewk_context_websdi_set(Eina_Bool enable) diff --git a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc index 3c0120d..fd006f5 100644 --- a/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc +++ b/tizen_src/ewk/efl_integration/renderer/content_renderer_client_efl.cc @@ -52,9 +52,10 @@ #include "components/autofill/core/common/password_generation_util.h" #endif -#include "renderer/content_renderer_client_efl.h" #include "common/navigation_policy_params.h" #include "content/common/wrt/wrt_url_parse.h" +#include "renderer/content_renderer_client_efl.h" +#include "wrt/hbbtv_widget.h" #include "wrt/wrtwidget.h" #if BUILDFLAG(IS_TIZEN_TV) @@ -180,15 +181,28 @@ void ContentRendererClientEfl::DidCreateScriptContext( content::RenderFrame* render_frame, v8::Handle context, int world_id) { - if (widget_) { - widget_->StartSession(context, render_frame->GetRoutingID(), - render_frame->GetWebFrame() - ->GetDocument() - .BaseURL() - .GetString() - .Utf8() - .c_str()); + if (!widget_) + return; + +#if BUILDFLAG(IS_TIZEN_TV) + if (widget_->GetType() == V8Widget::Type::HBBTV) { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kJSPluginMimeTypes)) { + static_cast(widget_.get()) + ->RegisterJSPluginMimeTypes( + command_line.GetSwitchValueASCII(switches::kJSPluginMimeTypes)); + } } +#endif + + widget_->StartSession(context, render_frame->GetRoutingID(), + render_frame->GetWebFrame() + ->GetDocument() + .BaseURL() + .GetString() + .Utf8() + .c_str()); } void ContentRendererClientEfl::WillReleaseScriptContext( diff --git a/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h b/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h index 29d4835..241e105 100644 --- a/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h +++ b/tizen_src/ewk/efl_integration/wrt/dynamicplugin.h @@ -24,7 +24,7 @@ class DynamicPlugin { virtual bool InitRenderer(const std::string& injected_bundle_path); // Interface for WebApp URL Conversion - virtual void SetWidgetInfo(const std::string& tizen_app_id) {}; + virtual void SetWidgetInfo(const std::string& tizen_app_id){}; virtual bool CanHandleParseUrl(const std::string& scheme) const = 0; virtual void ParseURL(std::string* old_url, std::string* new_url, diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc index 93f5a49..1c49ba3 100644 --- a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.cc @@ -9,6 +9,7 @@ #include "common/render_messages_ewk.h" #include "content/public/renderer/render_thread.h" #include "content/renderer/render_thread_impl.h" +#include "third_party/blink/public/common/mime_util/mime_util.h" #include "third_party/blink/public/web/web_security_policy.h" #include "wrt/hbbtv_dynamicplugin.h" @@ -20,6 +21,8 @@ class HbbtvRenderThreadObserver : public content::RenderThreadObserver { bool OnControlMessageReceived(const IPC::Message& message) override { bool handled = true; IPC_BEGIN_MESSAGE_MAP(HbbtvRenderThreadObserver, message) + IPC_MESSAGE_FORWARD(HbbtvMsg_RegisterJSPluginMimeTypes, hbbtv_widget_, + HbbtvWidget::RegisterJSPluginMimeTypes) IPC_MESSAGE_FORWARD(HbbtvMsg_RegisterURLSchemesAsCORSEnabled, hbbtv_widget_, HbbtvWidget::RegisterURLSchemesAsCORSEnabled) IPC_MESSAGE_UNHANDLED(handled = false) @@ -60,6 +63,11 @@ content::RenderThreadObserver* HbbtvWidget::GetObserver() { return observer_.get(); } +void HbbtvWidget::RegisterJSPluginMimeTypes(std::string mime_types) { + LOG(INFO) << "mime_types = " << mime_types; + blink::RegisterJavascriptPluginMimeTypes(mime_types); +} + void HbbtvWidget::RegisterURLSchemesAsCORSEnabled(std::string schemes) { LOG(INFO) << "schemes = " << schemes; if (schemes_ == schemes) diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h index 9329bcf..08a41ad 100644 --- a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget.h @@ -20,6 +20,7 @@ class HbbtvWidget : public V8Widget { ~HbbtvWidget() override; content::RenderThreadObserver* GetObserver() override; + void RegisterJSPluginMimeTypes(std::string); void RegisterURLSchemesAsCORSEnabled(std::string scheme); private: diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc index 1505311..a665f3b 100644 --- a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.cc @@ -39,6 +39,19 @@ HbbtvWidgetHost& HbbtvWidgetHost::Get() { return g_hbbtv_widget_host_getter.Get().Host(); } +void HbbtvWidgetHost::RegisterJSPluginMimeTypes(const std::string& mime_types) { + if (mime_types_ == mime_types) + return; + + LOG(INFO) << "mime types " << mime_types; + mime_types_ = mime_types; + SendToAllRenderers(new HbbtvMsg_RegisterJSPluginMimeTypes(mime_types)); +} + +const std::string& HbbtvWidgetHost::GetJSPluginMimeTypes() { + return mime_types_; +} + void HbbtvWidgetHost::RegisterURLSchemesAsCORSEnabled( const std::string& schemes) { if (cors_enabled_url_schemes_ == schemes) diff --git a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h index 096c385..c15148c 100644 --- a/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h +++ b/tizen_src/ewk/efl_integration/wrt/hbbtv_widget_host.h @@ -14,6 +14,9 @@ class HbbtvWidgetHost { static HbbtvWidgetHost& Get(); ~HbbtvWidgetHost(); + void RegisterJSPluginMimeTypes(const std::string&); + const std::string& GetJSPluginMimeTypes(); + void RegisterURLSchemesAsCORSEnabled(const std::string& schemes); const std::string& GetCORSEnabledURLSchemes(); @@ -21,6 +24,7 @@ class HbbtvWidgetHost { HbbtvWidgetHost(); std::string cors_enabled_url_schemes_; + std::string mime_types_; friend class HbbtvWidgetHostGetter; }; -- 2.7.4 From d8925f6ba4672c74c30fc7afd0ad51b4a57c7e6e Mon Sep 17 00:00:00 2001 From: Surya Kumar Date: Wed, 1 Mar 2023 17:23:55 +0530 Subject: [PATCH 16/16] [M108 Migration] Set default behavior of common profile as mobile profile WRT disables onscreen mode for |MobileProfile|. This patch equates |MobileProfile| with |CommonProfile| forcing WRT to run in offscreen mode in RPi4, just like M94 AURA and fixes web app errors encountered from wayland module. Reference: https://review.tizen.org/gerrit/280440 Change-Id: I4e75c16fac97a9ad2a90a4f9bf9bf0a58e5fe4a8 Signed-off-by: Surya Kumar --- tizen_src/chromium_impl/tizen/system_info.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tizen_src/chromium_impl/tizen/system_info.cc b/tizen_src/chromium_impl/tizen/system_info.cc index 9e7585b..07392b2 100644 --- a/tizen_src/chromium_impl/tizen/system_info.cc +++ b/tizen_src/chromium_impl/tizen/system_info.cc @@ -56,6 +56,8 @@ int IsDesktopProfile(void) { } int IsMobileProfile(void) { + if (IsCommonProfile()) + return 1; return GET_PROFILE() == PROFILE_MOBILE ? 1 : 0; } -- 2.7.4