From 22180cb03d930bfad7be9d833f7f0d5258b3d5db Mon Sep 17 00:00:00 2001 From: v-saha Date: Thu, 7 Mar 2024 17:10:40 +0530 Subject: [PATCH 01/16] Remove EWK_BRINGUPS for M120 #3 This commit removes some EWK_BRINGUPs added during M120 upversion. Change-Id: I5bbbf3a01b60563bb1a9fde662cf302824b39c47 Signed-off-by: v-saha --- cc/paint/paint_op_writer.h | 33 ---------------------- chrome/browser/extensions/pref_mapping.cc | 2 +- chrome/browser/ui/tabs/supports_handles.h | 2 +- .../generic_sensor/frame_sensor_provider_proxy.cc | 4 --- .../eigen3/src/Eigen/src/Core/util/Memory.h | 2 +- third_party/eigen3/src/Eigen/src/Core/util/Meta.h | 4 ++- .../core/fpdfapi/render/cpdf_renderstatus.cpp | 4 --- v8/src/objects/object-macros.h | 26 ----------------- 8 files changed, 6 insertions(+), 71 deletions(-) diff --git a/cc/paint/paint_op_writer.h b/cc/paint/paint_op_writer.h index 1eae1b9..afcca08 100644 --- a/cc/paint/paint_op_writer.h +++ b/cc/paint/paint_op_writer.h @@ -111,24 +111,8 @@ class CC_PAINT_EXPORT PaintOpWriter { static constexpr size_t kDefaultAlignment = alignof(uint32_t); private: -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup template static constexpr size_t SerializedSizeSimple(); -#else - template - static constexpr size_t SerializedSizeSimple() { - static_assert(!std::is_pointer_v); - if constexpr (std::is_same_v) { - // size_t is always serialized as two uint32_ts to make the serialized - // result portable between 32bit and 64bit processes. - return base::bits::AlignUp(2 * sizeof(uint32_t), kDefaultAlignment); - } else { - static_assert(!std::is_pointer_v); - return base::bits::AlignUp(sizeof(T), kDefaultAlignment); - } - } - -#endif public: // SerializedSize() returns the maximum serialized size of the given type or // the given parameter. For a buffer to contain serialization of multiple @@ -137,23 +121,10 @@ class CC_PAINT_EXPORT PaintOpWriter { // easier to keep serialized size calculation in sync with serialization and // deserialization, and make it possible to allow dynamic sizing for some // data types (see the specialized/overloaded functions). -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup template static constexpr size_t SerializedSize(); template static constexpr size_t SerializedSize(const T& data); -#else - template - static constexpr size_t SerializedSize() { - static_assert(std::is_arithmetic_v || std::is_enum_v); - return SerializedSizeSimple(); - } - template - static constexpr size_t SerializedSize(const T& data) { - return SerializedSizeSimple(); - } - -#endif static size_t SerializedSize(const PaintImage& image); static size_t SerializedSize(const PaintRecord& record); @@ -466,7 +437,6 @@ class CC_PAINT_EXPORT PaintOpWriter { const bool enable_security_constraints_; }; -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup template constexpr size_t PaintOpWriter::SerializedSizeSimple() { static_assert(!std::is_pointer_v); @@ -479,7 +449,6 @@ template <> constexpr size_t PaintOpWriter::SerializedSizeSimple() { return base::bits::AlignUp(2 * sizeof(uint32_t), kDefaultAlignment); } -#endif template <> constexpr size_t PaintOpWriter::SerializedSize() { @@ -493,7 +462,6 @@ constexpr size_t PaintOpWriter::SerializedSize() { SerializedSizeSimple(); // fBaseImageType } -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup template constexpr size_t PaintOpWriter::SerializedSize() { static_assert(std::is_arithmetic_v || std::is_enum_v); @@ -503,7 +471,6 @@ template constexpr size_t PaintOpWriter::SerializedSize(const T& data) { return SerializedSizeSimple(); } -#endif } // namespace cc diff --git a/chrome/browser/extensions/pref_mapping.cc b/chrome/browser/extensions/pref_mapping.cc index 86bdda3..84b9559 100644 --- a/chrome/browser/extensions/pref_mapping.cc +++ b/chrome/browser/extensions/pref_mapping.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if !defined(BUILD_CHROME) #include // std::size. #endif diff --git a/chrome/browser/ui/tabs/supports_handles.h b/chrome/browser/ui/tabs/supports_handles.h index 7180f07..5ae15bf 100644 --- a/chrome/browser/ui/tabs/supports_handles.h +++ b/chrome/browser/ui/tabs/supports_handles.h @@ -56,7 +56,7 @@ // TODO(dfried, tbergquist): move this file down to c/b/ui if it's used outside // of the tabstrip. -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if !BUILDFLAG(IS_TIZEN) #include #endif #include diff --git a/content/browser/generic_sensor/frame_sensor_provider_proxy.cc b/content/browser/generic_sensor/frame_sensor_provider_proxy.cc index ed2e3f9..703cbd2 100644 --- a/content/browser/generic_sensor/frame_sensor_provider_proxy.cc +++ b/content/browser/generic_sensor/frame_sensor_provider_proxy.cc @@ -19,11 +19,7 @@ using device::mojom::SensorType; namespace content { namespace { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup -constexpr std::vector -#else std::vector -#endif SensorTypeToPermissionsPolicyFeatures(SensorType type) { switch (type) { case SensorType::AMBIENT_LIGHT: diff --git a/third_party/eigen3/src/Eigen/src/Core/util/Memory.h b/third_party/eigen3/src/Eigen/src/Core/util/Memory.h index 7df87ec..f819bde 100644 --- a/third_party/eigen3/src/Eigen/src/Core/util/Memory.h +++ b/third_party/eigen3/src/Eigen/src/Core/util/Memory.h @@ -1242,7 +1242,7 @@ inline int queryTopLevelCacheSize() * This wraps C++20's std::construct_at, using placement new instead if it is not available. */ -#if EIGEN_COMP_CXXVER >= 20 && !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if EIGEN_COMP_CXXVER >= 20 && !BUILDFLAG(IS_TIZEN) using std::construct_at; #else template diff --git a/third_party/eigen3/src/Eigen/src/Core/util/Meta.h b/third_party/eigen3/src/Eigen/src/Core/util/Meta.h index ec8baa4..e051139 100644 --- a/third_party/eigen3/src/Eigen/src/Core/util/Meta.h +++ b/third_party/eigen3/src/Eigen/src/Core/util/Meta.h @@ -8,6 +8,8 @@ // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include "build/build_config.h" + #ifndef EIGEN_META_H #define EIGEN_META_H @@ -249,7 +251,7 @@ EIGEN_CONSTEXPR std::ptrdiff_t index_list_size(const T (&)[N]) { return N; } #else template EIGEN_CONSTEXPR auto index_list_size(T&& x) { -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup +#if !BUILDFLAG(IS_TIZEN) using std::ssize; return ssize(std::forward(x)); #else diff --git a/third_party/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp b/third_party/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp index 32ca970..d86c2f6f 100644 --- a/third_party/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/third_party/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -491,11 +491,7 @@ void CPDF_RenderStatus::ProcessClipPath(const CPDF_ClipPath& ClipPath, } else { m_pDevice->SetClip_PathFill( *pPath, &mtObj2Device, -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup CFX_FillRenderOptions(ClipPath.GetClipType(i))); -#else - {.fill_type = ClipPath.GetClipType(i)}); -#endif } } diff --git a/v8/src/objects/object-macros.h b/v8/src/objects/object-macros.h index e849dd8..def9caf 100644 --- a/v8/src/objects/object-macros.h +++ b/v8/src/objects/object-macros.h @@ -602,7 +602,6 @@ #define SEQ_CST_COMPARE_AND_SWAP_FIELD(p, offset, expected, value) \ TaggedField::SeqCst_CompareAndSwap(p, offset, expected, value) -#if !defined(EWK_BRINGUP) // FIXME: m120 bringup #ifdef V8_DISABLE_WRITE_BARRIERS #define WRITE_BARRIER(object, offset, value) #else @@ -626,31 +625,6 @@ value, UPDATE_WRITE_BARRIER); \ } while (false) #endif -#else -#ifdef V8_DISABLE_WRITE_BARRIERS -#define WRITE_BARRIER(object, offset, value) -#else -#define WRITE_BARRIER(object, offset, value) \ - do { \ - DCHECK_NOT_NULL(GetHeapFromWritableObject(object)); \ - static_assert(kTaggedCanConvertToRawObjects); \ - CombinedWriteBarrier(object, (object)->RawField(offset), value, \ - UPDATE_WRITE_BARRIER); \ - } while (false) -#endif - -#ifdef V8_DISABLE_WRITE_BARRIERS -#define WEAK_WRITE_BARRIER(object, offset, value) -#else -#define WEAK_WRITE_BARRIER(object, offset, value) \ - do { \ - DCHECK_NOT_NULL(GetHeapFromWritableObject(object)); \ - static_assert(kTaggedCanConvertToRawObjects); \ - CombinedWriteBarrier(object, (object)->RawMaybeWeakField(offset), value, \ - UPDATE_WRITE_BARRIER); \ - } while (false) -#endif -#endif #ifdef V8_DISABLE_WRITE_BARRIERS #define EPHEMERON_KEY_WRITE_BARRIER(object, offset, value) -- 2.7.4 From bd07ead9a9e75bb4b6cc8c0fa5d36944edab8992 Mon Sep 17 00:00:00 2001 From: jiangyuwei Date: Tue, 26 Mar 2024 16:04:31 +0800 Subject: [PATCH 02/16] [M120 Migration] Introduces network loading API 1. ewk_view_resume_network_loading 2. ewk_view_suspend_network_loading 3. Fix send mojo call issue on window.open case The api called when webbrowser launched. Reference: - https://review.tizen.org/gerrit/291318/ - https://review.tizen.org/gerrit/297667/ Change-Id: I474c919975efbe0301d82acd1ce73cca9a3c797c Signed-off-by: jiangyuwei --- .../renderer_host/render_widget_host_impl.cc | 138 +++++++++++++++++++-- .../renderer_host/render_widget_host_impl.h | 29 ++++- .../public/mojom/widget/platform_widget.mojom | 6 + third_party/blink/public/web/web_view.h | 8 ++ .../blink/renderer/core/exported/web_view_impl.cc | 18 ++- .../blink/renderer/core/exported/web_view_impl.h | 7 +- .../renderer/core/frame/web_frame_widget_impl.cc | 12 +- .../renderer/core/frame/web_frame_widget_impl.h | 2 + third_party/blink/renderer/core/page/page.cc | 16 +++ third_party/blink/renderer/core/page/page.h | 2 + .../blink/renderer/platform/widget/widget_base.cc | 12 +- .../blink/renderer/platform/widget/widget_base.h | 2 + tizen_src/ewk/efl_integration/eweb_view.cc | 19 +++ tizen_src/ewk/efl_integration/eweb_view.h | 2 + tizen_src/ewk/efl_integration/public/ewk_view.cc | 20 ++- .../ewk/efl_integration/public/ewk_view_product.h | 4 +- 16 files changed, 274 insertions(+), 23 deletions(-) diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 43ed9e9..474dd2d 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -832,6 +832,20 @@ void RenderWidgetHostImpl::Init() { // run them here after we clear it. SendScreenRects(); SynchronizeVisualProperties(); +#if BUILDFLAG(IS_TIZEN_TV) + if (pending_suspend_network_loading_closure_) + std::move(pending_suspend_network_loading_closure_).Run(); + + if (pending_resume_network_loading_closure_) + std::move(pending_resume_network_loading_closure_).Run(); + + if (pending_set_active_closure_) + std::move(pending_set_active_closure_).Run(); + + if (pending_set_page_focus_closure_) + std::move(pending_set_page_focus_closure_).Run(); +#endif + // Show/Hide state is not given to the renderer while we are // `waiting_for_init_`, but Init() signals that the renderer is ready to // receive them. This call will inform the renderer that the widget is shown. @@ -931,6 +945,10 @@ void RenderWidgetHostImpl::WasShown( DCHECK(!pending_show_params_); if (!waiting_for_init_) { + if (!blink_widget_) { + LOG(ERROR) << "Bind WidgetInterfaces still not finish"; + return; + } blink_widget_->WasShown(view_->is_evicted(), std::move(record_tab_switch_time_request)); } else { @@ -1138,8 +1156,60 @@ void RenderWidgetHostImpl::ResetLastInteractedElements() { void RenderWidgetHostImpl::SetFloatVideoWindowState(bool enabled) { blink_widget_->SetFloatVideoWindowState(enabled); } -#endif -#endif + +void RenderWidgetHostImpl::SuspendNetworkLoading() { + if (!waiting_for_init_) { + if (!blink_widget_) { + LOG(ERROR) << "Bind WidgetInterfaces still not finish"; + return; + } + blink_widget_->SuspendNetworkLoading(); + + if (pending_suspend_network_loading_closure_) + pending_suspend_network_loading_closure_.Reset(); + } else { + LOG(INFO) << "set pending SuspendNetworkLoading"; + pending_suspend_network_loading_closure_ = + base::BindOnce(&RenderWidgetHostImpl::RunPendingSuspendNetworkLoading, + base::Unretained(this)); + } +} + +void RenderWidgetHostImpl::RunPendingSuspendNetworkLoading() { + if (!blink_widget_) { + LOG(ERROR) << "Bind WidgetInterfaces still not finish"; + return; + } + blink_widget_->SuspendNetworkLoading(); +} + +void RenderWidgetHostImpl::ResumeNetworkLoading() { + if (!waiting_for_init_) { + if (!blink_widget_) { + LOG(ERROR) << "Bind WidgetInterfaces still not finish"; + return; + } + blink_widget_->ResumeNetworkLoading(); + + if (pending_resume_network_loading_closure_) + pending_resume_network_loading_closure_.Reset(); + } else { + LOG(INFO) << "set pending ResumeNetworkLoading"; + pending_resume_network_loading_closure_ = + base::BindOnce(&RenderWidgetHostImpl::RunPendingResumeNetworkLoading, + base::Unretained(this)); + } +} + +void RenderWidgetHostImpl::RunPendingResumeNetworkLoading() { + if (!blink_widget_) { + LOG(ERROR) << "Bind WidgetInterfaces still not finish"; + return; + } + blink_widget_->ResumeNetworkLoading(); +} +#endif // IS_TIZEN_TV +#endif // IS_EFL blink::VisualProperties RenderWidgetHostImpl::GetInitialVisualProperties() { blink::VisualProperties initial_props = GetVisualProperties(); @@ -1511,6 +1581,17 @@ void RenderWidgetHostImpl::FlushForTesting() { } } +void RenderWidgetHostImpl::SetFocusInternal(bool focused) { + blink::mojom::FocusState focus_state = + blink::mojom::FocusState::kNotFocusedAndNotActive; + if (focused) + focus_state = blink::mojom::FocusState::kFocused; + else if (is_active_) + focus_state = blink::mojom::FocusState::kNotFocusedAndActive; + + GetWidgetInputHandler()->SetFocus(focus_state); +} + void RenderWidgetHostImpl::SetPageFocus(bool focused) { OPTIONAL_TRACE_EVENT1("content", "RenderWidgetHostImpl::SetPageFocus", "is_focused", focused); @@ -1545,15 +1626,22 @@ void RenderWidgetHostImpl::SetPageFocus(bool focused) { LockKeyboard(); } - blink::mojom::FocusState focus_state = - blink::mojom::FocusState::kNotFocusedAndNotActive; - if (focused) { - focus_state = blink::mojom::FocusState::kFocused; - } else if (is_active_) { - focus_state = blink::mojom::FocusState::kNotFocusedAndActive; - } +#if BUILDFLAG(IS_TIZEN_TV) + if (!waiting_for_init_) { + SetFocusInternal(focused); - GetWidgetInputHandler()->SetFocus(focus_state); + if (pending_set_page_focus_closure_) + pending_set_page_focus_closure_.Reset(); + + } else { + LOG(INFO) << "set Pending SetPageFocus"; + pending_set_page_focus_closure_ = + base::BindOnce(&RenderWidgetHostImpl::RunPendingSetPageFocus, + base::Unretained(this), focused); + } +#else + SetFocusInternal(focused); +#endif // Also send page-level focus state to other SiteInstances involved in // rendering the current FrameTree, if this widget is for a main frame. @@ -1567,6 +1655,12 @@ void RenderWidgetHostImpl::SetPageFocus(bool focused) { } } +#if BUILDFLAG(IS_TIZEN_TV) +void RenderWidgetHostImpl::RunPendingSetPageFocus(bool focused) { + SetFocusInternal(focused); +} +#endif + void RenderWidgetHostImpl::LostCapture() { if (auto* touch_emulator = GetExistingTouchEmulator()) { touch_emulator->CancelTouch(); @@ -1575,7 +1669,31 @@ void RenderWidgetHostImpl::LostCapture() { GetWidgetInputHandler()->MouseCaptureLost(); } +#if BUILDFLAG(IS_TIZEN_TV) +void RenderWidgetHostImpl::RunPendingSetActive(bool active) { + SetActiveInternal(active); +} +#endif + void RenderWidgetHostImpl::SetActive(bool active) { +#if BUILDFLAG(IS_TIZEN_TV) + if (!waiting_for_init_) { + SetActiveInternal(active); + + if (pending_set_active_closure_) + pending_set_active_closure_.Reset(); + } else { + LOG(INFO) << "set pending setActive"; + pending_set_active_closure_ = + base::BindOnce(&RenderWidgetHostImpl::RunPendingSetActive, + base::Unretained(this), active); + } +#else + SetActiveInternal(active); +#endif +} + +void RenderWidgetHostImpl::SetActiveInternal(bool active) { is_active_ = active; if (blink_frame_widget_) { blink_frame_widget_->SetActive(active); diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index d895491..d9abcd9 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -482,8 +482,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ResetLastInteractedElements(); #if BUILDFLAG(IS_TIZEN_TV) void SetFloatVideoWindowState(bool enabled); -#endif -#endif + void SuspendNetworkLoading(); + void ResumeNetworkLoading(); +#endif // IS_TIZEN_TV +#endif // IS_EFL #if BUILDFLAG(IS_TIZEN) void PauseScheduledTasks(); @@ -518,6 +520,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl // update. Users other than WebContents and RenderWidgetHost should use // Focus()/Blur(). void SetPageFocus(bool focused); + void SetFocusInternal(bool focused); + void SetActiveInternal(bool active); // Returns true if the RenderWidgetHost thinks it is active. This // is different than `is_focused` but must always be true if `is_focused` @@ -1239,6 +1243,20 @@ class CONTENT_EXPORT RenderWidgetHostImpl void AddPendingUserActivation(const blink::WebInputEvent& event); void ClearPendingUserActivation(); +#if BUILDFLAG(IS_TIZEN_TV) + // Calls the pending blink::mojom::Widget::SuspendNetworkLoading. + void RunPendingSuspendNetworkLoading(); + + // Calls the pending blink::mojom::Widget::ResumeNetworkLoading. + void RunPendingResumeNetworkLoading(); + + // Calls the pending blink::mojom::FrameWidget::setActive. + void RunPendingSetActive(bool active); + + // Calls the pending blink::mojom::WidgetInputHandler::SetPageFocus. + void RunPendingSetPageFocus(bool focused); +#endif + // Dispatch any buffered FrameSink requests from the renderer if the widget // has a view and is the owner for the FrameSinkId assigned to it. void MaybeDispatchBufferedFrameSinkRequest(); @@ -1540,6 +1558,13 @@ class CONTENT_EXPORT RenderWidgetHostImpl InputRouterImpl::RequestMouseLockCallback request_mouse_callback_; +#if BUILDFLAG(IS_TIZEN_TV) + base::OnceClosure pending_suspend_network_loading_closure_; + base::OnceClosure pending_resume_network_loading_closure_; + base::OnceClosure pending_set_active_closure_; + base::OnceClosure pending_set_page_focus_closure_; +#endif + // Parameters to pass to blink::mojom::Widget::WasShown after // `waiting_for_init_` becomes true. These are stored in a struct instead of // storing a callback so that they can be updated if diff --git a/third_party/blink/public/mojom/widget/platform_widget.mojom b/third_party/blink/public/mojom/widget/platform_widget.mojom index 72a92f1..0f8367e 100644 --- a/third_party/blink/public/mojom/widget/platform_widget.mojom +++ b/third_party/blink/public/mojom/widget/platform_widget.mojom @@ -179,6 +179,12 @@ interface Widget { [EnableIf=is_tizen_tv] SetFloatVideoWindowState(bool enabled); + [EnableIf=is_tizen_tv] + SuspendNetworkLoading(); + + [EnableIf=is_tizen_tv] + ResumeNetworkLoading(); + // Informs the widget that it was hidden. This allows it to reduce its // resource utilization, and will cancel any pending // RecordContentToVisibleTimeRequest that was set with WasShown or diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h index f637d7f..e12739b 100644 --- a/third_party/blink/public/web/web_view.h +++ b/third_party/blink/public/web/web_view.h @@ -533,6 +533,14 @@ class BLINK_EXPORT WebView { // Returns the selection rect encompassing text and images. virtual gfx::Rect CurrentSelectionRect() const = 0; + +#if BUILDFLAG(IS_TIZEN_TV) + // Suspends loaders for the main frame and all sub-frames. + virtual void SuspendNetworkLoading() = 0; + + // Resumes perviously suspended frame loaders. + virtual void ResumeNetworkLoading() = 0; +#endif // IS_TIZEN_TV #endif #if BUILDFLAG(IS_TIZEN_TV) diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index b476c64..3045cba 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -4579,7 +4579,23 @@ void WebViewImpl::SetScrollOffset(float x, float y) { if (auto* focused_frame = FocusedFrame()) focused_frame->SetScrollOffset(gfx::PointF(x, y)); } -#endif + +#if BUILDFLAG(IS_TIZEN_TV) +void WebViewImpl::SuspendNetworkLoading() { + if (!GetPage()) + return; + + GetPage()->SetDefersLoading(true); +} + +void WebViewImpl::ResumeNetworkLoading() { + if (!GetPage()) + return; + + GetPage()->SetDefersLoading(false); +} +#endif // IS_TIZEN_TV +#endif // IS_EFL #if defined(TIZEN_VIDEO_HOLE) bool WebViewImpl::IsVideoHoleForRender() const { diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h index af2b529..195da37 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h +++ b/third_party/blink/renderer/core/exported/web_view_impl.h @@ -253,7 +253,12 @@ class CORE_EXPORT WebViewImpl final : public WebView, void ScrollFocusedNodeIntoView() override; void SetScrollOffset(float x, float y) override; gfx::Rect CurrentSelectionRect() const override; -#endif + +#if BUILDFLAG(IS_TIZEN_TV) + void SuspendNetworkLoading() override; + void ResumeNetworkLoading() override; +#endif // IS_TIZEN_TV +#endif // IS_EFL // Functions to add and remove observers for this object. void AddObserver(WebViewObserver* observer); diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc index 49630e7..beb29d0 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc @@ -4727,8 +4727,16 @@ bool WebFrameWidgetImpl::RequestMainFrameScrollbarVisible(bool& visible) { void WebFrameWidgetImpl::SetFloatVideoWindowState(bool enabled) { View()->SetFloatVideoWindowState(enabled); } -#endif -#endif + +void WebFrameWidgetImpl::SuspendNetworkLoading() { + View()->SuspendNetworkLoading(); +} + +void WebFrameWidgetImpl::ResumeNetworkLoading() { + View()->ResumeNetworkLoading(); +} +#endif // IS_TIZEN_TV +#endif // IS_EFL #if BUILDFLAG(IS_TIZEN) void WebFrameWidgetImpl::SetMaxRefreshRate(uint32_t max_refresh_rate) { diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h index 2f28251..c327506 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h @@ -803,6 +803,8 @@ class CORE_EXPORT WebFrameWidgetImpl gfx::Rect RequestSelectionRect() override; #if BUILDFLAG(IS_TIZEN_TV) void SetFloatVideoWindowState(bool enabled) override; + void SuspendNetworkLoading() override; + void ResumeNetworkLoading() override; #endif #endif diff --git a/third_party/blink/renderer/core/page/page.cc b/third_party/blink/renderer/core/page/page.cc index ba4259a..7828edb 100644 --- a/third_party/blink/renderer/core/page/page.cc +++ b/third_party/blink/renderer/core/page/page.cc @@ -1216,6 +1216,22 @@ void Page::UpdateLifecycle(LocalFrame& root, void Page::SetLongPollingGlobalTimeout(uint64_t timeout) { long_polling_global_timeout_ = timeout; } + +void Page::SetDefersLoading(bool defers) { + LOG(INFO) << "defers : " << defers + << " defers_loading_ : " << defers_loading_; + if (defers == defers_loading_) + return; + + defers_loading_ = defers; + for (Frame* frame = MainFrame(); frame; + frame = frame->Tree().TraverseNext()) { + if (auto* local_frame = DynamicTo(frame)) { + local_frame->Loader().SetDefersLoading(defers ? LoaderFreezeMode::kStrict + : LoaderFreezeMode::kNone); + } + } +} #endif const base::UnguessableToken& Page::BrowsingContextGroupToken() { diff --git a/third_party/blink/renderer/core/page/page.h b/third_party/blink/renderer/core/page/page.h index 47b52b8..ca98bfb 100644 --- a/third_party/blink/renderer/core/page/page.h +++ b/third_party/blink/renderer/core/page/page.h @@ -348,6 +348,7 @@ class CORE_EXPORT Page final : public GarbageCollected, uint64_t GetLongPollingGlobalTimeout() { return long_polling_global_timeout_; } + void SetDefersLoading(bool defers); #endif void AddAutoplayFlags(int32_t flags); @@ -655,6 +656,7 @@ class CORE_EXPORT Page final : public GarbageCollected, WebScopedVirtualTimePauser history_navigation_virtual_time_pauser_; #if BUILDFLAG(IS_EFL) uint64_t long_polling_global_timeout_ = 0; + bool defers_loading_ = false; #endif // IS_EFL Member diff --git a/third_party/blink/renderer/platform/widget/widget_base.cc b/third_party/blink/renderer/platform/widget/widget_base.cc index 02db385..5cd531a 100644 --- a/third_party/blink/renderer/platform/widget/widget_base.cc +++ b/third_party/blink/renderer/platform/widget/widget_base.cc @@ -564,7 +564,17 @@ void WidgetBase::SelectFocusedLink() { void WidgetBase::RequestSelectionRect(RequestSelectionRectCallback callback) { std::move(callback).Run(client_->RequestSelectionRect()); } -#endif + +#if BUILDFLAG(IS_TIZEN_TV) +void WidgetBase::SuspendNetworkLoading() { + client_->SuspendNetworkLoading(); +} + +void WidgetBase::ResumeNetworkLoading() { + client_->ResumeNetworkLoading(); +} +#endif // IS_TIZEN_TV +#endif // IS_EFL #if BUILDFLAG(IS_TIZEN_TV) void WidgetBase::SetFloatVideoWindowState(bool enabled) { diff --git a/third_party/blink/renderer/platform/widget/widget_base.h b/third_party/blink/renderer/platform/widget/widget_base.h index 9f3e2b1..d385fc7 100644 --- a/third_party/blink/renderer/platform/widget/widget_base.h +++ b/third_party/blink/renderer/platform/widget/widget_base.h @@ -156,6 +156,8 @@ class PLATFORM_EXPORT WidgetBase : public mojom::blink::Widget, RequestMainFrameScrollbarVisibleCallback callback) override; #if BUILDFLAG(IS_TIZEN_TV) void SetFloatVideoWindowState(bool enabled) override; + void SuspendNetworkLoading() override; + void ResumeNetworkLoading() override; #endif // IS_TIZEN_TV void QueryInputType(QueryInputTypeCallback) override; void SelectClosestWord(uint32_t x, uint32_t y) override; diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index ab7fac0..82980e4 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -781,6 +781,20 @@ void EWebView::SetFloatVideoWindowState(bool enabled) { rwhi->SetFloatVideoWindowState(enabled); } + +void EWebView::SuspendNetworkLoading() { + RenderWidgetHostImpl* rwhi = static_cast( + web_contents_->GetRenderViewHost()->GetWidget()); + + rwhi->SuspendNetworkLoading(); +} + +void EWebView::ResumeNetworkLoading() { + RenderWidgetHostImpl* rwhi = static_cast( + web_contents_->GetRenderViewHost()->GetWidget()); + + rwhi->ResumeNetworkLoading(); +} #endif // IS_TIZEN_TV double EWebView::GetTextZoomFactor() const { @@ -3085,6 +3099,11 @@ void EWebView::SendDelayedMessages(RenderViewHost* render_view_host) { return; } +#if BUILDFLAG(IS_TIZEN_TV) + if (pending_setfocus_closure_) + std::move(pending_setfocus_closure_).Run(); +#endif + for (auto iter = delayed_messages_.begin(); iter != delayed_messages_.end(); ++iter) { IPC::Message* message = *iter; diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index 6d7f069..040fc89 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -401,6 +401,8 @@ class EWebView { int player_id, const char* url, const char* mime_type); + void SuspendNetworkLoading(); + void ResumeNetworkLoading(); #endif // IS_TIZEN_TV void SetSessionTimeout(uint64_t timeout); double GetTextZoomFactor() const; diff --git a/tizen_src/ewk/efl_integration/public/ewk_view.cc b/tizen_src/ewk/efl_integration/public/ewk_view.cc index 97c6c20..d30fc43 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_view.cc @@ -1645,14 +1645,26 @@ void ewk_view_widget_pepper_extension_info_set(Evas_Object* ewk_view, Ewk_Value #endif } -void ewk_view_resume_network_loading(Evas_Object* ewkView) +void ewk_view_resume_network_loading(Evas_Object* ewk_view) { - LOG_EWK_API_MOCKUP(); +#if BUILDFLAG(IS_TIZEN_TV) + LOG(INFO) << "view : " << ewk_view; + EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl); + impl->ResumeNetworkLoading(); +#else + LOG_EWK_API_MOCKUP("Only for Tizen TV Browser"); +#endif } -void ewk_view_suspend_network_loading(Evas_Object* ewkView) +void ewk_view_suspend_network_loading(Evas_Object* ewk_view) { - LOG_EWK_API_MOCKUP(); +#if BUILDFLAG(IS_TIZEN_TV) + LOG(INFO) << "view : " << ewk_view; + EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl); + impl->SuspendNetworkLoading(); +#else + LOG_EWK_API_MOCKUP("Only for Tizen TV Browser"); +#endif } void ewk_view_offscreen_rendering_enabled_set(Evas_Object* o, Eina_Bool enabled) 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 9b0eb63..2b760ac 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_view_product.h +++ b/tizen_src/ewk/efl_integration/public/ewk_view_product.h @@ -513,7 +513,7 @@ EXPORT_API Evas_Object* ewk_view_favicon_get(const Evas_Object* ewkView); * @param item view object to resume new url loading * */ -EXPORT_API void ewk_view_resume_network_loading(Evas_Object* ewkView); +EXPORT_API void ewk_view_resume_network_loading(Evas_Object* ewk_view); EXPORT_API void ewk_view_poweroff_suspend(Evas_Object *item); @@ -523,7 +523,7 @@ EXPORT_API void ewk_view_poweroff_suspend(Evas_Object *item); * @param item view object to suspend url loading * */ -EXPORT_API void ewk_view_suspend_network_loading(Evas_Object* ewkView); +EXPORT_API void ewk_view_suspend_network_loading(Evas_Object* ewk_view); /** * This function should be use for browser edge scroll. -- 2.7.4 From c6953fe97e9b1bae2ec2a0276d40d5ab10e4d246 Mon Sep 17 00:00:00 2001 From: Jing Wang Date: Tue, 26 Mar 2024 11:13:14 +0800 Subject: [PATCH 03/16] [M120 Migration] Implement rotation for Aura Pass rotation information to make rotate working. Ref: https://review.tizen.org/gerrit/#/c/291386/ Change-Id: Ia2576c8521a7fc78330ac6630c6d6f9dcc3e1382 Signed-off-by: Jing Wang --- .../renderer_host/render_widget_host_view_aura.cc | 22 ++++++++++++++++++++++ .../renderer_host/render_widget_host_view_aura.h | 9 +++++++++ .../browser/web_contents/web_contents_view_aura.cc | 13 +++++++++++++ .../renderer_host/rwhv_aura_common_helper_efl.h | 2 ++ .../rwhv_aura_offscreen_helper_efl.cc | 5 +++++ .../renderer_host/rwhv_aura_offscreen_helper_efl.h | 3 --- .../ui/display/device_display_info_efl.cc | 3 +++ tizen_src/ewk/efl_integration/eweb_view.cc | 12 ++++++++++++ 8 files changed, 66 insertions(+), 3 deletions(-) diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index b22ac2a..067d0ae 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -145,6 +145,10 @@ #include "base/base_switches.h" #endif +#if BUILDFLAG(IS_TIZEN) +#include "ui/display/device_display_info_efl.h" +#endif + using gfx::RectToSkIRect; using gfx::SkIRectToRect; @@ -315,6 +319,13 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura( ? std::make_unique(this, &web_contents) : std::make_unique(this, &web_contents); #endif +#if BUILDFLAG(IS_TIZEN) + display::DeviceDisplayInfoEfl display_info; + rotation_ = display_info.GetRotationDegrees(); + LOG(INFO) << "Rotation_ " << rotation_; + if (aura_efl_helper()) + aura_efl_helper()->SetOrientation(rotation_); +#endif } //////////////////////////////////////////////////////////////////////////////// @@ -441,6 +452,17 @@ void RenderWidgetHostViewAura::Hide() { HideImpl(); } +#if BUILDFLAG(IS_TIZEN) +void RenderWidgetHostViewAura::UpdateRotationDegrees(int rotation_degrees) { + rotation_ = rotation_degrees; + LOG(INFO) << "Rotation_degrees " << rotation_degrees; + TRACE_EVENT1("viz", "RenderWidgetHostViewAura::UpdateRotationDegrees", + "rotation_", rotation_); + if (aura_efl_helper()) + aura_efl_helper()->SetOrientation(rotation_); +} +#endif + void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) { // For a SetSize operation, we don't care what coordinate system the origin // of the window is in, it's only important to make sure that the origin diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 92245f7..28061eb 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -193,6 +193,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAura void VideoPlayingStatusReceived(bool is_playing, int callback_id) override; #endif bool IsKeyboardLocked() override; +#if BUILDFLAG(IS_TIZEN) + // Sets rotation degrees. Expected values are one of { 0, 90, 180, 270 }. + void UpdateRotationDegrees(int rotation_degrees); +#endif base::flat_map GetKeyboardLayoutMap() override; void InvalidateLocalSurfaceIdAndAllocationGroup() override; void ClearFallbackSurfaceForCommitPending() override; @@ -768,6 +772,11 @@ class CONTENT_EXPORT RenderWidgetHostViewAura class EventObserverForPopupExit; std::unique_ptr event_observer_for_popup_exit_; +#if BUILDFLAG(IS_TIZEN) + // rotation degree + int rotation_ = 0; +#endif + // True when content is being loaded. Used to show an hourglass cursor. bool is_loading_; diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index ca6e320..1bbd090 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -105,6 +105,10 @@ #include "ui/compositor/compositor.h" #endif +#if BUILDFLAG(IS_TIZEN) +#include "ui/display/device_display_info_efl.h" +#endif + namespace content { std::unique_ptr CreateWebContentsView( @@ -929,6 +933,9 @@ void WebContentsViewAura::Focus() { void WebContentsViewAura::SetOrientation(int orientation) { LOG(INFO) << __FUNCTION__ << " " << orientation; + display::DeviceDisplayInfoEfl display_info; + display_info.SetRotationDegrees(orientation); + RenderWidgetHostViewAura* rwhv_aura = static_cast( web_contents_->GetRenderWidgetHostView()); if (rwhv_aura) { @@ -939,6 +946,12 @@ void WebContentsViewAura::SetOrientation(int orientation) { display_info.SetRotationDegrees(orientation); } #endif + WebContentsImpl& contents_impl = + static_cast(*web_contents_); + + rwhv_aura->UpdateScreenInfo(); + contents_impl.OnScreenOrientationChange(); + rwhv_aura->UpdateRotationDegrees(orientation); } TRACE_EVENT1("viz", "WebContentsViewAura::SetOrientation", "orientation", orientation); diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h index f2a5da0..8af89b6 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h @@ -155,6 +155,7 @@ class CONTENT_EXPORT RWHVAuraCommonHelperEfl { void VideoPlayingStatusReceived(bool is_playing, int callback_id); #endif + void SetOrientation(int orientation) { rotation_ = orientation; } void OnGestureEvent(ui::GestureEvent* event); void DidChangeInputType(bool is_password_field); void BackgroundColorReceived(int callback_id, SkColor bg_color); @@ -179,6 +180,7 @@ class CONTENT_EXPORT RWHVAuraCommonHelperEfl { gfx::Size custom_viewport_size_; base::IDMap> screen_capture_cb_map_; + int rotation_ = 0; private: ui::EflEventHandler* GetEventHandler(); diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc index 07a53ba..b80674e 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc @@ -8,6 +8,7 @@ #include #include "base/base_switches.h" +#include "base/trace_event/trace_event.h" #include "content/browser/renderer_host/edge_effect.h" #include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "content/browser/selection/selection_controller_efl.h" @@ -421,6 +422,10 @@ void RWHVAuraOffscreenHelperEfl::PaintTextureToSurface(GLuint texture_id) { evas_gl_api_->glActiveTexture(GL_TEXTURE0); evas_gl_api_->glBindTexture(GL_TEXTURE_2D, texture_id); evas_gl_api_->glUniform1i(source_texture_location_, 0); + + TRACE_EVENT2("viz", "RWHVAuraOffscreenHelperEfl::PaintTextureToSurface", + "this", (void*)this, "rotation", rotation_); + if (rotation_ == 0) { evas_gl_api_->glUniform2f(rotate_position_attrib_, 0, -1); } else if (rotation_ == 90) { diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h index 30202b2..a7644fe 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.h @@ -57,7 +57,6 @@ class CONTENT_EXPORT RWHVAuraOffscreenHelperEfl void SetHorizontalPanningHold(bool hold) { horizontal_panning_hold_ = hold; } bool GetVerticalPanningHold() const { return vertical_panning_hold_; } void SetVerticalPanningHold(bool hold) { vertical_panning_hold_ = hold; } - #if BUILDFLAG(IS_TIZEN_TV) void DrawLabel(Evas_Object* image, Eina_Rectangle rect); void ClearLabels(); @@ -146,8 +145,6 @@ class CONTENT_EXPORT RWHVAuraOffscreenHelperEfl GLuint index_buffer_obj_; gfx::NativeView aura_parent_window_ = nullptr; - int rotation_ = 0; - #if BUILDFLAG(IS_TIZEN_TV) bool radio_or_checkbox_focused_ = false; int password_input_minlength_ = -1; diff --git a/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc b/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc index a0a0f51..9c53f95 100644 --- a/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc +++ b/tizen_src/chromium_impl/ui/display/device_display_info_efl.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/observer_list.h" +#include "base/trace_event/trace_event.h" #include "tizen/system_info.h" #include "ui/display/device_display_info_observer_efl.h" @@ -137,6 +138,8 @@ bool DeviceDisplayInfoEflImpl::Update(int display_width, void DeviceDisplayInfoEflImpl::SetRotationDegrees(int rotation_degrees) { { + TRACE_EVENT1("viz", "DeviceDisplayInfoEfl::SetRotationDegrees", + "rotation_degrees", rotation_degrees); base::AutoLock autolock(rotation_accessor_); rotation_degrees_ = rotation_degrees; } diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index 82980e4..ef84a2c 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -853,6 +853,8 @@ void EWebView::EnterDragState() { #endif void EWebView::SetOrientation(int orientation) { + LOG(INFO) << "New ori " << orientation << " GetOrientation " + << GetOrientation(); if (GetOrientation() == orientation) return; @@ -860,6 +862,12 @@ void EWebView::SetOrientation(int orientation) { orientation == 270) { #if !defined(USE_AURA) GetWebContentsViewEfl()->SetOrientation(orientation); +#else +#if BUILDFLAG(IS_TIZEN) + TRACE_EVENT2("viz", "EWebView::SetOrientation", "orientation", orientation, + "this", (void*)this); + wcva()->SetOrientation(orientation); +#endif #endif int width = 0; int height = 0; @@ -880,8 +888,12 @@ int EWebView::GetOrientation() { #if !defined(USE_AURA) return GetWebContentsViewEfl()->GetOrientation(); #else +#if BUILDFLAG(IS_TIZEN) + return wcva()->GetOrientation(); +#else return 0; #endif +#endif } void EWebView::Show() { -- 2.7.4 From c735da9d196abf0737e3dc77fc9d1e26d551f009 Mon Sep 17 00:00:00 2001 From: fang fengrong Date: Tue, 26 Mar 2024 16:37:29 +0800 Subject: [PATCH 04/16] [M120 Migration][HBBTV] Implement ewk_context_register_jsplugin_mime_types remove EWK_BRINGUP add fixup code refer: https://review.tizen.org/gerrit/#/c/290762 Change-Id: Iedd44b169d45a2063d385649d7266c5947cfa689 Signed-off-by: fang fengrong --- third_party/blink/common/mime_util/mime_util.cc | 3 --- tizen_src/ewk/efl_integration/content_browser_client_efl.cc | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/third_party/blink/common/mime_util/mime_util.cc b/third_party/blink/common/mime_util/mime_util.cc index 1264d3d..ad06180 100644 --- a/third_party/blink/common/mime_util/mime_util.cc +++ b/third_party/blink/common/mime_util/mime_util.cc @@ -204,13 +204,10 @@ bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { #if BUILDFLAG(IS_TIZEN_TV) void MimeUtil::RegisterJavascriptPluginMimeTypes( const std::string& mime_types) { - LOG(ERROR) << " Remove EWK_BRINGUP "; -#if !defined(EWK_BRINGUP) std::stringstream stream(mime_types); std::string mime_type; while (std::getline(stream, mime_type, ',')) javascript_plugin_types_.insert(base::ToLowerASCII(mime_type)); -#endif } bool MimeUtil::IsSupportedJavascriptPluginMimeType( 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 f1b887e..8dd4543 100644 --- a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc +++ b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc @@ -144,6 +144,10 @@ void AppendExtraCommandLineSwitchesInternal(base::CommandLine* command_line, cors_enabled_url_schemes); } + const std::string& mime_types = HbbtvWidgetHost::Get().GetJSPluginMimeTypes(); + if (!mime_types.empty()) + command_line->AppendSwitchASCII(switches::kJSPluginMimeTypes, mime_types); + const double time_offset = static_cast(host->GetBrowserContext()) ->GetTimeOffset(); -- 2.7.4 From ecc660156cb3c32fb33e7c1ac15a6eb98712d4e1 Mon Sep 17 00:00:00 2001 From: "zhishun.zhou" Date: Tue, 26 Mar 2024 17:04:50 +0800 Subject: [PATCH 05/16] [M120 Migration][MM] Ensure player is destroyed before IEMEDrmBridge Issue: when app use EME, chromium pass encrytped frame and key handle to MM, and then MM decrypt frames. When WebMediaPlayerImpl is destroyed, PipelineController::Stop will destroy player by mojom IPC in browser process. But IEMEDrmBridge is destroyed in render process. If IEMEDrmBridge is destroyed before player, MM still use key handle to decrypt, then it will crash. Solution: Use a sync IPC to ensure player is destroyed before IEMEDrmBridge Patches from: https://review.tizen.org/gerrit/#/c/299374/ https://review.tizen.org/gerrit/#/c/300392/ https://review.tizen.org/gerrit/#/c/302624/ Change-Id: I20b77e1c53d3dca685aaf0f355b3b8a149ccc056 Signed-off-by: wuxiaoliang Signed-off-by: zhishun.zhou --- media/base/pipeline.h | 1 + media/base/pipeline_impl.cc | 38 +++++++++++++ media/base/pipeline_impl.h | 1 + media/base/renderer.h | 1 + media/filters/pipeline_controller.cc | 9 +++ media/filters/pipeline_controller.h | 1 + media/mojo/clients/mojo_renderer.cc | 20 +++++++ media/mojo/clients/mojo_renderer.h | 9 +++ media/mojo/clients/mojo_renderer_wrapper.cc | 9 +++ media/mojo/clients/mojo_renderer_wrapper.h | 1 + media/mojo/mojom/renderer.mojom | 3 + media/mojo/services/mojo_renderer_service.cc | 18 ++++++ media/mojo/services/mojo_renderer_service.h | 4 ++ .../platform/media/web_media_player_impl.cc | 29 ++++++++++ .../platform/media/web_media_player_impl.h | 4 ++ .../content/browser/media/tizen_renderer_impl.cc | 11 ++++ .../content/browser/media/tizen_renderer_impl.h | 1 + .../media/filters/media_player_esplusplayer.cc | 65 +++++++++++++++++++--- .../media/filters/media_player_esplusplayer.h | 4 ++ .../media/filters/media_player_esplusplayer_tv.cc | 13 +++++ .../media/filters/media_player_tizen.h | 3 + 21 files changed, 236 insertions(+), 9 deletions(-) diff --git a/media/base/pipeline.h b/media/base/pipeline.h index 0a1260e..d0bbafb 100644 --- a/media/base/pipeline.h +++ b/media/base/pipeline.h @@ -320,6 +320,7 @@ class MEDIA_EXPORT Pipeline { virtual void SetActiveAudioTrack(int index) = 0; virtual void SetActiveVideoTrack(int index) = 0; virtual void SetPreferTextLanguage(const std::string& lang) = 0; + virtual void DestroyPlayerSync(base::OnceClosure cb) = 0; #endif }; diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc index 05d72c1..49553d2 100644 --- a/media/base/pipeline_impl.cc +++ b/media/base/pipeline_impl.cc @@ -121,6 +121,7 @@ class PipelineImpl::RendererWrapper final : public DemuxerHost, void SetActiveAudioTrack(int index); void SetActiveVideoTrack(int index); void SetPreferTextLanguage(const std::string& lang); + void DestroyPlayerSync(base::OnceClosure cb); #endif // |enabled_track_ids| contains track ids of enabled audio tracks. @@ -192,6 +193,7 @@ class PipelineImpl::RendererWrapper final : public DemuxerHost, #if BUILDFLAG(IS_TIZEN_TV) void NotifyTrackInfoToBrowser(int active_track_id) final; void AddTrackInfo(media::MediaTrackInfo trackinfo); + void PlayerDestroyed(); #endif void OnBufferingStateChange(BufferingState state, BufferingStateChangeReason reason) final; @@ -294,6 +296,7 @@ class PipelineImpl::RendererWrapper final : public DemuxerHost, #if BUILDFLAG(IS_TIZEN_TV) std::string mime_type_; std::unique_ptr decrypting_media_resource_{nullptr}; + base::OnceClosure player_destroy_cb_; #endif // Whether we've received the audio/video ended events. @@ -789,6 +792,31 @@ void PipelineImpl::RendererWrapper:: base::BindRepeating(&RendererWrapper::OnWaiting, weak_factory_.GetWeakPtr())); } +void PipelineImpl::RendererWrapper::DestroyPlayerSync(base::OnceClosure cb) { + DCHECK(media_task_runner_->RunsTasksInCurrentSequence()); + LOG(INFO) << "(" << static_cast(this) << ") ;" << __func__; + + // If we destory during starting/seeking/suspending/resuming we don't want to + // leave outstanding callbacks around + pending_callbacks_.reset(); + + player_destroy_cb_ = std::move(cb); + if (shared_state_.renderer) { + shared_state_.renderer->DestroyPlayerSync(base::BindOnce( + &RendererWrapper::PlayerDestroyed, weak_factory_.GetWeakPtr())); + } else { + LOG(INFO) << "(" << static_cast(this) << ") ;" << __func__ + << ", shared_state_.renderer is null"; + std::move(player_destroy_cb_).Run(); + } +} + +void PipelineImpl::RendererWrapper::PlayerDestroyed() { + LOG(INFO) << "(" << static_cast(this) << ") ;" + << "signal: player is destroyed"; + // signal + std::move(player_destroy_cb_).Run(); +} #endif void PipelineImpl::RendererWrapper::CreateRendererInternal( @@ -1898,6 +1926,16 @@ void PipelineImpl::SetCdm(CdmContext* cdm_context, base::BindPostTaskToCurrentDefault(std::move(cdm_attached_cb)))); } +#if BUILDFLAG(IS_TIZEN_TV) +void PipelineImpl::DestroyPlayerSync(base::OnceClosure cb) { + DCHECK(thread_checker_.CalledOnValidThread()); + media_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&RendererWrapper::DestroyPlayerSync, + base::Unretained(renderer_wrapper_.get()), std::move(cb))); +} +#endif + #if defined(TIZEN_MULTIMEDIA) void PipelineImpl::ToggleFullscreenMode(bool is_fullscreen, ToggledFullscreenCB cb) { diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h index c933533..dfe55b6 100644 --- a/media/base/pipeline_impl.h +++ b/media/base/pipeline_impl.h @@ -183,6 +183,7 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline { void SetActiveAudioTrack(int index) override; void SetActiveVideoTrack(int index) override; void SetPreferTextLanguage(const std::string& lang) override; + void DestroyPlayerSync(base::OnceClosure cb) override; #endif void OnBufferingStateChange(BufferingState state, BufferingStateChangeReason reason); diff --git a/media/base/renderer.h b/media/base/renderer.h index bde538a..6884f6a 100644 --- a/media/base/renderer.h +++ b/media/base/renderer.h @@ -114,6 +114,7 @@ class MEDIA_EXPORT Renderer { virtual void SetActiveAudioTrack(int index) {} virtual void SetActiveVideoTrack(int index) {} virtual void SetPreferTextLanguage(const std::string& lang) {} + virtual void DestroyPlayerSync(base::OnceClosure cb) {} #endif // Starts rendering from |time|. diff --git a/media/filters/pipeline_controller.cc b/media/filters/pipeline_controller.cc index eed47f6..1128216 100644 --- a/media/filters/pipeline_controller.cc +++ b/media/filters/pipeline_controller.cc @@ -521,5 +521,14 @@ void PipelineController::SetPreferTextLanguage(const std::string& lang) { } pipeline_->SetPreferTextLanguage(lang); } + +void PipelineController::DestroyPlayerSync(base::OnceClosure cb) { + if (pipeline_) { + pipeline_->DestroyPlayerSync(std::move(cb)); + } else { + LOG(ERROR) << "pipeline_ is null"; + std::move(cb).Run(); + } +} #endif } // namespace media diff --git a/media/filters/pipeline_controller.h b/media/filters/pipeline_controller.h index 113d8bb..6e678c1 100644 --- a/media/filters/pipeline_controller.h +++ b/media/filters/pipeline_controller.h @@ -170,6 +170,7 @@ class MEDIA_EXPORT PipelineController { void SetActiveAudioTrack(int index); void SetActiveVideoTrack(int index); void SetPreferTextLanguage(const std::string& lang); + void DestroyPlayerSync(base::OnceClosure cb); #endif private: // Attempts to make progress from the current state to the target state. diff --git a/media/mojo/clients/mojo_renderer.cc b/media/mojo/clients/mojo_renderer.cc index 55c5084..4f4f7f2 100644 --- a/media/mojo/clients/mojo_renderer.cc +++ b/media/mojo/clients/mojo_renderer.cc @@ -400,6 +400,26 @@ void MojoRenderer::SetPreferTextLanguage(const std::string& lang) { } remote_renderer_->SetPreferTextLanguage(lang); } + +void MojoRenderer::DestroyPlayerSync(base::OnceClosure cb) { + DVLOG(2) << __func__; + DCHECK(task_runner_->RunsTasksInCurrentSequence()); + DCHECK(remote_renderer_.is_bound()); + DCHECK(cb); + DCHECK(!player_destroy_cb_); + + player_destroy_cb_ = std::move(cb); + remote_renderer_->DestroyPlayerSync( + base::BindOnce(&MojoRenderer::OnPlayerDestroyed, base::Unretained(this))); +} + +void MojoRenderer::OnPlayerDestroyed() { + LOG(INFO) << "OnPlayerDestroyed"; + DCHECK(task_runner_->RunsTasksInCurrentSequence()); + DCHECK(player_destroy_cb_); + + std::move(player_destroy_cb_).Run(); +} #endif void MojoRenderer::OnWaiting(WaitingReason reason) { diff --git a/media/mojo/clients/mojo_renderer.h b/media/mojo/clients/mojo_renderer.h index aa08217..53c9754 100644 --- a/media/mojo/clients/mojo_renderer.h +++ b/media/mojo/clients/mojo_renderer.h @@ -83,6 +83,7 @@ class MojoRenderer : public Renderer, public mojom::RendererClient { void SetActiveAudioTrack(int index) override; void SetActiveVideoTrack(int index) override; void SetPreferTextLanguage(const std::string& lang) override; + void DestroyPlayerSync(base::OnceClosure cb) override; #endif private: @@ -138,6 +139,10 @@ class MojoRenderer : public Renderer, public mojom::RendererClient { void OnSeekCompleted(); #endif +#if BUILDFLAG(IS_TIZEN_TV) + void OnPlayerDestroyed(); +#endif + void CancelPendingCallbacks(); // |task_runner| on which all methods are invoked, except for GetMediaTime(), @@ -189,6 +194,10 @@ class MojoRenderer : public Renderer, public mojom::RendererClient { base::OnceClosure seek_cb_; #endif +#if BUILDFLAG(IS_TIZEN_TV) + base::OnceClosure player_destroy_cb_; +#endif + float volume_ = 1.0f; // Lock used to serialize access for |time_interpolator_|. diff --git a/media/mojo/clients/mojo_renderer_wrapper.cc b/media/mojo/clients/mojo_renderer_wrapper.cc index 4f1c591..548e650 100644 --- a/media/mojo/clients/mojo_renderer_wrapper.cc +++ b/media/mojo/clients/mojo_renderer_wrapper.cc @@ -111,6 +111,15 @@ void MojoRendererWrapper::SetPreferTextLanguage(const std::string& lang) { if (mojo_renderer_) mojo_renderer_->SetPreferTextLanguage(lang); } + +void MojoRendererWrapper::DestroyPlayerSync(base::OnceClosure cb) { + if (mojo_renderer_) { + mojo_renderer_->DestroyPlayerSync(std::move(cb)); + } else { + LOG(ERROR) << "mojo_renderer_ is null"; + std::move(cb).Run(); + } +} #endif } // namespace media diff --git a/media/mojo/clients/mojo_renderer_wrapper.h b/media/mojo/clients/mojo_renderer_wrapper.h index fb68130..719b0e1 100644 --- a/media/mojo/clients/mojo_renderer_wrapper.h +++ b/media/mojo/clients/mojo_renderer_wrapper.h @@ -55,6 +55,7 @@ class MojoRendererWrapper : public Renderer { void SetActiveVideoTrack(int index) override; void SetActiveAudioTrack(int index) override; void SetPreferTextLanguage(const std::string& lang) override; + void DestroyPlayerSync(base::OnceClosure cb) override; #endif base::TimeDelta GetMediaTime() override; diff --git a/media/mojo/mojom/renderer.mojom b/media/mojo/mojom/renderer.mojom index 71979eb..7c83186 100644 --- a/media/mojo/mojom/renderer.mojom +++ b/media/mojo/mojom/renderer.mojom @@ -85,6 +85,9 @@ interface Renderer { [EnableIf=is_tizen_tv] SetPreferTextLanguage(string lang); + + [EnableIf=is_tizen_tv] + DestroyPlayerSync() => (); }; // A Mojo equivalent of media::RendererClient. See media/mojo/README.md diff --git a/media/mojo/services/mojo_renderer_service.cc b/media/mojo/services/mojo_renderer_service.cc index 5537033..43333c8 100644 --- a/media/mojo/services/mojo_renderer_service.cc +++ b/media/mojo/services/mojo_renderer_service.cc @@ -259,6 +259,24 @@ void MojoRendererService::SetPreferTextLanguage(const std::string& lang) { } renderer_->SetPreferTextLanguage(lang); } + +void MojoRendererService::OnPlayerDestroyed(base::OnceClosure destroy_cb) { + LOG(INFO) << "OnPlayerDestroyed"; + std::move(destroy_cb).Run(); +} + +void MojoRendererService::DestroyPlayerSync(base::OnceClosure destroy_cb) { + DVLOG(2) << __func__; + + if (renderer_) { + renderer_->DestroyPlayerSync( + base::BindOnce(&MojoRendererService::OnPlayerDestroyed, weak_this_, + std::move(destroy_cb))); + } else { + LOG(ERROR) << "renderer_ is null"; + std::move(destroy_cb).Run(); + } +} #endif void MojoRendererService::OnBufferingStateChange( diff --git a/media/mojo/services/mojo_renderer_service.h b/media/mojo/services/mojo_renderer_service.h index afc535a..0dda352 100644 --- a/media/mojo/services/mojo_renderer_service.h +++ b/media/mojo/services/mojo_renderer_service.h @@ -89,6 +89,7 @@ class MEDIA_MOJO_EXPORT MojoRendererService final : public mojom::Renderer, void SetActiveAudioTrack(int index) final; void SetActiveVideoTrack(int index) final; void SetPreferTextLanguage(const std::string& lang) final; + void DestroyPlayerSync(base::OnceClosure destroy_cb) final; #endif private: @@ -105,6 +106,9 @@ class MEDIA_MOJO_EXPORT MojoRendererService final : public mojom::Renderer, void OnFallback(PipelineStatus status) final; void OnEnded() final; void OnStatisticsUpdate(const PipelineStatistics& stats) final; +#if BUILDFLAG(IS_TIZEN_TV) + void OnPlayerDestroyed(base::OnceClosure destroy_cb); +#endif void OnBufferingStateChange(BufferingState state, BufferingStateChangeReason reason) final; void OnWaiting(WaitingReason reason) final; diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc index b632c01..2e8bdd1 100644 --- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc +++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc @@ -34,6 +34,7 @@ #include "build/build_config.h" #include "cc/layers/video_layer.h" #include "components/viz/common/gpu/raster_context_provider.h" +#include "content/public/common/content_switches.h" #include "media/audio/null_audio_sink.h" #include "media/base/audio_renderer_sink.h" #include "media/base/cdm_context.h" @@ -609,6 +610,25 @@ WebMediaPlayerImpl::~WebMediaPlayerImpl() { std::move(media_thread_mem_dumper_)); main_thread_mem_dumper_.reset(); +#if BUILDFLAG(IS_TIZEN_TV) + // for app eme case, we must ensure player is destroyed before IEMEDrmBridge + // PipelineController::Stop will destroy player by mojom IPC and destroy + // finish time is not fixed Now we split the original PipelineController::Stop + // fuction to 2 parts: + // 1. DestroyPlayerSync only destroy MediaPlayerESPlusPlayer + // 2. Stop is the same with the original logic except 1, such as destroy + // MediaPlayerRendererClient/MojoRendererWrapper/MojoRenderer/MojoRendererService + // /TizenRendererImpl + if (IsSyncDestroyPlayerNeeded()) { + LOG(INFO) << "need destroy player sync..."; + base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); + pipeline_controller_->DestroyPlayerSync(base::BindOnce( + &base::WaitableEvent::Signal, base::Unretained(&waiter))); + waiter.Wait(); + } +#endif + // The underlying Pipeline must be stopped before it is destroyed. // // Note: This destruction happens synchronously on the media thread and @@ -2261,6 +2281,15 @@ void WebMediaPlayerImpl::SetActiveVideoTrack(int index) { void WebMediaPlayerImpl::SetPreferTextLanguage(const std::string& lang) { pipeline_controller_->SetPreferTextLanguage(lang); } + +bool WebMediaPlayerImpl::IsSyncDestroyPlayerNeeded() { + bool single_process_mode = base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSingleProcess); + bool isMSE = load_type_ == kLoadTypeMediaSource; + if (isMSE && single_process_mode && cdm_context_ref_) + return true; + return false; +} #endif bool WebMediaPlayerImpl::CanPlayThrough() { diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.h b/third_party/blink/renderer/platform/media/web_media_player_impl.h index e4b2115..834286d 100644 --- a/third_party/blink/renderer/platform/media/web_media_player_impl.h +++ b/third_party/blink/renderer/platform/media/web_media_player_impl.h @@ -533,6 +533,10 @@ class PLATFORM_EXPORT WebMediaPlayerImpl // Can return a nullptr. scoped_refptr GetCurrentFrameFromCompositor() const; +#if BUILDFLAG(IS_TIZEN_TV) + bool IsSyncDestroyPlayerNeeded(); +#endif + // Sets CdmContext from |cdm| on the pipeline and calls OnCdmAttached() // when done. void SetCdmInternal(WebContentDecryptionModule* cdm); diff --git a/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.cc b/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.cc index a09bc9f..53c0d5a 100644 --- a/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.cc +++ b/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.cc @@ -577,6 +577,17 @@ void TizenRendererImpl::SetParentalRatingResult(bool is_pass) { LOG_ID(ERROR, player_id_) << "media_player_ is null"; } +void TizenRendererImpl::DestroyPlayerSync(base::OnceClosure destroy_cb) { + if (media_player_) { + media::MediaPlayerRegistry::GetInstance()->DeactivateMediaPlayer( + player_id_, !resource_conflicted_); + media_player_->DestroyPlayerSync(std::move(destroy_cb)); + } else { + LOG_ID(INFO, player_id_) << "media_player_ is nullptr"; + std::move(destroy_cb).Run(); + } +} + bool TizenRendererImpl::PlaybackNotificationEnabled() { content::WebContents* web_contents = GetWebContents(); if (!web_contents) { diff --git a/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.h b/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.h index 8208990..bc29db0 100644 --- a/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.h +++ b/tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.h @@ -159,6 +159,7 @@ class CONTENT_EXPORT TizenRendererImpl #if BUILDFLAG(IS_TIZEN_TV) void SetContentMimeType(const std::string& mime_type) override; void SetParentalRatingResult(bool is_pass) override; + void DestroyPlayerSync(base::OnceClosure destroy_cb) override; #endif private: diff --git a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc index e091b85..6b1d9f3 100644 --- a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc +++ b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc @@ -128,7 +128,15 @@ MediaPlayerESPlusPlayer::MediaPlayerESPlusPlayer() { } MediaPlayerESPlusPlayer::~MediaPlayerESPlusPlayer() { - LOG(INFO) << "(" << static_cast(this) << ") " << __func__; +#if BUILDFLAG(IS_TIZEN_TV) + if (!esplayer_) { + LOG_ID(INFO, player_id_) << "player is already destroyed:" << (void*)this; + return; + } +#endif + + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " + << __func__; weak_factory_.InvalidateWeakPtrs(); // Player should be released before destroyed. @@ -142,6 +150,32 @@ MediaPlayerESPlusPlayer::~MediaPlayerESPlusPlayer() { esplayer_ = nullptr; } +#if BUILDFLAG(IS_TIZEN_TV) +void MediaPlayerESPlusPlayer::DestroyPlayerSync(base::OnceClosure destroy_cb) { + if (!esplayer_) { + LOG_ID(INFO, player_id_) << "player is already destroyed:" << (void*)this; + std::move(destroy_cb).Run(); + return; + } + + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " + << __func__; + weak_factory_.InvalidateWeakPtrs(); + + Release(); + + int error = esplusplayer_destroy(esplayer_); + if (error != ESPLUSPLAYER_ERROR_TYPE_NONE) + LOG_ID(ERROR, player_id_) + << "esplusplayer_destroy failed, error #" + << esplusplayer_get_error_string( + static_cast(error)); + esplayer_ = nullptr; + + std::move(destroy_cb).Run(); +} +#endif + bool MediaPlayerESPlusPlayer::CreatePlayer(int player_id) { player_id_ = player_id; @@ -174,10 +208,11 @@ bool MediaPlayerESPlusPlayer::CreatePlayer(int player_id) { } void MediaPlayerESPlusPlayer::Initialize(VideoRendererSink* sink) { - LOG(INFO) << "(" << static_cast(this) << ") " << __func__; + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " + << __func__; if (!esplayer_) { - LOG(INFO) << "(" << static_cast(this) << ") " + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " << "esplayer is null."; return; } @@ -239,8 +274,14 @@ void MediaPlayerESPlusPlayer::SetStreamInfo(DemuxerStream::Type type, void MediaPlayerESPlusPlayer::Prepare() { LOG(INFO) << "(" << static_cast(this) << ") " << __func__; - if (!esplayer_ || is_prepared_ || is_preparing_) + if (!esplayer_ || is_prepared_ || is_preparing_) { + LOG_ID(ERROR, player_id_) + << "(" << static_cast(this) << ") " << __func__ + << ", esplayer_: " << static_cast(esplayer_) + << ", is_prepared_: " << is_prepared_ + << ", is_preparing_: " << is_preparing_; return; + } if (GetPlayerState() != ESPLUSPLAYER_STATE_IDLE) { LOG(ERROR) << "(" << static_cast(this) << ") " << __func__ @@ -274,7 +315,7 @@ bool MediaPlayerESPlusPlayer::IsPrepared() { } bool MediaPlayerESPlusPlayer::CanPrepare() { - return !IsPrepared() && !is_preparing_; + return esplayer_ && !IsPrepared() && !is_preparing_; } void MediaPlayerESPlusPlayer::Release() { @@ -1403,7 +1444,7 @@ void MediaPlayerESPlusPlayer::SetMediaGeometry(const gfx::Rect& viewport_rect, << " rect : " << rect.ToString(); if (!esplayer_ || !video_plane_controller_) { - LOG(INFO) + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " << "player is destroyed, or video plane controller not exist."; return; @@ -1413,10 +1454,16 @@ void MediaPlayerESPlusPlayer::SetMediaGeometry(const gfx::Rect& viewport_rect, } void MediaPlayerESPlusPlayer::PrepareVideoHole() { - LOG(INFO) << "(" << static_cast(this) << ") " << __func__; - if (!esplayer_ || is_prepared_ || is_preparing_) + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " + << __func__; + if (!esplayer_ || is_prepared_ || is_preparing_) { + LOG_ID(ERROR, player_id_) + << "(" << static_cast(this) << ") " << __func__ + << ", esplayer_: " << static_cast(esplayer_) + << ", is_prepared_: " << is_prepared_ + << ", is_preparing_: " << is_preparing_; return; - + } if (GetPlayerState() != ESPLUSPLAYER_STATE_IDLE) { LOG(ERROR) << "(" << static_cast(this) << ") " << __func__ << " Prepare called on invalid state : " diff --git a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.h b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.h index a8e9c59..ec62e6b 100644 --- a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.h +++ b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer.h @@ -85,6 +85,10 @@ class MEDIA_EXPORT MediaPlayerESPlusPlayer : public MediaPlayerTizen { void DestroyMediaPacket(void* media_packet) override; #endif +#if BUILDFLAG(IS_TIZEN_TV) + void DestroyPlayerSync(base::OnceClosure destroy_cb) override; +#endif + // Callback handler void OnReadyToPrepare(const esplusplayer_stream_type stream_type); virtual void OnPrepareComplete(bool result); diff --git a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer_tv.cc b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer_tv.cc index 84361c1..c781940 100644 --- a/tizen_src/chromium_impl/media/filters/media_player_esplusplayer_tv.cc +++ b/tizen_src/chromium_impl/media/filters/media_player_esplusplayer_tv.cc @@ -30,6 +30,13 @@ MediaPlayerESPlusPlayerTV::~MediaPlayerESPlusPlayerTV() { void MediaPlayerESPlusPlayerTV::Initialize(VideoRendererSink* sink) { LOG(INFO) << "(" << static_cast(this) << ") " << __func__; + + if (!esplayer_) { + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " + << "esplayer is null."; + return; + } + single_process_mode_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSingleProcess); MediaPlayerESPlusPlayer::Initialize(sink); @@ -41,6 +48,12 @@ void MediaPlayerESPlusPlayerTV::InitializeStreamConfig( DemuxerStream::Type type) { LOG(INFO) << "(" << static_cast(this) << ") " << __func__; + if (!esplayer_) { + LOG_ID(INFO, player_id_) << "(" << static_cast(this) << ") " + << "esplayer is null."; + return; + } + MediaPlayerESPlusPlayer::InitializeStreamConfig(type); } diff --git a/tizen_src/chromium_impl/media/filters/media_player_tizen.h b/tizen_src/chromium_impl/media/filters/media_player_tizen.h index d24ffc6..0fbfcb6 100644 --- a/tizen_src/chromium_impl/media/filters/media_player_tizen.h +++ b/tizen_src/chromium_impl/media/filters/media_player_tizen.h @@ -116,6 +116,9 @@ class MEDIA_EXPORT MediaPlayerTizen { virtual void SetActiveVideoTrack(int index) {} virtual void SetPreferTextLanguage(const std::string& lang) {} virtual void UpdateEventData(std::string data) {} +#if BUILDFLAG(IS_TIZEN_TV) + virtual void DestroyPlayerSync(base::OnceClosure destroy_cb) {} +#endif }; } // namespace media -- 2.7.4 From 1d960402b90ded5d575195c9758c95fa4f2c717b Mon Sep 17 00:00:00 2001 From: fangfengrong Date: Wed, 27 Mar 2024 08:55:10 +0800 Subject: [PATCH 06/16] [M120 Migration][VD] Add schemes for Tizen TV product Fix hbbtv schemes don't call in IsURLHandledByNetworkService refer: https://review.tizen.org/gerrit/#/c/292964 Change-Id: I8e65d60c46e8d585642047661580147bf9e178eb Signed-off-by: fangfengrong --- services/network/public/cpp/url_util.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/network/public/cpp/url_util.cc b/services/network/public/cpp/url_util.cc index 04ec563..bb2cfd7 100644 --- a/services/network/public/cpp/url_util.cc +++ b/services/network/public/cpp/url_util.cc @@ -9,14 +9,13 @@ namespace network { bool IsURLHandledByNetworkService(const GURL& url) { - return (url.SchemeIsHTTPOrHTTPS() || url.SchemeIsWSOrWSS()); - #if BUILDFLAG(IS_TIZEN_TV) if (url.SchemeIs(url::kDvbScheme) || url.SchemeIs(url::kMmfScheme) || url.SchemeIs(url::kTVKeyScheme) || url.SchemeIs(url::kOpAppScheme) || url.SchemeIs(url::kHbbTVCarouselScheme) || url.SchemeIs(url::kCIScheme)) return true; #endif + return (url.SchemeIsHTTPOrHTTPS() || url.SchemeIsWSOrWSS()); } } // namespace network -- 2.7.4 From afe75ece047987427ae35953b50acf8f0c3e3f29 Mon Sep 17 00:00:00 2001 From: jiangyuwei Date: Mon, 25 Mar 2024 15:13:55 +0800 Subject: [PATCH 07/16] [M120 Migration][VD][Accessibility] TV customization of accessibility 1. TTS does not output for blur and focus on the same node 2. Ignore uncheck event for radio button 3. Do not emit children-changed::remove when subtree will be deleted 4. Avoid description and name completely same 5. Set focus ring color to blue on tizen TV 6. Show focus ring on tv browser References: - https://review.tizen.org/gerrit/#/c/291477/ Change-Id: I183f4702cd43744f8f4bc7fb12a40bcdb74f2b7a Signed-off-by: jiangyuwei --- .../accessibility/browser_accessibility_manager.cc | 11 ++++++++ .../blink/renderer/core/exported/web_view_impl.cc | 8 ++++++ .../blink/renderer/core/layout/layout_theme.cc | 20 +++++++++++++ .../renderer/modules/accessibility/ax_object.cc | 8 ++++++ .../modules/accessibility/ax_object_cache_impl.cc | 8 ++++++ .../accessibility/platform/ax_platform_node_efl.cc | 33 ++++++++++++---------- .../platform/ax_platform_node_auralinux.cc | 18 ++++++++++++ 7 files changed, 91 insertions(+), 15 deletions(-) diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc index 95a81ac1..5bd0206 100644 --- a/content/browser/accessibility/browser_accessibility_manager.cc +++ b/content/browser/accessibility/browser_accessibility_manager.cc @@ -406,6 +406,17 @@ bool BrowserAccessibilityManager::OnAccessibilityEvents( if (!use_custom_device_scale_factor_for_testing_) UpdateDeviceScaleFactor(); +#if BUILDFLAG(IS_TIZEN_TV) + // if blur event, last_focused_node_ should be set to root or nullptr + // for next focus change event. And it may be already set to nullptr + // in OnAtomicUpdateFinished, do not reset it here in this case. + // for case: blur -> change content -> refocus on the same node + for (const ui::AXEvent& event : details.events) { + if (event.event_type == ax::mojom::Event::kBlur && GetLastFocusedNode()) + SetLastFocusedNode(GetRoot()); + } +#endif + // Optionally merge multiple tree updates into fewer updates. const std::vector* tree_updates = &details.updates; std::vector merged_tree_updates; diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index 3045cba..6db04fe 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -3642,7 +3642,11 @@ void WebViewImpl::UpdateRendererPreferences( #if defined(USE_AURA) if (renderer_preferences_.use_custom_colors) { +#if !BUILDFLAG(IS_TIZEN_TV) + // It will set focus ring color to default, but for tizen TV, + // focus ring color will be set in layout_theme_chromium_tizen.cc. SetFocusRingColor(renderer_preferences_.focus_ring_color); +#endif SetSelectionColors(renderer_preferences_.active_selection_bg_color, renderer_preferences_.active_selection_fg_color, renderer_preferences_.inactive_selection_bg_color, @@ -3651,9 +3655,13 @@ void WebViewImpl::UpdateRendererPreferences( } #endif +#if !BUILDFLAG(IS_TIZEN_TV) + // It will set focus ring color to default, but for tizen TV, + // focus ring color will be set in layout_theme_chromium_tizen.cc. if (renderer_preferences_.use_custom_colors) { SetFocusRingColor(renderer_preferences_.focus_ring_color); } +#endif if (old_accept_languages != renderer_preferences_.accept_languages) AcceptLanguagesChanged(); diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index 8213d02..7573328 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc @@ -63,6 +63,10 @@ #include "ui/base/ui_base_features.h" #include "ui/native_theme/native_theme.h" +#if BUILDFLAG(IS_TIZEN_TV) +#include "third_party/blink/public/platform/web_application_type.h" +#endif + // The methods in this file are shared by all themes on every platform. namespace blink { @@ -421,6 +425,22 @@ bool LayoutTheme::IsControlStyled(ControlPart part, bool LayoutTheme::ShouldDrawDefaultFocusRing(const Node* node, const ComputedStyle& style) const { +#if BUILDFLAG(IS_TIZEN) + bool should_draw = false; + if (node) { + LocalFrame* frame = node->GetDocument().GetFrame(); + Settings* settings = nullptr; + if (frame) + settings = frame->GetSettings(); +#if BUILDFLAG(IS_TIZEN_TV) + if (IsWebBrowser() && settings && settings->GetSpatialNavigationEnabled()) + should_draw = true; +#endif + } + if (!should_draw) + return false; +#endif + if (!node) return true; if (!style.HasEffectiveAppearance() && !node->IsLink()) diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index 8793fc9..0f08deb 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc @@ -1828,7 +1828,15 @@ void AXObject::SerializeNameAndDescriptionAttributes( AXObjectVector description_objects; String description = Description(name_from, description_from, &description_objects); +#if BUILDFLAG(IS_TIZEN_TV) + // If description string is identical with name string, abandon it. + // Delete leading and trailing white space characters before comparing. + if (!description.empty() && + base::TrimWhitespaceASCII(description.Utf8(), base::TRIM_ALL) != + base::TrimWhitespaceASCII(name.Utf8(), base::TRIM_ALL)) { +#else if (!description.empty()) { +#endif DCHECK(description_from != ax::mojom::blink::DescriptionFrom::kNone); TruncateAndAddStringAttribute( node_data, ax::mojom::blink::StringAttribute::kDescription, diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index 6f604e7..11c1b7a 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc @@ -4298,6 +4298,14 @@ void AXObjectCacheImpl::HandleFocusedUIElementChanged( if (old_focused_element) { DeferTreeUpdate(TreeUpdateReason::kNodeLostFocus, old_focused_element); } +#if BUILDFLAG(IS_TIZEN_TV) + else { + // If old_focused_element's ax object is nullptr, set it to root, + // or else the blur event can not be sent to browser process. + // for case: blur -> change content -> refocus on the same node + PostNotification(Root(), ax::mojom::Event::kBlur); + } +#endif UpdateActiveAriaModalDialog(new_focused_element); diff --git a/tizen_src/chromium_impl/ui/accessibility/platform/ax_platform_node_efl.cc b/tizen_src/chromium_impl/ui/accessibility/platform/ax_platform_node_efl.cc index 5f784a7..c200a80 100644 --- a/tizen_src/chromium_impl/ui/accessibility/platform/ax_platform_node_efl.cc +++ b/tizen_src/chromium_impl/ui/accessibility/platform/ax_platform_node_efl.cc @@ -102,11 +102,10 @@ void AXPlatformNodeEfl::SetInterfaceMaskFromObject( // AX_ATTR_NAME attribute value which contains link or heading contents will // be read by screen-reader anyway as it is returned from get_name atk // interface. - switch (GetData().role) { - case ax::mojom::Role::kHeading: - case ax::mojom::Role::kLink: - return; - } + if (GetData().role == ax::mojom::Role::kHeading || + GetData().role == ax::mojom::Role::kLink) + return; + if (IsTextObjectType() || IsColorWell() || IsSection()) interface_mask.Add(ImplementedAtkInterfaces::Value::kText); @@ -197,7 +196,7 @@ std::string AXPlatformNodeEfl::GetObjectValue() const { GetData().GetStringAttribute(ax::mojom::StringAttribute::kValue); if (!value.empty()) return value; - for (uint32_t i = 0; i < GetChildCount(); i++) { + for (int i = 0; i < GetChildCount(); i++) { AXPlatformNodeEfl* obj = ToAXPlatformNodeEfl( AXPlatformNode::FromNativeViewAccessible(ChildAtIndex(i))); if (obj) { @@ -295,8 +294,9 @@ bool AXPlatformNodeEfl::IsDocument() const { case ax::mojom::Role::kRootWebArea: case ax::mojom::Role::kPdfRoot: return true; + default: + return false; } - return false; } bool AXPlatformNodeEfl::IsAccessible() const { @@ -371,7 +371,7 @@ std::string AXPlatformNodeEfl::GetSupplementaryText() const { std::string AXPlatformNodeEfl::GetChildrenText() const { std::string text; - for (uint32_t i = 0; i < GetChildCount(); i++) { + for (int i = 0; i < GetChildCount(); i++) { AXPlatformNodeEfl* obj = ToAXPlatformNodeEfl( AXPlatformNode::FromNativeViewAccessible(ChildAtIndex(i))); if (obj) { @@ -397,7 +397,7 @@ std::string AXPlatformNodeEfl::GetChildrenText() const { } bool AXPlatformNodeEfl::HasOnlyTextChildren() const { - for (uint32_t i = 0; i < GetChildCount(); i++) { + for (int i = 0; i < GetChildCount(); i++) { AXPlatformNodeEfl* obj = ToAXPlatformNodeEfl( AXPlatformNode::FromNativeViewAccessible(ChildAtIndex(i))); if (obj && !obj->IsTextObjectType()) @@ -407,7 +407,7 @@ bool AXPlatformNodeEfl::HasOnlyTextChildren() const { } bool AXPlatformNodeEfl::HasOnlyTextAndImageChildren() const { - for (uint32_t i = 0; i < GetChildCount(); i++) { + for (int i = 0; i < GetChildCount(); i++) { AXPlatformNodeEfl* obj = ToAXPlatformNodeEfl( AXPlatformNode::FromNativeViewAccessible(ChildAtIndex(i))); if (obj && !obj->IsTextObjectType() && @@ -468,10 +468,7 @@ std::string AXPlatformNodeEfl::GetSubTreeSpeechContent() const { std::string result; // if name from contents, will get it from children - if (static_cast( - GetData().GetIntAttribute(ax::mojom::IntAttribute::kNameFrom)) != - ax::mojom::NameFrom::kContents && - !GetData() + if (!GetData() .GetStringAttribute(ax::mojom::StringAttribute::kName) .empty()) { result.append( @@ -487,7 +484,13 @@ std::string AXPlatformNodeEfl::GetSubTreeSpeechContent() const { result.append(" "); } - for (uint32_t i = 0; i < GetChildCount(); i++) { + // if name from contents, children contents have already been merged in name + if (static_cast( + GetData().GetIntAttribute(ax::mojom::IntAttribute::kNameFrom)) == + ax::mojom::NameFrom::kContents) + return result; + + for (int i = 0; i < GetChildCount(); i++) { AXPlatformNodeEfl* obj = ToAXPlatformNodeEfl( AXPlatformNode::FromNativeViewAccessible(ChildAtIndex(i))); if (obj) { diff --git a/ui/accessibility/platform/ax_platform_node_auralinux.cc b/ui/accessibility/platform/ax_platform_node_auralinux.cc index a4da26f..e115a5c 100644 --- a/ui/accessibility/platform/ax_platform_node_auralinux.cc +++ b/ui/accessibility/platform/ax_platform_node_auralinux.cc @@ -3517,6 +3517,15 @@ void AXPlatformNodeAuraLinux::OnCheckedStateChanged() { if (!obj) return; +#if BUILDFLAG(IS_TIZEN_TV) + // Checking one radio button alway happened when uncheck another button, + // Sometimes the uncheck event comes after the check event and interrupt + // the reading of check event (see browser setting page), so ignore it + if (ax::mojom::Role::kRadioButton == GetData().role && + GetData().GetCheckedState() == ax::mojom::CheckedState::kFalse) + return; +#endif + atk_object_notify_state_change( ATK_OBJECT(obj), GetAtkStateTypeForCheckableNode(), GetData().GetCheckedState() != ax::mojom::CheckedState::kFalse); @@ -3768,8 +3777,10 @@ void AXPlatformNodeAuraLinux::OnFocused() { return; } +#if !BUILDFLAG(IS_TIZEN_TV) if (atk_object == g_current_focused) return; +#endif SetActiveViewsDialog(); @@ -4093,6 +4104,12 @@ void AXPlatformNodeAuraLinux::OnSubtreeCreated() { } void AXPlatformNodeAuraLinux::OnSubtreeWillBeDeleted() { +#if BUILDFLAG(IS_TIZEN_TV) + // Tizen screen reader not support children-changed event and after + // "children-changed::remove" sent, ATK have a callback to get state + // that could cause crash in GetFocusFromThisOrDescendantFrame + return; +#else // There is a chance there won't be a parent as we're in the deletion process. // We also don't want to notify if this is an ignored node if (!GetParent() || GetData().IsIgnored()) @@ -4108,6 +4125,7 @@ void AXPlatformNodeAuraLinux::OnSubtreeWillBeDeleted() { : -1; g_signal_emit_by_name(GetParent(), "children-changed::remove", index_gint, atk_object); +#endif } void AXPlatformNodeAuraLinux::OnParentChanged() { -- 2.7.4 From 0210b5eaf911ebd7b0c05be18ce5ae1e203181e2 Mon Sep 17 00:00:00 2001 From: jinbei09 Date: Mon, 18 Mar 2024 21:12:15 +0800 Subject: [PATCH 08/16] [M120 Migration][NaCl][PPFwk] Enable VD Trusted Plugins functionality Migrated from tizen 8.0: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/289527/ Change-Id: Idd760f65428cade6f2efa9df96dd8e15871fe795 Signed-off-by: jinbei09 --- chrome/renderer/chrome_content_renderer_client.cc | 21 +--- content/public/renderer/content_renderer_client.cc | 2 - content/renderer/BUILD.gn | 9 -- .../renderer/pepper/pepper_video_decoder_host.cc | 2 +- content/renderer/pepper/ppb_graphics_3d_impl.cc | 28 ----- ppapi/proxy/var_value_converter.cc | 55 +++------- tizen_src/build/gn_chromiumefl.sh | 3 +- .../common/trusted_pepper_plugin_info_cache.cc | 121 +++++++++------------ .../ewk_extension_system_delegate.cc | 12 +- tizen_src/ewk/efl_integration/public/ewk_value.cc | 81 +++++++------- 10 files changed, 118 insertions(+), 216 deletions(-) diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index db900e7..a923e46 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -1492,26 +1492,7 @@ bool ChromeContentRendererClient::IsExternalPepperPlugin( bool ChromeContentRendererClient::IsOriginIsolatedPepperPlugin( const base::FilePath& plugin_path) { - // Hosting plugins in-process is inherently incompatible with attempting to - // process-isolate plugins from different origins. - auto* cmdline = base::CommandLine::ForCurrentProcess(); - if (cmdline->HasSwitch(switches::kPpapiInProcess)) { - // The kPpapiInProcess switch should only be used by tests. In particular, - // we expect that the PDF plugin should always be isolated in the product - // (and that the switch won't interfere with PDF isolation). - CHECK_NE(ChromeContentClient::kPDFInternalPluginPath, plugin_path.value()); - - return false; - } - -#if BUILDFLAG(ENABLE_NACL) - // Don't isolate the NaCl plugin (preserving legacy behavior). - if (plugin_path.value() == nacl::kInternalNaClPluginFileName) - return false; -#endif - - // Isolate all the other plugins (including the PDF plugin + test plugins). - return true; + return plugin_path.value() == ChromeContentClient::kPDFInternalPluginPath; } #if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_EXTENSIONS) diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc index 85a765e..87b9bfe 100644 --- a/content/public/renderer/content_renderer_client.cc +++ b/content/public/renderer/content_renderer_client.cc @@ -4,12 +4,10 @@ #include "content/public/renderer/content_renderer_client.h" -#include "base/command_line.h" #include "base/task/sequenced_task_runner.h" #include "base/task/single_thread_task_runner.h" #include "build/build_config.h" #include "build/chromecast_buildflags.h" -#include "content/public/common/content_switches.h" #include "media/base/demuxer.h" #include "media/base/renderer_factory.h" #include "third_party/blink/public/common/security/protocol_handler_security_level.h" diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index e5442c4..1cdb209 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn @@ -538,15 +538,6 @@ target(link_target_type, "renderer") { "//ui/base/cursor", "//ui/base/cursor/mojom:cursor_type", ] - - if (is_tizen) { - sources -= [ - "pepper/video_decoder_shim.cc", - "pepper/video_decoder_shim.h", - "pepper/video_encoder_shim.cc", - "pepper/video_encoder_shim.h", - ] - } } if (is_win) { diff --git a/content/renderer/pepper/pepper_video_decoder_host.cc b/content/renderer/pepper/pepper_video_decoder_host.cc index 36cd787..471ff14 100644 --- a/content/renderer/pepper/pepper_video_decoder_host.cc +++ b/content/renderer/pepper/pepper_video_decoder_host.cc @@ -272,8 +272,8 @@ int32_t PepperVideoDecoderHost::OnHostMsgInitialize( context->reply_msg = PpapiPluginMsg_VideoDecoder_InitializeReply(use_shared_images_); return PP_OK; -#endif } +#endif decoder_.reset(); if (acceleration == PP_HARDWAREACCELERATION_ONLY) return PP_ERROR_NOTSUPPORTED; diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc index 2a73734..d074107 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc @@ -47,29 +47,6 @@ using blink::WebString; namespace content { -namespace { - -#if BUILDFLAG(IS_TIZEN_TV) -const int32_t kMaxTextureSamples = 4; -#endif - -bool UseSharedImagesSwapChainForPPAPI() { - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisablePPAPISharedImagesSwapChain)) { - // This log is to make diagnosing any outages for Enterprise customers - // easier. - LOG(WARNING) << "NaCL SwapChain: Disabled by policy"; - return false; - } - - auto enabled = - base::FeatureList::IsEnabled(features::kPPAPISharedImagesSwapChain); - // This log is to make diagnosing any outages for Enterprise customers easier. - LOG(WARNING) << "NaCL SwapChain: Feature Controled: " << enabled; - return enabled; -} - -} // namespace // This class encapsulates ColorBuffer for the plugin. It wraps corresponding // SharedImage that we draw to and that we send to display compositor. @@ -371,11 +348,6 @@ bool PPB_Graphics3D_Impl::InitRaw( gpu::ContextCreationAttribs attrib_helper; attrib_helper.context_type = gpu::CONTEXT_TYPE_OPENGLES2; -#if BUILDFLAG(IS_TIZEN_TV) - if (attrib_helper.samples > 1 && attrib_helper.sample_buffers > 1) - attrib_helper.samples = std::min(attrib_helper.samples, kMaxTextureSamples); -#endif - gpu::CommandBufferProxyImpl* share_buffer = nullptr; UMA_HISTOGRAM_BOOLEAN("Pepper.Graphics3DHasShareGroup", !!share_context); if (share_context) { diff --git a/ppapi/proxy/var_value_converter.cc b/ppapi/proxy/var_value_converter.cc index b4381e2..2d5a504 100644 --- a/ppapi/proxy/var_value_converter.cc +++ b/ppapi/proxy/var_value_converter.cc @@ -15,29 +15,24 @@ namespace proxy { namespace { -std::unique_ptr ValueFromVarArray(const PP_Var& var) { -#if !defined(EWK_BRINGUP) - LOG(ERROR) << " Remove EWK_BRINGUP "; +std::unique_ptr ValueFromVarArray(const PP_Var& var) { if (var.type == PP_VARTYPE_ARRAY) { scoped_refptr array = scoped_refptr(ArrayVar::FromPPVar(var)); if (!array) { return std::make_unique(); } - auto ret = std::make_unique(); + base::Value::List ret; for (size_t i = 0; i < array->GetLength(); ++i) { ScopedPPVar var(ScopedPPVar::PassRef(), array->Get(i)); - ret->Append(std::move(*ValueFromVar(var.get()))); + ret.Append(std::move(*ValueFromVar(var.get()))); } - return std::move(ret); + return std::make_unique(std::move(ret)); } -#endif - return std::make_unique(); + return std::make_unique(); } -std::unique_ptr ValueFromVarDictionary(const PP_Var& var) { -#if !defined(EWK_BRINGUP) - LOG(ERROR) << " Remove EWK_BRINGUP "; +std::unique_ptr ValueFromVarDictionary(const PP_Var& var) { if (var.type == PP_VARTYPE_DICTIONARY) { scoped_refptr dict = scoped_refptr(DictionaryVar::FromPPVar(var)); @@ -51,7 +46,7 @@ std::unique_ptr ValueFromVarDictionary(const PP_Var& var) { return std::make_unique(); } - auto ret = std::make_unique(); + base::Value::Dict ret; for (size_t i = 0; i < keys->GetLength(); ++i) { ScopedPPVar var_k(ScopedPPVar::PassRef(), keys->Get(i)); scoped_refptr key = @@ -64,50 +59,43 @@ std::unique_ptr ValueFromVarDictionary(const PP_Var& var) { ScopedPPVar var_v(ScopedPPVar::PassRef(), dict->Get(var_k.get())); // SetWithoutPathExpansion is used instead of Set here to allow // e.g. URLs to be used as keys. Set method treats '.' as keys separator. - ret->SetKey(key_string, std::move(*ValueFromVar(var_v.get()))); + ret.Set(key_string, std::move(*ValueFromVar(var_v.get()))); } - return std::move(ret); + return std::make_unique(std::move(ret)); } -#endif - return std::make_unique(); + return std::make_unique(); } ScopedPPVar VarFromValueArray(const base::Value* value) { -#if !defined(EWK_BRINGUP) - LOG(ERROR) << " Remove EWK_BRINGUP "; if (!value) return ScopedPPVar(); if (value->type() == base::Value::Type::LIST) { scoped_refptr ret(new ArrayVar); - const base::ListValue* list = static_cast(value); - size_t size = list->GetList().size(); + const base::Value::List* list = value->GetIfList(); + size_t size = list->size(); ret->SetLength(size); for (size_t i = 0; i < size; ++i) { const base::Value* val; - val = const_cast(&(list->GetList().operator[](i))); + val = const_cast(&(list->operator[](i))); ScopedPPVar var = VarFromValue(val); ret->Set(i, var.get()); } return ScopedPPVar(ScopedPPVar::PassRef(), ret->GetPPVar()); } -#endif return ScopedPPVar(); } ScopedPPVar VarFromValueDictionary(const base::Value* value) { -#if !defined(EWK_BRINGUP) - LOG(ERROR) << " Remove EWK_BRINGUP "; if (!value) return ScopedPPVar(); - if (value->type() == base::Value::Type::DICTIONARY) { + if (value->type() == base::Value::Type::DICT) { scoped_refptr ret(new DictionaryVar); - const base::DictionaryValue* dict; - value->GetAsDictionary(&dict); - base::detail::const_dict_iterator it = dict->DictItems().begin(); - while (it!=dict->DictItems().end()) { + const base::Value::Dict* dict = value->GetIfDict(); + base::detail::const_dict_iterator it = dict->begin(); + while (it!=dict->end()) { ScopedPPVar var_k(ScopedPPVar::PassRef(), StringVar::StringToPPVar(it->first)); ScopedPPVar var_v = VarFromValue(&(it->second)); @@ -116,15 +104,12 @@ ScopedPPVar VarFromValueDictionary(const base::Value* value) { } return ScopedPPVar(ScopedPPVar::PassRef(), ret->GetPPVar()); } -#endif return ScopedPPVar(); } } // namespace std::unique_ptr ValueFromVar(const PP_Var& var) { -#if !defined(EWK_BRINGUP) - LOG(ERROR) << " Remove EWK_BRINGUP "; switch (var.type) { case PP_VARTYPE_BOOL: return std::make_unique(PP_ToBool(var.value.as_bool)); @@ -145,13 +130,10 @@ std::unique_ptr ValueFromVar(const PP_Var& var) { default: return std::make_unique(); } -#endif return std::make_unique(); } ScopedPPVar VarFromValue(const base::Value* value) { -#if !defined(EWK_BRINGUP) - LOG(ERROR) << " Remove EWK_BRINGUP "; if (!value) return ScopedPPVar(); @@ -174,12 +156,11 @@ ScopedPPVar VarFromValue(const base::Value* value) { } case base::Value::Type::LIST: return VarFromValueArray(value); - case base::Value::Type::DICTIONARY: + case base::Value::Type::DICT: return VarFromValueDictionary(value); default: return ScopedPPVar(); } -#endif return ScopedPPVar(); } diff --git a/tizen_src/build/gn_chromiumefl.sh b/tizen_src/build/gn_chromiumefl.sh index ec70017..bc8e429 100755 --- a/tizen_src/build/gn_chromiumefl.sh +++ b/tizen_src/build/gn_chromiumefl.sh @@ -122,7 +122,6 @@ COMMON_GN_PARAMETERS="use_libjpeg_turbo=true use_cups=false depth=\"${TOPDIR}\" use_libpci=false - enable_ppapi=false " add_desktop_flags() { @@ -255,7 +254,7 @@ add_tizen_flags() { " if [ "$tizen_product_tv" == "true" ]; then - ADDITIONAL_GN_PARAMETERS+="tizen_pepper_extensions=false + ADDITIONAL_GN_PARAMETERS+="tizen_pepper_extensions=true " fi diff --git a/tizen_src/ewk/efl_integration/common/trusted_pepper_plugin_info_cache.cc b/tizen_src/ewk/efl_integration/common/trusted_pepper_plugin_info_cache.cc index 08986db..8a30865 100644 --- a/tizen_src/ewk/efl_integration/common/trusted_pepper_plugin_info_cache.cc +++ b/tizen_src/ewk/efl_integration/common/trusted_pepper_plugin_info_cache.cc @@ -72,10 +72,10 @@ const char kPepperManifestMimesExtensionsKey[] = "extensions"; using Hash = std::hash; using FilesContainer = std::unordered_set; -bool GetStringValue(const base::DictionaryValue* dict, +bool GetStringValue(const base::Value::Dict* dict, const std::string& key, std::string* out_value) { - const std::string* val = dict->FindStringPath(key); + const std::string* val = dict->FindStringByDottedPath(key); if (nullptr != val && !val->empty()) { *out_value = *val; return true; @@ -84,10 +84,10 @@ bool GetStringValue(const base::DictionaryValue* dict, return false; } -bool GetStringValue(const base::ListValue* list, +bool GetStringValue(const base::Value::List* list, size_t i, std::string* out_value) { - std::string val = list->GetList().operator[](i).GetString(); + std::string val = list->operator[](i).GetString(); if (!val.empty()) { *out_value = val; return true; @@ -96,49 +96,36 @@ bool GetStringValue(const base::ListValue* list, return false; } -bool GetListValue(const base::DictionaryValue* dict, - const std::string& key, - const base::ListValue** out_value) { - const base::ListValue* val = static_cast(dict->FindListKey(key)); - if (val) { - *out_value = val; - return true; - } +const base::Value::List* GetListValue(const base::Value::Dict* dict, + const std::string& key) { + const base::Value::List* val = dict->FindList(key); - return false; + return val ? val : nullptr; } -bool GetDictionaryValue(const base::DictionaryValue* dict, - const std::string& key, - const base::DictionaryValue** out_value) { - const base::DictionaryValue* val = static_cast(dict->FindDictKey(key)); - if (val) { - *out_value = val; - return true; - } +const base::Value::Dict* GetDictionaryValue(const base::Value::Dict* dict, + const std::string& key) { + const base::Value::Dict* val = dict->FindDict(key); - return false; + return val ? val : nullptr; } -bool GetDictionaryValue(const base::ListValue* list, - size_t i, - const base::DictionaryValue** out_value) { - const base::Value* val; - val = const_cast(&(list->GetList().operator[](i))); - +const base::Value::Dict* GetDictionaryValue(const base::Value::List* list, + size_t i) { + const base::Value* val = const_cast(&(list->operator[](i))); + if(val && val->is_dict()) { - *out_value = static_cast(val); - return true; + return val->GetIfDict(); } - return false; + return nullptr; } -void GetMimeTypeExtensions(const base::DictionaryValue* dict, +void GetMimeTypeExtensions(const base::Value::Dict* dict, std::vector* out_exensions) { - const base::ListValue* list; + const base::Value::List* list = GetListValue(dict, kPepperManifestMimesExtensionsKey); std::string val; - if (GetListValue(dict, kPepperManifestMimesExtensionsKey, &list)) { - size_t size = list->GetList().size(); + if (list) { + size_t size = list->size(); for (size_t i = 0; i < size; ++i) if (GetStringValue(list, i, &val)) out_exensions->push_back(val); @@ -148,15 +135,15 @@ void GetMimeTypeExtensions(const base::DictionaryValue* dict, } bool GetWebPluginMimeType(const FilePath& pmf, - const base::ListValue* mimes, + const base::Value::List* mimes, size_t i, WebPluginMimeType* plugin_mime) { std::string type; std::string description; std::vector extensions; - const base::DictionaryValue* dict = nullptr; - if (GetDictionaryValue(mimes, i, &dict)) { + const base::Value::Dict* dict = GetDictionaryValue(mimes, i); + if (dict) { // "type" : (mandatory) if (!GetStringValue(dict, kPepperManifestMimesTypeKey, &type)) { PARSING_ERROR(pmf) << "MIME type attribute not found"; @@ -180,14 +167,10 @@ bool GetWebPluginMimeType(const FilePath& pmf, } bool GetPuginMimeTypes(const FilePath& pmf, - const base::ListValue* mimes_list, + const base::Value::List* mimes_list, std::vector* mime_types) { - if (mimes_list->type() != base::Value::Type::LIST) { - PARSING_ERROR(pmf) << "The mimes must be a list"; - return false; - } - size_t size = mimes_list->GetList().size(); + size_t size = mimes_list->size(); for (size_t i = 0; i < size; ++i) { WebPluginMimeType mime_type; if (GetWebPluginMimeType(pmf, mimes_list, i, &mime_type)) @@ -198,11 +181,11 @@ bool GetPuginMimeTypes(const FilePath& pmf, } bool ReadPluginMimeTypes(const FilePath& pmf, - const base::DictionaryValue* dict, + const base::Value::Dict* dict, ContentPluginInfo* info) { // Get the MIME types. - const base::ListValue* mimes_list = nullptr; - if (!GetListValue(dict, kPepperManifestMimesKey, &mimes_list)) { + const base::Value::List* mimes_list = GetListValue(dict, kPepperManifestMimesKey); + if (!mimes_list) { PARSING_ERROR(pmf) << "Can't read the MIME types list"; return false; } @@ -223,15 +206,15 @@ bool ReadPluginMimeTypes(const FilePath& pmf, } bool ReadPluginPath(const FilePath& pmf, - const base::DictionaryValue* dict, + const base::Value::Dict* dict, ContentPluginInfo* info) { // Path to the plugin. The url attribute has higher priority // than the manifest name. - const base::DictionaryValue* program_dict; - if (!GetDictionaryValue(dict, kPepperManifestProgramKey, &program_dict)) { - auto key = dict->FindKey(kPepperManifestProgramKey); - bool has_key = (key != nullptr ? true:false); - + const base::Value::Dict* program_dict = GetDictionaryValue(dict, kPepperManifestProgramKey); + if (!program_dict) { + auto key = dict->Find(kPepperManifestProgramKey); + bool has_key = (key != nullptr ? true:false); + if (has_key) { PARSING_ERROR(pmf) << "invalid \"program\" key present:" << " not a dictionary"; @@ -261,7 +244,7 @@ bool ReadPluginPath(const FilePath& pmf, } bool ValidatePluginType(const FilePath& pmf, - const base::DictionaryValue* dict) { + const base::Value::Dict* dict) { std::string val; if (!GetStringValue(dict, kPepperManifestTypeKey, &val)) { PARSING_ERROR(pmf) << "No type attribute in the PMF file"; @@ -437,45 +420,46 @@ void TrustedPepperPluginInfoCache::MaybeUpdateRw() { return; } - base::Value* dict = root->FindDictKey("forceupdate_webapi"); + base::Value::Dict* dict = root->GetDict().FindDict("forceupdate_webapi"); if (!dict) { LOG(ERROR) << "readJsonFile, no obj under key forceupdate_webapi"; return; } - base::Value* list = dict->FindListKey("pepper"); + base::Value::List* list = dict->FindList("pepper"); if (!list) { LOG(ERROR) << "readJsonFile, no list under key pepper"; return; } - for (base::Value& plugin : list->GetList()) { - if (!plugin.is_dict()) + for (auto& plugin : *list) { + auto* plugin_dict = plugin.GetIfDict(); + if (!plugin_dict) continue; - std::string* dir = plugin.FindStringKey("path"); - std::string* dir_sys = plugin.FindStringKey("systempath"); - if (dir_sys && plugin.FindBoolKey("system").value_or(false)) + std::string* dir = plugin_dict->FindString("path"); + std::string* dir_sys = plugin_dict->FindString("systempath"); + if (dir_sys && plugin_dict->FindBool("system").value_or(false)) AddPluginsFromDirectory(*dir_sys, kSRO); if (!dir || (dir_sys && (dir->compare(*dir_sys) == 0))) // no rw installed. rw path IS sro path continue; - bool force = plugin.FindBoolKey("forceupdate").value_or(false); + bool force = plugin_dict->FindBool("forceupdate").value_or(false); if (AddPluginsFromDirectory(*dir, kRW) && force) judge_map_.insert({*dir, true}); } - dict = root->FindDictPath("upgradable_webapi_applist.pepper"); + dict = root->GetDict().FindDict("upgradable_webapi_applist.pepper"); if (!dict) { LOG(ERROR) << "readJsonFile, no obj under key upgradable_webapi_applist.pepper"; return; } - for (auto kv : dict->DictItems()) { + for (auto kv : *dict) { base::Value& tpk_list = kv.second; if (!tpk_list.is_list()) continue; - for (base::Value& tpk : tpk_list.GetList()) { + for (auto& tpk : tpk_list.GetList()) { if (!tpk.is_dict()) continue; - std::string* dir = tpk.FindStringKey("path"); + std::string* dir = tpk.GetDict().FindString("path"); if (!dir) continue; if (!judge_map_.count(*dir)) { @@ -540,11 +524,12 @@ bool ParsePepperPluginManifest(const FilePath& pmf, return false; } - base::DictionaryValue* dict = 0; - if (!root.value().GetAsDictionary(&dict) || !dict) { + if (!root.value().is_dict()) { PARSING_ERROR(pmf) << "Can't to get the root node as an object."; return false; } + const base::Value::Dict* dict = root.value().GetIfDict(); + if (!ValidatePluginType(pmf, dict)) return false; diff --git a/tizen_src/ewk/efl_integration/ewk_extension_system_delegate.cc b/tizen_src/ewk/efl_integration/ewk_extension_system_delegate.cc index f5fae93..5fd389d 100644 --- a/tizen_src/ewk/efl_integration/ewk_extension_system_delegate.cc +++ b/tizen_src/ewk/efl_integration/ewk_extension_system_delegate.cc @@ -172,9 +172,9 @@ std::unique_ptr EwkExtensionSystemDelegate::GetExtensionInfo() base::AutoLock guard{access_lock_}; if (!info_) return std::make_unique(); - return static_cast(info_) - ->GetValue() - ->CreateDeepCopy(); + base::Value* value = static_cast(info_) + ->GetValue(); + return std::make_unique(value->Clone()); } int EwkExtensionSystemDelegate::GetWindowId() const { @@ -189,14 +189,14 @@ std::unique_ptr EwkExtensionSystemDelegate::GenericSyncCall( return std::make_unique(); Ewk_Value arg = static_cast( - new EwkValuePrivate(data.CreateDeepCopy())); + new EwkValuePrivate(std::make_unique(data.Clone()))); ewk_value_ref(arg); Ewk_Value result = cb_(name.c_str(), arg, cb_data_); ewk_value_unref(arg); if (!result) return std::make_unique(); - std::unique_ptr ret = - static_cast(result)->GetValue()->CreateDeepCopy(); + base::Value* value = static_cast(result)->GetValue(); + std::unique_ptr ret = std::make_unique(value->Clone()); ewk_value_unref(result); return ret; } diff --git a/tizen_src/ewk/efl_integration/public/ewk_value.cc b/tizen_src/ewk/efl_integration/public/ewk_value.cc index fb025b2..f53853c 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_value.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_value.cc @@ -125,7 +125,7 @@ Eina_Stringshare* ewk_value_string_value_get(Ewk_Value value) { Ewk_Value ewk_value_array_new() { Ewk_Value val = static_cast( - new EwkValuePrivate(std::unique_ptr(new base::ListValue()))); + new EwkValuePrivate(std::unique_ptr(new base::Value(base::Value::Type::LIST)))); return ewk_value_ref(val); } @@ -142,12 +142,12 @@ Eina_Bool ewk_value_array_is_mutable(Ewk_Value array) { Eina_Bool ewk_value_array_append(Ewk_Value array, Ewk_Value value) { EINA_SAFETY_ON_FALSE_RETURN_VAL(ewk_value_array_is_mutable(array), EINA_FALSE); - base::ListValue* list; + base::Value::List* list; bool result = EwkValueCast(array)->GetValue()->is_list(); if (result) { // TODO(m.majczak) consider a workaround for the deep copy - base::ListValue* list = static_cast(EwkValueCast(array)->GetValue()); - list->Append(std::move(*(EwkValueCast(value)->GetValue()->CreateDeepCopy()))); + base::Value::List* list = EwkValueCast(array)->GetValue()->GetIfList(); + list->Append(std::move(*(std::make_unique(EwkValueCast(value)->GetValue()->Clone()))));; return EINA_TRUE; } else { return EINA_FALSE; @@ -156,11 +156,11 @@ Eina_Bool ewk_value_array_append(Ewk_Value array, Ewk_Value value) { size_t ewk_value_array_count(Ewk_Value array) { EWK_VALUE_TYPE_CHECK_RETURN_VAL(array, ewk_value_array_type_get(), 0); - base::ListValue* list; + base::Value::List* list; bool result = EwkValueCast(array)->GetValue()->is_list(); if (result) { - list = static_cast(EwkValueCast(array)->GetValue()); - return list->GetList().size(); + list = static_cast(EwkValueCast(array)->GetValue()->GetIfList()); + return list->size(); } else { return 0; } @@ -172,17 +172,17 @@ Eina_Bool ewk_value_array_get(Ewk_Value array, EINA_SAFETY_ON_FALSE_RETURN_VAL(position < ewk_value_array_count(array), EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(dst, EINA_FALSE); - base::ListValue* list; + base::Value::List* list; bool result = EwkValueCast(array)->GetValue()->is_list(); if (result) { // TODO(m.majczak) consider a workaround for the deep copy - list = static_cast(EwkValueCast(array)->GetValue()); + list = EwkValueCast(array)->GetValue()->GetIfList(); base::Value* val = nullptr; - val = &(list->GetList().operator[](position)); + val = &(list->operator[](position)); if (!val) return EINA_FALSE; Ewk_Value ret = static_cast( - new EwkValuePrivate(std::unique_ptr(val->CreateDeepCopy()))); + new EwkValuePrivate(std::unique_ptr(std::make_unique(val->Clone())))); // warning!!! the ownership is passed to the caller here ewk_value_ref(ret); *dst = ret; @@ -213,12 +213,12 @@ Eina_Bool ewk_value_array_remove(Ewk_Value array, size_t position) { Ewk_Value ewk_value_dictionary_new() { Ewk_Value val = static_cast(new EwkValuePrivate( - std::unique_ptr(new base::DictionaryValue()))); + std::unique_ptr(new base::Value(base::Value::Type::DICT)))); return ewk_value_ref(val); } Ewk_Value_Type ewk_value_dictionary_type_get() { - return static_cast(base::Value::Type::DICTIONARY); + return static_cast(base::Value::Type::DICT); } Eina_Bool ewk_value_dictionary_is_mutable(Ewk_Value dictionary) { @@ -232,12 +232,11 @@ Eina_Bool ewk_value_dictionary_keys(Ewk_Value dictionary, Ewk_Value* keys) { EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(keys, EINA_FALSE); // warning!!! This is very expensive operation. - base::DictionaryValue* dict; - bool result = EwkValueCast(dictionary)->GetValue()->GetAsDictionary(&dict); - if (result) { + base::Value::Dict* dict = EwkValueCast(dictionary)->GetValue()->GetIfDict(); + if (dict) { *keys = ewk_value_array_new(); - base::detail::dict_iterator it = dict->DictItems().begin(); - while (it!=dict->DictItems().end()) { + base::detail::dict_iterator it = dict->begin(); + while (it!=dict->end()) { Ewk_Value str = ewk_value_string_new(it->first.c_str()); ewk_value_array_append(*keys, str); ewk_value_unref(str); @@ -256,18 +255,18 @@ Eina_Bool ewk_value_dictionary_set(Ewk_Value dictionary, EINA_SAFETY_ON_FALSE_RETURN_VAL(ewk_value_dictionary_is_mutable(dictionary), EINA_FALSE); EWK_VALUE_TYPE_CHECK_RETURN_VAL(key, ewk_value_string_type_get(), EINA_FALSE); - base::DictionaryValue* dict; + base::Value::Dict* dict; std::string k; bool result1 = EwkValueCast(dictionary)->GetValue()->is_dict(); bool result2 = EwkValueCast(key)->GetValue()->is_string(); if (result1 && result2) { - dict = static_cast(EwkValueCast(dictionary)->GetValue()); - k = *(EwkValueCast(key)->GetValue()->GetIfString()); + dict = EwkValueCast(dictionary)->GetValue()->GetIfDict(); + k = *(EwkValueCast(key)->GetValue()->GetIfString()); // TODO(m.majczak) consider a workaround for the deep copy - auto val = dict->FindKey(k); - auto haskey = (val != nullptr)?true:false; + auto val = dict->Find(k); + auto haskey = (val != nullptr)?true:false; *new_entry = Eina_FromBool(!haskey); - dict->Set(k, EwkValueCast(value)->GetValue()->CreateDeepCopy()); + dict->Set(k, EwkValueCast(value)->GetValue()->Clone()); return EINA_TRUE; } else { return EINA_FALSE; @@ -281,18 +280,17 @@ Eina_Bool ewk_value_dictionary_add(Ewk_Value dictionary, EINA_SAFETY_ON_FALSE_RETURN_VAL(ewk_value_dictionary_is_mutable(dictionary), EINA_FALSE); EWK_VALUE_TYPE_CHECK_RETURN_VAL(key, ewk_value_string_type_get(), EINA_FALSE); - base::DictionaryValue* dict; + base::Value::Dict* dict = EwkValueCast(dictionary)->GetValue()->GetIfDict(); std::string k; - bool result1 = EwkValueCast(dictionary)->GetValue()->GetAsDictionary(&dict); bool result2 = EwkValueCast(key)->GetValue()->is_string(); - if (result1 && result2) { - k = *(EwkValueCast(key)->GetValue()->GetIfString()); - auto val = dict->FindKey(k); - auto haskey = (val != nullptr)?true:false; + if (dict && result2) { + k = *(EwkValueCast(key)->GetValue()->GetIfString()); + auto val = dict->Find(k); + auto haskey = (val != nullptr)?true:false; if (!haskey) { *new_entry = EINA_TRUE; // TODO(m.majczak) consider a workaround for the deep copy - dict->Set(k, EwkValueCast(value)->GetValue()->CreateDeepCopy()); + dict->Set(k, EwkValueCast(value)->GetValue()->Clone()); return EINA_TRUE; } *new_entry = EINA_FALSE; @@ -309,19 +307,17 @@ Eina_Bool ewk_value_dictionary_get(Ewk_Value dictionary, EINA_FALSE); EWK_VALUE_TYPE_CHECK_RETURN_VAL(key, ewk_value_string_type_get(), EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(dst, EINA_FALSE); - base::DictionaryValue* dict; + base::Value::Dict* dict = EwkValueCast(dictionary)->GetValue()->GetIfDict(); std::string k; - bool result1 = EwkValueCast(dictionary)->GetValue()->GetAsDictionary(&dict); bool result2 = EwkValueCast(key)->GetValue()->is_string(); - if (result1 && result2) { - k = *(EwkValueCast(key)->GetValue()->GetIfString()); - base::Value* val = nullptr; - dict->Get(k, &val); + if (dict && result2) { + k = *(EwkValueCast(key)->GetValue()->GetIfString()); + base::Value* val = dict->FindByDottedPath(k); if (!val) return EINA_FALSE; // TODO(m.majczak) consider a workaround for the deep copy Ewk_Value ret = static_cast( - new EwkValuePrivate(std::unique_ptr(val->CreateDeepCopy()))); + new EwkValuePrivate(std::unique_ptr(std::make_unique(val->Clone())))); // warning!!! the ownership is passed to the caller here ewk_value_ref(ret); *dst = ret; @@ -335,14 +331,13 @@ Eina_Bool ewk_value_dictionary_remove(Ewk_Value dictionary, Ewk_Value key) { EINA_SAFETY_ON_FALSE_RETURN_VAL(ewk_value_dictionary_is_mutable(dictionary), EINA_FALSE); EWK_VALUE_TYPE_CHECK_RETURN_VAL(key, ewk_value_string_type_get(), EINA_FALSE); - base::DictionaryValue* dict; + base::Value::Dict* dict = EwkValueCast(dictionary)->GetValue()->GetIfDict(); std::string k; - bool result1 = EwkValueCast(dictionary)->GetValue()->GetAsDictionary(&dict); bool result2 = EwkValueCast(key)->GetValue()->is_string(); - if (result1 && result2) { - k = *(EwkValueCast(key)->GetValue()->GetIfString()); + if (dict && result2) { + k = *(EwkValueCast(key)->GetValue()->GetIfString()); // warning!!! value is completely deleted here - return Eina_FromBool(dict->RemoveKey(k)); + return Eina_FromBool(dict->Remove(k)); } else { return EINA_FALSE; } -- 2.7.4 From e27d7df7ea997d304b29a0512768088cc426b016 Mon Sep 17 00:00:00 2001 From: "zhishun.zhou" Date: Wed, 27 Mar 2024 18:04:40 +0800 Subject: [PATCH 09/16] [M120 Migration][SVACE] Check stream before using Several issues reported crash as null check missing Add stream check before using Patch from: https://review.tizen.org/gerrit/#/c/301574/ Change-Id: I83328ff8bc530b15cd43aaa41ac477c553132bec Signed-off-by: yanqing.lu --- media/filters/decrypting_demuxer_stream.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/media/filters/decrypting_demuxer_stream.cc b/media/filters/decrypting_demuxer_stream.cc index 493b17e..14ab249 100644 --- a/media/filters/decrypting_demuxer_stream.cc +++ b/media/filters/decrypting_demuxer_stream.cc @@ -423,6 +423,11 @@ void DecryptingDemuxerStream::DoReset() { } Decryptor::StreamType DecryptingDemuxerStream::GetDecryptorStreamType() const { + if (!demuxer_stream_) { + LOG(INFO) << "demuxer_stream is nullptr!"; + return Decryptor::kStreamTypeMax; + } + if (demuxer_stream_->type() == AUDIO) return Decryptor::kAudio; -- 2.7.4 From 3e3b4ac7d6495642438c11a719f71f5951251cd4 Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Wed, 27 Mar 2024 11:00:32 +0900 Subject: [PATCH 10/16] [WRTjs][VD] Refactors to reduce IS_TIZEN_TV flag Seperates WRTBrowserContextTV class to reduce IS_TIZEN_TV flag Change-Id: I5a45a309541bebe7f6ce84e3d04066c3dc844ea6 Signed-off-by: DongHyun Song --- wrt/filenames.gni | 2 ++ wrt/src/browser/tv/wrt_browser_context_tv.cc | 20 +++++++++++++++++ wrt/src/browser/tv/wrt_browser_context_tv.h | 32 ++++++++++++++++++++++++++++ wrt/src/browser/wrt_browser_context.cc | 25 ++++++++++------------ wrt/src/browser/wrt_browser_context.h | 12 ++--------- 5 files changed, 67 insertions(+), 24 deletions(-) create mode 100644 wrt/src/browser/tv/wrt_browser_context_tv.cc create mode 100644 wrt/src/browser/tv/wrt_browser_context_tv.h diff --git a/wrt/filenames.gni b/wrt/filenames.gni index a08c7bb..4fbf198 100644 --- a/wrt/filenames.gni +++ b/wrt/filenames.gni @@ -210,6 +210,8 @@ wrt_lib_sources_tv = [ "src/browser/tv/widget_state.h", "src/browser/tv/wrt_browser_client_tv.cc", "src/browser/tv/wrt_browser_client_tv.h", + "src/browser/tv/wrt_browser_context_tv.cc", + "src/browser/tv/wrt_browser_context_tv.h", "src/browser/tv/wrt_native_window_tv.cc", "src/browser/tv/wrt_native_window_tv.h", "src/browser/tv/wrt_xwalk_extension_browser_tv.cc", diff --git a/wrt/src/browser/tv/wrt_browser_context_tv.cc b/wrt/src/browser/tv/wrt_browser_context_tv.cc new file mode 100644 index 0000000..52804a5 --- /dev/null +++ b/wrt/src/browser/tv/wrt_browser_context_tv.cc @@ -0,0 +1,20 @@ +// Copyright 2024 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 "wrt/src/browser/tv/wrt_browser_context_tv.h" + +namespace wrt { + +WRTBrowserContextTV::WRTBrowserContextTV( + const electron::PartitionOrPath partition_location, + bool in_memory, + base::Value::Dict options) + : WRTBrowserContext(partition_location, in_memory, std::move(options)), + web_cache_manager_(this) {} + +void WRTBrowserContextTV::ClearWebCache() { + web_cache_manager_.ClearCache(); +} + +} // namespace wrt diff --git a/wrt/src/browser/tv/wrt_browser_context_tv.h b/wrt/src/browser/tv/wrt_browser_context_tv.h new file mode 100644 index 0000000..f3015fe --- /dev/null +++ b/wrt/src/browser/tv/wrt_browser_context_tv.h @@ -0,0 +1,32 @@ +// Copyright 2024 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 BROWSER_WRT_BROWSER_CONTEXT_TV_H_ +#define BROWSER_WRT_BROWSER_CONTEXT_TV_H_ + +#include "wrt/src/browser/wrt_browser_context.h" + +#include "tizen_src/ewk/efl_integration/browser/web_cache_efl/web_cache_manager_efl.h" + +namespace wrt { + +class WRTBrowserContextTV : public WRTBrowserContext { + public: + WRTBrowserContextTV(const electron::PartitionOrPath partition_location, + bool in_memory, + base::Value::Dict options); + virtual ~WRTBrowserContextTV() override = default; + + WRTBrowserContextTV(const WRTBrowserContextTV&) = delete; + WRTBrowserContextTV& operator=(const WRTBrowserContextTV&) = delete; + + private: + void ClearWebCache() override; + + WebCacheManagerEfl web_cache_manager_; +}; + +} // namespace wrt + +#endif // BROWSER_WRT_BROWSER_CONTEXT_TV_H_ diff --git a/wrt/src/browser/wrt_browser_context.cc b/wrt/src/browser/wrt_browser_context.cc index 5f894fa..fc2955b 100755 --- a/wrt/src/browser/wrt_browser_context.cc +++ b/wrt/src/browser/wrt_browser_context.cc @@ -14,6 +14,14 @@ #include "wrt/src/browser/wrt_special_storage_policy.h" #include "wrt/src/common/application_data.h" +#if BUILDFLAG(IS_TIZEN_TV) +#include "wrt/src/browser/tv/wrt_browser_context_tv.h" + +using WRTBrowserContextType = wrt::WRTBrowserContextTV; +#else +using WRTBrowserContextType = wrt::WRTBrowserContext; +#endif + namespace { std::vector> @@ -36,12 +44,7 @@ WRTBrowserContext::WRTBrowserContext( bool in_memory, base::Value::Dict options) : electron::ElectronBrowserContext( - partition_location, in_memory, std::move(options)) -#if BUILDFLAG(IS_TIZEN_TV) - , - web_cache_manager_(this) -#endif -{ + partition_location, in_memory, std::move(options)) { SetUserAgent(EflWebView::VersionInfo::GetInstance()->DefaultUserAgent()); InitVisitedLinkWriter(); @@ -116,12 +119,6 @@ void WRTBrowserContext::DeleteCookies() { base::BindOnce([](uint32_t num_deleted) {})); } -#if BUILDFLAG(IS_TIZEN_TV) -void WRTBrowserContext::ClearWebCache() { - web_cache_manager_.ClearCache(); -} -#endif - } // namespace wrt namespace electron { @@ -136,7 +133,7 @@ ElectronBrowserContext* ElectronBrowserContext::From( if (browser_context) return browser_context; - auto* new_context = new wrt::WRTBrowserContext( + auto* new_context = new WRTBrowserContextType( std::cref(partition), in_memory, std::move(options)); browser_context_map()[key] = std::unique_ptr(new_context); @@ -154,7 +151,7 @@ ElectronBrowserContext* ElectronBrowserContext::FromPath( } auto* new_context = - new wrt::WRTBrowserContext(std::cref(path), false, std::move(options)); + new WRTBrowserContextType(std::cref(path), false, std::move(options)); browser_context_map()[key] = std::unique_ptr(new_context); return new_context; diff --git a/wrt/src/browser/wrt_browser_context.h b/wrt/src/browser/wrt_browser_context.h index 62ff83d..83be4b7 100755 --- a/wrt/src/browser/wrt_browser_context.h +++ b/wrt/src/browser/wrt_browser_context.h @@ -11,10 +11,6 @@ #include "electron/shell/browser/electron_browser_context.h" #include "extensions/buildflags/buildflags.h" -#if BUILDFLAG(IS_TIZEN_TV) -#include "tizen_src/ewk/efl_integration/browser/web_cache_efl/web_cache_manager_efl.h" -#endif - namespace visitedlink { class VisitedLinkWriter; } @@ -43,9 +39,8 @@ class WRTBrowserContext : public electron::ElectronBrowserContext, WRTSpecialStoragePolicy* GetWRTSpecialStoragePolicy(); -#if BUILDFLAG(IS_TIZEN_TV) - void ClearWebCache(); -#endif + // product specific features + virtual void ClearWebCache() {} private: // visitedlink::VisitedLinkDelegate implementation. @@ -59,9 +54,6 @@ class WRTBrowserContext : public electron::ElectronBrowserContext, scoped_refptr wrt_special_storage_policy_; std::unique_ptr background_sync_controller_; -#if BUILDFLAG(IS_TIZEN_TV) - WebCacheManagerEfl web_cache_manager_; -#endif }; } // namespace wrt -- 2.7.4 From 68436ad99ea19d5477112f9872c79e2a477b09b3 Mon Sep 17 00:00:00 2001 From: fang fengrong Date: Tue, 19 Mar 2024 16:50:47 +0800 Subject: [PATCH 11/16] [M120 Migration]URL of _Ewk_Error set wrong The url should be set as the third parameter of _Ewk_Error constructor. refer: https://review.tizen.org/gerrit/#/c/297326 Change-Id: Ic0ebe2a005083749afc4e28defd6d51e2cc7e59d Signed-off-by: fang fengrong --- .../ewk/efl_integration/browser/navigation_throttle_efl.cc | 2 +- tizen_src/ewk/efl_integration/eweb_view.cc | 12 +++++------- tizen_src/ewk/efl_integration/eweb_view.h | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/tizen_src/ewk/efl_integration/browser/navigation_throttle_efl.cc b/tizen_src/ewk/efl_integration/browser/navigation_throttle_efl.cc index c571c81..a6da944 100644 --- a/tizen_src/ewk/efl_integration/browser/navigation_throttle_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/navigation_throttle_efl.cc @@ -72,7 +72,7 @@ NavigationThrottleEfl::WillFailRequest() { // from app side. if (web_view->IsLoadErrorPageCallbackSet()) { const char* error_page = web_view->InvokeViewLoadErrorPageCallback( - handle->GetURL(), error_code, "ERR_ABORTED"); + handle->GetURL(), error_code, error_code == net::ERR_ABORTED); if (error_page) { LOG(ERROR) << "Already get customer error page"; // Currently return result with action NavigationThrottle::CANCEL, error diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc index ef84a2c..ec314f1 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.cc +++ b/tizen_src/ewk/efl_integration/eweb_view.cc @@ -1331,13 +1331,11 @@ void EWebView::SetViewLoadErrorPageCallback( } // Remove below code while ewk_error_cancellation_get has been implemented. -const char* EWebView::InvokeViewLoadErrorPageCallback( - const GURL& url, - int error_code, - const std::string& error_description) { - std::unique_ptr<_Ewk_Error> err( - new _Ewk_Error(error_code, url.possibly_invalid_spec().c_str(), - error_description.c_str())); +const char* EWebView::InvokeViewLoadErrorPageCallback(const GURL& url, + int error_code, + bool is_cancellation) { + std::unique_ptr<_Ewk_Error> err(new _Ewk_Error( + error_code, is_cancellation, url.possibly_invalid_spec().c_str())); _Ewk_Error_Page error_page; LOG(INFO) << "EWebView::InvokeLoadErrorPageCallback url: " diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h index 040fc89..08fc8e7 100644 --- a/tizen_src/ewk/efl_integration/eweb_view.h +++ b/tizen_src/ewk/efl_integration/eweb_view.h @@ -575,10 +575,9 @@ class EWebView { void SetViewLoadErrorPageCallback(Ewk_View_Error_Page_Load_Callback callback, void* user_data); - const char* InvokeViewLoadErrorPageCallback( - const GURL& url, - int error_code, - const std::string& error_description); + const char* InvokeViewLoadErrorPageCallback(const GURL& url, + int error_code, + bool is_cancellation); bool IsLoadErrorPageCallbackSet() const; void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback, void* user_data); -- 2.7.4 From 1620e65e28f2046f3abaeee899415f6bbd8e5591 Mon Sep 17 00:00:00 2001 From: Chandan Padhi Date: Wed, 27 Mar 2024 19:44:47 +0530 Subject: [PATCH 12/16] fixup! [M120 Migration] Build libchromium-impl.so with chrome implementation This commit restores !build_chrome check that got removed in the parent patch to fix desktop chrome build errors. Change-Id: I474d226698695cd0a5b5e6d3193b114236b87e77 Signed-off-by: Chandan Padhi --- tizen_src/build/config/tizen_features.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tizen_src/build/config/tizen_features.gni b/tizen_src/build/config/tizen_features.gni index f98fd04..6a163d2 100644 --- a/tizen_src/build/config/tizen_features.gni +++ b/tizen_src/build/config/tizen_features.gni @@ -79,7 +79,7 @@ declare_args() { drm_mapi_aarch_64 = false } -if (use_efl) { +if (use_efl && !build_chrome) { tizen_autofill = true if (tizen_product_tv) { tizen_autofill_fw = true -- 2.7.4 From 8779a27d06bc5a146814076a26a72971117d7ff3 Mon Sep 17 00:00:00 2001 From: fang fengrong Date: Wed, 27 Mar 2024 11:14:36 +0800 Subject: [PATCH 13/16] [M120 Migration][VD] Implement InterceptRequestCancelCallback 1. Implement ewk_context_intercept_request_cancel_callback_set 2. Use scoped_refptr to manager lifecycle of _Ewk_Intercept_Request Reference: https://review.tizen.org/gerrit/#/c/291896 Change-Id: I8b28f6059723a4bb8d78f6b789f2ced4ec900ba4 Signed-off-by: fang fengrong --- .../network_service/proxying_url_loader_efl.cc | 35 ++++++++++++++- .../network_service/proxying_url_loader_efl.h | 21 ++++++--- .../proxying_url_loader_factory_efl.cc | 11 ++++- .../ewk/efl_integration/browser_context_efl.cc | 50 ++++++++++++++++++---- .../ewk/efl_integration/browser_context_efl.h | 14 ++++++ .../efl_integration/content_browser_client_efl.cc | 6 +++ tizen_src/ewk/efl_integration/eweb_context.cc | 14 ++++++ tizen_src/ewk/efl_integration/eweb_context.h | 4 ++ .../efl_integration/private/ewk_context_private.cc | 6 +++ .../efl_integration/private/ewk_context_private.h | 3 ++ .../private/ewk_intercept_request_private.cc | 12 +++--- .../private/ewk_intercept_request_private.h | 5 ++- .../ewk/efl_integration/public/ewk_context.cc | 5 +++ 13 files changed, 161 insertions(+), 25 deletions(-) diff --git a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.cc b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.cc index a8170da..d7d3d91 100644 --- a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.cc @@ -14,18 +14,33 @@ // static void ProxyingURLLoaderEfl::Create( - std::unique_ptr<_Ewk_Intercept_Request> intercept_request, + scoped_refptr<_Ewk_Intercept_Request> intercept_request, +#if BUILDFLAG(IS_TIZEN_TV) + content::BrowserContextEfl::ResourceContextEfl* resource_context_efl, +#endif mojo::PendingReceiver<::network::mojom::URLLoader> loader, mojo::PendingRemote client) { +#if BUILDFLAG(IS_TIZEN_TV) + auto* proxying_url_loader_efl = new ProxyingURLLoaderEfl( + std::move(intercept_request), resource_context_efl, std::move(loader), + std::move(client)); +#else auto* proxying_url_loader_efl = new ProxyingURLLoaderEfl( std::move(intercept_request), std::move(loader), std::move(client)); +#endif } ProxyingURLLoaderEfl::ProxyingURLLoaderEfl( - std::unique_ptr<_Ewk_Intercept_Request> intercept_request, + scoped_refptr<_Ewk_Intercept_Request> intercept_request, +#if BUILDFLAG(IS_TIZEN_TV) + content::BrowserContextEfl::ResourceContextEfl* resource_context_efl, +#endif mojo::PendingReceiver<::network::mojom::URLLoader> loader, mojo::PendingRemote client) : intercept_request_(std::move(intercept_request)), +#if BUILDFLAG(IS_TIZEN_TV) + resource_context_efl_(resource_context_efl), +#endif binding_(this), weak_ptr_factory_(this) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); @@ -38,6 +53,22 @@ ProxyingURLLoaderEfl::ProxyingURLLoaderEfl( client_.Bind(std::move(client)); } +ProxyingURLLoaderEfl::~ProxyingURLLoaderEfl() { +#if BUILDFLAG(IS_TIZEN_TV) + LOG(INFO) + << "Destroyed ProxyingURLLoaderEfl, and notified app intercept url: " + << intercept_request_->request_url_get() + << ", resource_context_efl_: " << resource_context_efl_ + << ", intercept_request_: " << intercept_request_.get(); + if (resource_context_efl_ && + resource_context_efl_->HasInterceptRequestCancelCallback()) { + resource_context_efl_->RunInterceptRequestCancelCallback( + intercept_request_.get()); + } + intercept_request_->set_delegate(nullptr); +#endif +} + void ProxyingURLLoaderEfl::ResponseDecided() { mojo::ScopedDataPipeProducerHandle pipe_producer_handle; mojo::ScopedDataPipeConsumerHandle pipe_consumer_handle; diff --git a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.h b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.h index 50b79e9..206e5ee 100644 --- a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.h +++ b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_efl.h @@ -12,7 +12,9 @@ #include "mojo/public/cpp/system/data_pipe.h" #include "private/ewk_intercept_request_private.h" #include "services/network/public/mojom/url_loader.mojom.h" - +#if BUILDFLAG(IS_TIZEN_TV) +#include "browser_context_efl.h" +#endif namespace mojo { class SimpleWatcher; } @@ -25,11 +27,14 @@ class ProxyingURLLoaderEfl : public network::mojom::URLLoader, public _Ewk_Intercept_Request::Delegate { public: static void Create( - std::unique_ptr<_Ewk_Intercept_Request> intercept_request, + scoped_refptr<_Ewk_Intercept_Request> intercept_request, +#if BUILDFLAG(IS_TIZEN_TV) + content::BrowserContextEfl::ResourceContextEfl* resource_context_efl, +#endif mojo::PendingReceiver<::network::mojom::URLLoader> loader, mojo::PendingRemote client); - ~ProxyingURLLoaderEfl() override = default; + ~ProxyingURLLoaderEfl() override; private: // network::mojom::URLLoader: @@ -49,7 +54,10 @@ class ProxyingURLLoaderEfl : public network::mojom::URLLoader, void ChunkedReadDone() override; ProxyingURLLoaderEfl( - std::unique_ptr<_Ewk_Intercept_Request> intercept_request, + scoped_refptr<_Ewk_Intercept_Request> intercept_request, +#if BUILDFLAG(IS_TIZEN_TV) + content::BrowserContextEfl::ResourceContextEfl* resource_context_efl, +#endif mojo::PendingReceiver<::network::mojom::URLLoader> loader, mojo::PendingRemote client); @@ -64,7 +72,10 @@ class ProxyingURLLoaderEfl : public network::mojom::URLLoader, void OnConnectionError(); void MaybeDeleteSelf(); - std::unique_ptr<_Ewk_Intercept_Request> intercept_request_; + scoped_refptr<_Ewk_Intercept_Request> intercept_request_; +#if BUILDFLAG(IS_TIZEN_TV) + content::BrowserContextEfl::ResourceContextEfl* resource_context_efl_; +#endif mojo::Receiver binding_; mojo::Remote client_; diff --git a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc index cfc9226..29d537f 100644 --- a/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc +++ b/tizen_src/ewk/efl_integration/browser/network_service/proxying_url_loader_factory_efl.cc @@ -158,18 +158,25 @@ void ProxyingURLLoaderFactoryEfl::CreateLoaderAndStart( params.upload = upload_data_stream.get(); } - auto intercept_request = std::make_unique<_Ewk_Intercept_Request>(params); - resource_context_->RunInterceptRequestCallback(intercept_request.get()); + auto intercept_request = new _Ewk_Intercept_Request(params); + resource_context_->RunInterceptRequestCallback(intercept_request); intercept_request->callback_ended(); if (intercept_request->is_ignored()) { target_factory_->CreateLoaderAndStart(std::move(loader), request_id, options, request, std::move(client), traffic_annotation); + delete intercept_request; return; } +#if BUILDFLAG(IS_TIZEN_TV) + ProxyingURLLoaderEfl::Create(base::WrapRefCounted(intercept_request), + resource_context_, std::move(loader), + std::move(client)); +#else ProxyingURLLoaderEfl::Create(std::move(intercept_request), std::move(loader), std::move(client)); +#endif } void ProxyingURLLoaderFactoryEfl::Clone( diff --git a/tizen_src/ewk/efl_integration/browser_context_efl.cc b/tizen_src/ewk/efl_integration/browser_context_efl.cc index c58550c..cd51e48 100644 --- a/tizen_src/ewk/efl_integration/browser_context_efl.cc +++ b/tizen_src/ewk/efl_integration/browser_context_efl.cc @@ -67,6 +67,11 @@ void SendToAllRenderers(IPC::Message* message) { } #if BUILDFLAG(IS_TIZEN_TV) +// On TV product, the cancel callback must always be registered. +void DefaultCallback(Ewk_Context*, Ewk_Intercept_Request*, void*) { + NOTIMPLEMENTED(); +} + void FormatHour(long time, std::ostringstream& ost) { static const double kMinutesPerHour = 60.0; ost.width(2); @@ -119,7 +124,11 @@ static void CreateNetworkDelegateOnIOThread(BrowserContextEfl* context, BrowserContextEfl::ResourceContextEfl::ResourceContextEfl( scoped_refptr cookie_manager) : cookie_manager_(cookie_manager), - intercept_request_callback_{nullptr, nullptr, nullptr} {} +#if BUILDFLAG(IS_TIZEN_TV) + intercept_request_cancel_callback_{nullptr, DefaultCallback, nullptr}, +#endif + intercept_request_callback_{nullptr, nullptr, nullptr} { +} BrowserContextEfl::~BrowserContextEfl() { NotifyWillBeDestroyed(); @@ -144,24 +153,24 @@ bool BrowserContextEfl::ResourceContextEfl::HTTPCustomHeaderAdd( if (name.empty()) return false; - base::AutoLock locker(http_custom_headers_lock_); + base::AutoLock lock(http_custom_headers_lock_); return http_custom_headers_.insert(std::make_pair(name, value)).second; } bool BrowserContextEfl::ResourceContextEfl::HTTPCustomHeaderRemove( const std::string& name) { - base::AutoLock locker(http_custom_headers_lock_); + base::AutoLock lock(http_custom_headers_lock_); return http_custom_headers_.erase(name); } void BrowserContextEfl::ResourceContextEfl::HTTPCustomHeaderClear() { - base::AutoLock locker(http_custom_headers_lock_); + base::AutoLock lock(http_custom_headers_lock_); http_custom_headers_.clear(); } const HTTPCustomHeadersEflMap BrowserContextEfl::ResourceContextEfl::GetHTTPCustomHeadersEflMap() const { - base::AutoLock locker(http_custom_headers_lock_); + base::AutoLock lock(http_custom_headers_lock_); return http_custom_headers_; } @@ -170,24 +179,49 @@ void BrowserContextEfl::ResourceContextEfl::SetInterceptRequestCallback( Ewk_Context_Intercept_Request_Callback callback, void* user_data) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - base::AutoLock locker(intercept_request_callback_lock_); + base::AutoLock lock(intercept_request_callback_lock_); intercept_request_callback_ = {ewk_context, callback, user_data}; } bool BrowserContextEfl::ResourceContextEfl::HasInterceptRequestCallback() const { - base::AutoLock locker(intercept_request_callback_lock_); + base::AutoLock lock(intercept_request_callback_lock_); return !!intercept_request_callback_.callback; } void BrowserContextEfl::ResourceContextEfl::RunInterceptRequestCallback( _Ewk_Intercept_Request* intercept_request) const { DCHECK_CURRENTLY_ON(BrowserThread::IO); - base::AutoLock locker(intercept_request_callback_lock_); + base::AutoLock lock(intercept_request_callback_lock_); if (intercept_request_callback_.callback) intercept_request_callback_.Run(intercept_request); } +#if BUILDFLAG(IS_TIZEN_TV) +void BrowserContextEfl::ResourceContextEfl::SetInterceptRequestCancelCallback( + Ewk_Context* ewk_context, + Ewk_Context_Intercept_Request_Callback callback, + void* user_data) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + base::AutoLock lock(intercept_request_cancel_callback_lock_); + intercept_request_cancel_callback_ = {ewk_context, callback, user_data}; +} + +bool BrowserContextEfl::ResourceContextEfl::HasInterceptRequestCancelCallback() + const { + base::AutoLock lock(intercept_request_cancel_callback_lock_); + return !!intercept_request_cancel_callback_.callback; +} + +void BrowserContextEfl::ResourceContextEfl::RunInterceptRequestCancelCallback( + _Ewk_Intercept_Request* intercept_request) const { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + base::AutoLock lock(intercept_request_cancel_callback_lock_); + if (intercept_request && intercept_request_cancel_callback_.callback) + intercept_request_cancel_callback_.Run(intercept_request); +} +#endif + scoped_refptr BrowserContextEfl::ResourceContextEfl::GetCookieManager() const { return cookie_manager_; diff --git a/tizen_src/ewk/efl_integration/browser_context_efl.h b/tizen_src/ewk/efl_integration/browser_context_efl.h index 43e4254..9f14f97 100644 --- a/tizen_src/ewk/efl_integration/browser_context_efl.h +++ b/tizen_src/ewk/efl_integration/browser_context_efl.h @@ -60,6 +60,16 @@ class BrowserContextEfl : public BrowserContext, void RunInterceptRequestCallback( _Ewk_Intercept_Request* intercept_request) const; +#if BUILDFLAG(IS_TIZEN_TV) + void SetInterceptRequestCancelCallback( + Ewk_Context* ewk_context, + Ewk_Context_Intercept_Request_Callback callback, + void* user_data); + bool HasInterceptRequestCancelCallback() const; + void RunInterceptRequestCancelCallback( + _Ewk_Intercept_Request* intercept_request) const; +#endif + private: struct InterceptRequestCallbackWithData { Ewk_Context* context; @@ -77,6 +87,10 @@ class BrowserContextEfl : public BrowserContext, InterceptRequestCallbackWithData intercept_request_callback_; mutable base::Lock intercept_request_callback_lock_; +#if BUILDFLAG(IS_TIZEN_TV) + InterceptRequestCallbackWithData intercept_request_cancel_callback_; + mutable base::Lock intercept_request_cancel_callback_lock_; +#endif }; BrowserContextEfl(EWebContext*, bool incognito = false); 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 8dd4543..1cae81a 100644 --- a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc +++ b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc @@ -608,8 +608,14 @@ bool ContentBrowserClientEfl::WillCreateURLLoaderFactory( static_cast(browser_context) ->GetResourceContextEfl(); +#if BUILDFLAG(IS_TIZEN_TV) + if (!resource_context_efl || + !resource_context_efl->HasInterceptRequestCallback() || + !resource_context_efl->HasInterceptRequestCancelCallback()) { +#else if (!resource_context_efl || !resource_context_efl->HasInterceptRequestCallback()) { +#endif return false; } diff --git a/tizen_src/ewk/efl_integration/eweb_context.cc b/tizen_src/ewk/efl_integration/eweb_context.cc index dd84743..2fa967f 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.cc +++ b/tizen_src/ewk/efl_integration/eweb_context.cc @@ -1052,6 +1052,20 @@ void EWebContext::SetTimeZoneOffset(double time_zone_offset, double daylight_saving_time) { browser_context_->SetTimeZoneOffset(time_zone_offset, daylight_saving_time); } + +void EWebContext::SetInterceptRequestCancelCallback( + Ewk_Context* ewk_context, + Ewk_Context_Intercept_Request_Callback callback, + void* user_data) { + BrowserContextEfl::ResourceContextEfl* resource_context_efl = + browser_context_->GetResourceContextEfl(); + if (!resource_context_efl) { + LOG(ERROR) << "Unable to get ResourceContextEfl."; + return; + } + resource_context_efl->SetInterceptRequestCancelCallback(ewk_context, callback, + user_data); +} #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 448ed84..eba47ac 100644 --- a/tizen_src/ewk/efl_integration/eweb_context.h +++ b/tizen_src/ewk/efl_integration/eweb_context.h @@ -209,6 +209,10 @@ class EWebContext { void RegisterURLSchemesAsCORSEnabled(const Eina_List* schemes_list); void SetTimeOffset(double time_offset); void SetTimeZoneOffset(double time_zone_offset, double daylight_saving_time); + void SetInterceptRequestCancelCallback( + Ewk_Context* ewk_context, + Ewk_Context_Intercept_Request_Callback callback, + void* user_data); #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 368f769..85951b9a 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.cc @@ -357,6 +357,12 @@ void Ewk_Context::SetTimeZoneOffset(double time_zone_offset, double daylight_saving_time) { impl->SetTimeZoneOffset(time_zone_offset, daylight_saving_time); } + +void Ewk_Context::SetContextInterceptRequestCancelCallback( + Ewk_Context_Intercept_Request_Callback callback, + void* user_data) { + impl->SetInterceptRequestCancelCallback(this, callback, user_data); +} #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 d1da005..33ac56a 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_context_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_context_private.h @@ -167,6 +167,9 @@ struct Ewk_Context : public base::RefCounted { void SetTimeOffset(double time_offset); // Sets time zone offset for HBBTV void SetTimeZoneOffset(double time_zone_offset, double daylight_saving_time); + void SetContextInterceptRequestCancelCallback( + Ewk_Context_Intercept_Request_Callback callback, + void* user_data); #endif void EnableAppControl(bool enabled); diff --git a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc index ba31ed8..07ca4bb 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc +++ b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.cc @@ -160,8 +160,8 @@ void _Ewk_Intercept_Request::response_decided() { void _Ewk_Intercept_Request::post_response_decided() { content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindRepeating(&_Ewk_Intercept_Request::response_decided, - base::Unretained(this))); + FROM_HERE, + base::BindRepeating(&_Ewk_Intercept_Request::response_decided, this)); } void _Ewk_Intercept_Request::put_chunk(const char* data, size_t length) { @@ -173,8 +173,8 @@ void _Ewk_Intercept_Request::put_chunk(const char* data, size_t length) { void _Ewk_Intercept_Request::post_put_chunk(const char* data, size_t length) { content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindRepeating(&_Ewk_Intercept_Request::put_chunk, - base::Unretained(this), data, length)); + FROM_HERE, base::BindRepeating(&_Ewk_Intercept_Request::put_chunk, this, + data, length)); } void _Ewk_Intercept_Request::chunked_read_done() { @@ -184,8 +184,8 @@ void _Ewk_Intercept_Request::chunked_read_done() { void _Ewk_Intercept_Request::post_chunked_read_done() { content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindRepeating(&_Ewk_Intercept_Request::chunked_read_done, - base::Unretained(this))); + FROM_HERE, + base::BindRepeating(&_Ewk_Intercept_Request::chunked_read_done, this)); } const char* _Ewk_Intercept_Request::request_body_get() const { diff --git a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h index a3a7fc8..e5e8c00c 100644 --- a/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h +++ b/tizen_src/ewk/efl_integration/private/ewk_intercept_request_private.h @@ -12,7 +12,7 @@ #include #include - +#include "base/memory/ref_counted.h" #include "base/synchronization/atomic_flag.h" namespace net { @@ -21,7 +21,8 @@ class UploadDataStream; struct InterceptRequestParams; -struct _Ewk_Intercept_Request { +struct _Ewk_Intercept_Request + : public base::RefCountedThreadSafe<_Ewk_Intercept_Request> { public: class Delegate { public: diff --git a/tizen_src/ewk/efl_integration/public/ewk_context.cc b/tizen_src/ewk/efl_integration/public/ewk_context.cc index 5222929..26b0ec8 100644 --- a/tizen_src/ewk/efl_integration/public/ewk_context.cc +++ b/tizen_src/ewk/efl_integration/public/ewk_context.cc @@ -967,7 +967,12 @@ void ewk_context_service_worker_register(Ewk_Context* context, const char* scope void ewk_context_intercept_request_cancel_callback_set(Ewk_Context* ewk_context, Ewk_Context_Intercept_Request_Cancel_Callback callback, void* user_data) { +#if BUILDFLAG(IS_TIZEN_TV) + EINA_SAFETY_ON_NULL_RETURN(ewk_context); + ewk_context->SetContextInterceptRequestCancelCallback(callback, user_data); +#else LOG_EWK_API_MOCKUP(); +#endif } void ewk_context_set_xwalk_extension_profile(Ewk_Context* ewk_context, -- 2.7.4 From 46fb86c8041decce0810fc6454945c37e69b8a2e Mon Sep 17 00:00:00 2001 From: sidpaswan Date: Thu, 28 Mar 2024 15:35:35 +0530 Subject: [PATCH 14/16] fixup! [M108 Migration][API] Implement ewk_view_session_timeout_set internal API The crash observed was due introduction of CHECK failure in To(GetExecutionContext()) . The code has been modified accordingly to bypass this check fail and also added nullptr condition check for the same. Change-Id: Id01d38092bb9d1badd9828286cb870403039fb9f Signed-off-by: sidpaswan --- .../blink/renderer/core/xmlhttprequest/xml_http_request.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc index 59b3407..46a77e9 100644 --- a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc +++ b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc @@ -1222,12 +1222,16 @@ void XMLHttpRequest::CreateRequest(scoped_refptr http_body, loader_ = MakeGarbageCollected(execution_context, this, resource_loader_options); -#if defined(USE_EFL) +#if BUILDFLAG(IS_EFL) uint64_t timeout_milliseconds_global = 0; - auto* document = To(GetExecutionContext())->document(); - if (execution_context.IsWindow() && document && document->GetPage()) { - timeout_milliseconds_global = - document->GetPage()->GetLongPollingGlobalTimeout() * 1000; + + if (execution_context.IsWindow() && + DynamicTo(&execution_context)) { + auto* document = To(GetExecutionContext())->document(); + if (document && document->GetPage()) { + timeout_milliseconds_global = + document->GetPage()->GetLongPollingGlobalTimeout() * 1000; + } } uint64_t timeout_to_set = timeout(); -- 2.7.4 From 2e74461ad6b54ebe98495316f98910ff942c3053 Mon Sep 17 00:00:00 2001 From: Manjeet Date: Thu, 28 Mar 2024 20:00:00 +0530 Subject: [PATCH 15/16] This patch combine three patch which is related to "--gcov" flag. First patch provides an option to enable gcov for Tizen target and change to build with gcc when given "--gcov" option. In second patch we change "gcov" option value for SR QB Refer to SR Tizen Build macro in [0]. The value of the variable should be "1" to enable gcov. In third patch we change "gcov" option value in spec file Change the value for SR QB References: https://review.tizen.org/gerrit/290776 https://review.tizen.org/gerrit/292688 https://review.tizen.org/gerrit/293899 Change-Id: Iccc9042fb4c4a373bdd1777b77e1b97d95651d03 --- packaging/chromium-efl.spec | 29 ++++++++++++++++++++++++++++- tizen_src/build/common.sh | 7 +++++++ tizen_src/build/config/tizen_features.gni | 1 + tizen_src/ewk/efl_integration/BUILD.gn | 8 ++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/packaging/chromium-efl.spec b/packaging/chromium-efl.spec index cf4502c..31d62ab6 100644 --- a/packaging/chromium-efl.spec +++ b/packaging/chromium-efl.spec @@ -254,7 +254,7 @@ BuildRequires: pkgconfig(capi-boost-tv) %define __enable_gcov 0 %endif -%if "%{?_clang}" == "1" && "%{ARCHITECTURE}" == "armv7l" +%if "%{?_clang}" == "1" && "%{ARCHITECTURE}" == "armv7l" && "%{?gcov}" != "1" %define __use_clang 1 %else %define __use_clang 0 @@ -387,6 +387,15 @@ Requires: %{name} = %{version}-%{release} Chromium tizen ppapi extension unit test utilities %endif +%if 0%{?__enable_gcov} +%package -n webkit2-gcov +Summary: Chromium gcov +Group: Development/UnitTests +Requires: %{name} = %{version}-%{release} +%description -n webkit2-gcov +Chromium gcov objects +%endif + # The macros '%TZ_' are valid from tizen v3.0 %define _pkgid org.tizen.%{name} %define _xmldir %TZ_SYS_RO_PACKAGES @@ -571,6 +580,9 @@ touch ./tizen_src/downloadable/ewk_api_wrapper_generator.py %if %{__enable_network_camera} "enable_network_camera=true" \ %endif +%if 0%{?__enable_gcov} + "enable_gcov=true" \ +%endif %if %{__enable_gamepad_latency_test} "enable_gamepad_latency_test=true" \ %endif @@ -698,6 +710,11 @@ install -m 0644 "%{OUTPUT_FOLDER}"/version "%{buildroot}"%{CHROMIUM_L install -m 0644 "%{OUTPUT_FOLDER}"/snapshot_blob.bin "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/ install -m 0644 "%{OUTPUT_FOLDER}"/content_shell.pak "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/ +%if 0%{?__enable_gcov} +mkdir -p gcov-obj +find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + install -d "%{buildroot}"%{_bindir} install -d "%{buildroot}"%{_libdir} install -d "%{buildroot}"%{CHROMIUM_APP_DIR}/bin @@ -719,6 +736,11 @@ install -m 0644 third_party/electron_node/src/*.h "%{buildroot}"%{_includedir}/n install -m 0644 %{_libdir}/libscl-common.so "%{buildroot}"%{_libdir} %endif +%if 0%{?__enable_gcov} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif + %if %{__build_chrome} == 1 install -m 0755 "%{OUTPUT_FOLDER}"/chrome_tizen "%{buildroot}"%{CHROMIUM_LIB_DIR}/bin/chrome_tizen sed 's#@binary@#%{CHROMIUM_LIB_DIR}/bin/chrome_tizen#' %{SOURCE1} > "%{buildroot}"%{_bindir}/chrome_tizen @@ -1202,6 +1224,11 @@ rm -rf %{CHROMIUM_TPK_DIR}/%{_tpk_file_name}.tpk %{CHROMIUM_TPK_DIR}/* %endif +%if 0%{?__enable_gcov} +%files -n webkit2-gcov +%{_datadir}/gcov/obj/* +%endif + %files devel %defattr(-,root,root,-) %{_includedir}/chromium-ewk/*.h diff --git a/tizen_src/build/common.sh b/tizen_src/build/common.sh index 45054d5..8248d7e 100755 --- a/tizen_src/build/common.sh +++ b/tizen_src/build/common.sh @@ -253,6 +253,13 @@ function setupAndExecuteTargetBuild() { --debug) ARGS+=(--define "_debug_mode 1") ;; + --gcov) + LOCAL_BUILD=0 + ARGS+=(--define "_local_build 0") + ARGS+=(--define "_clang 0") + ARGS+=(--define "_no_lto 0") + ARGS+=(--define "gcov 1") + ;; --skip-ninja) ARGS+=(--define "_skip_ninja 1") ;; diff --git a/tizen_src/build/config/tizen_features.gni b/tizen_src/build/config/tizen_features.gni index 6a163d2..32ac689 100644 --- a/tizen_src/build/config/tizen_features.gni +++ b/tizen_src/build/config/tizen_features.gni @@ -74,6 +74,7 @@ declare_args() { tizen_resource_manager = false enable_network_camera = false enable_gamepad_latency_test = false + enable_gcov = false tizen_thread_booster_service = false drm_mapi_aarch_64 = false diff --git a/tizen_src/ewk/efl_integration/BUILD.gn b/tizen_src/ewk/efl_integration/BUILD.gn index b09d396..b0f0c78 100644 --- a/tizen_src/ewk/efl_integration/BUILD.gn +++ b/tizen_src/ewk/efl_integration/BUILD.gn @@ -766,6 +766,14 @@ shared_library("chromium-ewk") { "-Wl,--no-keep-memory", ] } + + if (enable_gcov) { + cflags += [ + "-fprofile-arcs", + "-ftest-coverage", + ] + ldflags += [ "-fprofile-arcs" ] + } } executable("efl_webprocess") { -- 2.7.4 From ee2b4db2cd2ca98900fce4a21a799b4707d1cf6d Mon Sep 17 00:00:00 2001 From: wangjing Date: Fri, 29 Mar 2024 13:27:24 +0800 Subject: [PATCH 16/16] [M120 Migration][VD] Remove OnParentViewResize in destruction. Remove OnParentViewResize in destrunction to avoid invalid callback was called which will cause evas_gl error. Ref: https://review.tizen.org/gerrit/#/c/300386/ Change-Id: Ic0b8a426c557d645488971f0437bec548813d24f Signed-off-by: wangjing --- .../content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc index b80674e..cfe14d5 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc @@ -186,6 +186,8 @@ RWHVAuraOffscreenHelperEfl::~RWHVAuraOffscreenHelperEfl() { OnHostFocusIn); evas_object_smart_callback_del(content_image_elm_host_, "unfocused", OnHostFocusOut); + evas_object_event_callback_del_full(efl_main_layout_, EVAS_CALLBACK_RESIZE, + OnParentViewResize, this); evas_event_callback_del_full(evas_, EVAS_CALLBACK_RENDER_FLUSH_PRE, OnEvasRenderFlushPre, this); evas_object_del(content_image_); -- 2.7.4