Revert "[M120 Migration] Introduce network loading API" 47/308247/1
authorjiang yuwei <yuwei.jiang@samsung.com>
Wed, 20 Mar 2024 06:20:15 +0000 (06:20 +0000)
committerjiang yuwei <yuwei.jiang@samsung.com>
Wed, 20 Mar 2024 07:30:16 +0000 (07:30 +0000)
This reverts commit 6ecd8f3596f465b794faaa7e7f8737dd7c8403b4.

Change-Id: I4f1e243b96469dbe0a5d33ddc32ea2c29110ad1a
(cherry picked from commit 21b3f98a4a1fbd0c3b468831163c639e9a6424a3)

16 files changed:
content/browser/renderer_host/render_widget_host_impl.cc
content/browser/renderer_host/render_widget_host_impl.h
third_party/blink/public/mojom/widget/platform_widget.mojom
third_party/blink/public/web/web_view.h
third_party/blink/renderer/core/exported/web_view_impl.cc
third_party/blink/renderer/core/exported/web_view_impl.h
third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
third_party/blink/renderer/core/frame/web_frame_widget_impl.h
third_party/blink/renderer/core/page/page.cc
third_party/blink/renderer/core/page/page.h
third_party/blink/renderer/platform/widget/widget_base.cc
third_party/blink/renderer/platform/widget/widget_base.h
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/public/ewk_view.cc
tizen_src/ewk/efl_integration/public/ewk_view_product.h

index 89be0f9..3bd35b3 100644 (file)
@@ -824,11 +824,6 @@ void RenderWidgetHostImpl::Init() {
   // run them here after we clear it.
   SendScreenRects();
   SynchronizeVisualProperties();
-#if BUILDFLAG(IS_TIZEN_TV)
-  if (pending_resume_network_loading_closure_)
-    std::move(pending_resume_network_loading_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.
@@ -1135,30 +1130,8 @@ void RenderWidgetHostImpl::ResetLastInteractedElements() {
 void RenderWidgetHostImpl::SetFloatVideoWindowState(bool enabled) {
   blink_widget_->SetFloatVideoWindowState(enabled);
 }
-
-void RenderWidgetHostImpl::SuspendNetworkLoading() {
-  blink_widget_->SuspendNetworkLoading();
-}
-
-void RenderWidgetHostImpl::ResumeNetworkLoading() {
-  if (!waiting_for_init_) {
-    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() {
-  blink_widget_->ResumeNetworkLoading();
-}
-#endif  // IS_TIZEN_TV
-#endif  // IS_EFL
+#endif
+#endif
 
 blink::VisualProperties RenderWidgetHostImpl::GetInitialVisualProperties() {
   blink::VisualProperties initial_props = GetVisualProperties();
index 733f395..5141bdf 100644 (file)
@@ -478,10 +478,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
   void ResetLastInteractedElements();
 #if BUILDFLAG(IS_TIZEN_TV)
   void SetFloatVideoWindowState(bool enabled);
-  void SuspendNetworkLoading();
-  void ResumeNetworkLoading();
-#endif  // IS_TIZEN_TV
-#endif  // IS_EFL
+#endif
+#endif
 
 #if BUILDFLAG(IS_TIZEN)
   void PauseScheduledTasks();
@@ -1237,11 +1235,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
   void AddPendingUserActivation(const blink::WebInputEvent& event);
   void ClearPendingUserActivation();
 
-#if BUILDFLAG(IS_TIZEN_TV)
-  // Calls the pending blink::mojom::Widget::ResumeNetworkLoading.
-  void RunPendingResumeNetworkLoading();
-#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();
@@ -1543,10 +1536,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
 
   InputRouterImpl::RequestMouseLockCallback request_mouse_callback_;
 
-#if BUILDFLAG(IS_TIZEN_TV)
-  base::OnceClosure pending_resume_network_loading_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
index ed57605..4d8b29a 100644 (file)
@@ -172,12 +172,6 @@ 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
index be84a15..1b65e05 100644 (file)
@@ -533,14 +533,6 @@ 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)
index 7c8d517..57e90f8 100644 (file)
@@ -4552,23 +4552,7 @@ void WebViewImpl::SetScrollOffset(float x, float y) {
   if (auto* focused_frame = FocusedFrame())
     focused_frame->SetScrollOffset(gfx::PointF(x, y));
 }
-
-#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
+#endif
 
 #if defined(TIZEN_VIDEO_HOLE)
 bool WebViewImpl::IsVideoHoleForRender() const {
index 6e6051c..1414e9f 100644 (file)
@@ -253,12 +253,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
   void ScrollFocusedNodeIntoView() override;
   void SetScrollOffset(float x, float y) override;
   gfx::Rect CurrentSelectionRect() const override;
-
-#if BUILDFLAG(IS_TIZEN_TV)
-  void SuspendNetworkLoading() override;
-  void ResumeNetworkLoading() override;
-#endif  // IS_TIZEN_TV
-#endif  // IS_EFL
+#endif
 
   // Functions to add and remove observers for this object.
   void AddObserver(WebViewObserver* observer);
index 73a1f43..6f16d70 100644 (file)
@@ -4718,16 +4718,8 @@ bool WebFrameWidgetImpl::RequestMainFrameScrollbarVisible(bool& visible) {
 void WebFrameWidgetImpl::SetFloatVideoWindowState(bool enabled) {
   View()->SetFloatVideoWindowState(enabled);
 }
-
-void WebFrameWidgetImpl::SuspendNetworkLoading() {
-  View()->SuspendNetworkLoading();
-}
-
-void WebFrameWidgetImpl::ResumeNetworkLoading() {
-  View()->ResumeNetworkLoading();
-}
-#endif  // IS_TIZEN_TV
-#endif  // IS_EFL
+#endif
+#endif
 
 #if BUILDFLAG(IS_TIZEN)
 void WebFrameWidgetImpl::SetMaxRefreshRate(uint32_t max_refresh_rate) {
index ff61471..3d779fd 100644 (file)
@@ -797,8 +797,6 @@ 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
 
index 7828edb..ba4259a 100644 (file)
@@ -1216,22 +1216,6 @@ 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<LocalFrame>(frame)) {
-      local_frame->Loader().SetDefersLoading(defers ? LoaderFreezeMode::kStrict
-                                                    : LoaderFreezeMode::kNone);
-    }
-  }
-}
 #endif
 
 const base::UnguessableToken& Page::BrowsingContextGroupToken() {
index ca98bfb..47b52b8 100644 (file)
@@ -348,7 +348,6 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>,
   uint64_t GetLongPollingGlobalTimeout() {
     return long_polling_global_timeout_;
   }
-  void SetDefersLoading(bool defers);
 #endif
 
   void AddAutoplayFlags(int32_t flags);
@@ -656,7 +655,6 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>,
   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<v8_compile_hints::V8CrowdsourcedCompileHintsProducer>
index 0c15209..209997e 100644 (file)
@@ -564,17 +564,7 @@ void WidgetBase::SelectFocusedLink() {
 void WidgetBase::RequestSelectionRect(RequestSelectionRectCallback callback) {
   std::move(callback).Run(client_->RequestSelectionRect());
 }
-
-#if BUILDFLAG(IS_TIZEN_TV)
-void WidgetBase::SuspendNetworkLoading() {
-  client_->SuspendNetworkLoading();
-}
-
-void WidgetBase::ResumeNetworkLoading() {
-  client_->ResumeNetworkLoading();
-}
-#endif  // IS_TIZEN_TV
-#endif  // IS_EFL
+#endif
 
 #if BUILDFLAG(IS_TIZEN_TV)
 void WidgetBase::SetFloatVideoWindowState(bool enabled) {
index 286da27..0fd2e85 100644 (file)
@@ -156,8 +156,6 @@ 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;
index aecad42..964ec6e 100644 (file)
@@ -776,20 +776,6 @@ void EWebView::SetFloatVideoWindowState(bool enabled) {
 
     rwhi->SetFloatVideoWindowState(enabled);
 }
-
-void EWebView::SuspendNetworkLoading() {
-  RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
-      web_contents_->GetRenderViewHost()->GetWidget());
-
-  rwhi->SuspendNetworkLoading();
-}
-
-void EWebView::ResumeNetworkLoading() {
-  RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(
-      web_contents_->GetRenderViewHost()->GetWidget());
-
-  rwhi->ResumeNetworkLoading();
-}
 #endif // IS_TIZEN_TV
 
 double EWebView::GetTextZoomFactor() const {
index bd41e79..ccfb65b 100644 (file)
@@ -401,8 +401,6 @@ 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;
index cac6d2a..8a3054f 100644 (file)
@@ -1645,26 +1645,14 @@ void ewk_view_widget_pepper_extension_info_set(Evas_Object* ewk_view, Ewk_Value
 #endif
 }
 
-void ewk_view_resume_network_loading(Evas_Object* ewk_view)
+void ewk_view_resume_network_loading(Evas_Object* ewkView)
 {
-#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
+  LOG_EWK_API_MOCKUP();
 }
 
-void ewk_view_suspend_network_loading(Evas_Object* ewk_view)
+void ewk_view_suspend_network_loading(Evas_Object* ewkView)
 {
-#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
+  LOG_EWK_API_MOCKUP();
 }
 
 void ewk_view_offscreen_rendering_enabled_set(Evas_Object* o, Eina_Bool enabled)
index 2b760ac..9b0eb63 100644 (file)
@@ -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* ewk_view);
+EXPORT_API void ewk_view_resume_network_loading(Evas_Object* ewkView);
 
 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* ewk_view);
+EXPORT_API void ewk_view_suspend_network_loading(Evas_Object* ewkView);
 
 /**
  * This function should be use for browser edge scroll.