EWK_BRINGUPS fixup for M120 72/303272/6
authorNikhil Shingne <n.shingne@samsung.com>
Fri, 22 Dec 2023 08:20:02 +0000 (13:50 +0530)
committerDae-Hyun Ko <dhyuna.ko@samsung.com>
Sat, 30 Dec 2023 10:23:31 +0000 (10:23 +0000)
This commit fixes some of the EWK_BRINGUPs added during M114 upversion.

Change-Id: I35402c34d802890e5fe67eab2c31ac0a5d9c765c
Signed-off-by: Nikhil Shingne <n.shingne@samsung.com>
base/threading/thread_restrictions.h
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc
tizen_src/chromium_impl/content/browser/selection/selection_box_efl.cc
tizen_src/chromium_impl/content/browser/selection/selection_controller_efl.cc
tizen_src/chromium_impl/content/browser/selection/selection_handle_efl.cc
tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.cc
tizen_src/ewk/efl_integration/browser/browsing_data_remover_efl.cc
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/ewk_global_data.cc
tizen_src/ewk/efl_integration/url_request_context_getter_efl.cc

index 9e18c17..b9bc95a 100644 (file)
@@ -141,6 +141,15 @@ class ScopedAllowBlockingForProfile;
 class StartupTabProviderImpl;
 class WebEngineBrowserMainParts;
 
+#if BUILDFLAG(IS_EFL)
+class EwkGlobalData;
+struct GLSharedContextEfl;
+
+namespace content {
+class URLRequestContextGetterEfl;
+}
+#endif
+
 namespace base {
 class Environment;
 class File;
@@ -643,6 +652,11 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
   friend class base::win::OSInfo;
   friend class content::WebContentsImpl;  // http://crbug.com/1262162
 #endif
+#if BUILDFLAG(IS_EFL)
+  friend class ::EwkGlobalData;
+  friend class content::URLRequestContextGetterEfl;
+  friend struct ::GLSharedContextEfl;
+#endif
 
   // Sorted by function name (with namespace), ignoring the return type.
   friend bool ::EnsureBrowserStateDirectoriesCreated(const base::FilePath&,
index fe9d8c9..6fe3b43 100644 (file)
@@ -56,9 +56,9 @@ class ScreenshotCapturedCallback {
  public:
   ScreenshotCapturedCallback(Screenshot_Captured_Callback func, void* user_data)
       : func_(func), user_data_(user_data) {}
-  void Run(Evas_Object* image) {
+  void Run(void* image) {
     if (func_ != NULL)
-      (func_)(image, user_data_);
+      (func_)((Evas_Object*)image, user_data_);
   }
 
  private:
@@ -1062,15 +1062,13 @@ void RWHVAuraOffscreenHelperEfl::GetMagnifierSnapshot(
   TTRACE(TTRACE_TAG_WEB,
          "RenderWidgetHostViewAuraHelperEfl::GetMagnifierSnapshot");
 #endif
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   // GetSnapshot might be replaced with something designed for magnifier.
   Evas_Object* image = GetSnapshot(snapshot_area, scale_factor, true);
 
   base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
-      FROM_HERE,
-      base::BindOnce(&ScreenshotCapturedCallback::Run,
-                     base::Owned(cb.release()), base::Unretained(image)));
-#endif
+      FROM_HERE, base::BindOnce(&ScreenshotCapturedCallback::Run,
+                                base::Owned(cb.release()),
+                                base::Unretained((void*)image)));
 }
 
 void RWHVAuraOffscreenHelperEfl::RequestMagnifierSnapshotAsync(
index 111f93f..bd69109 100644 (file)
@@ -24,19 +24,15 @@ void SelectionBoxEfl::UpdateSelectStringData(const std::u16string& text) {
 }
 
 void SelectionBoxEfl::ClearRectData() {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
   left_rect_ = right_rect_ = gfx::Rect(0, 0, 0, 0);
   context_params_->x = context_params_->y = 0;
 }
 
 bool SelectionBoxEfl::UpdateRectData(const gfx::Rect& left_rect, const gfx::Rect& right_rect) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT2("selection,efl", __PRETTY_FUNCTION__,
                "left_rect", left_rect.ToString(),
                "right_rect", right_rect.ToString());
-#endif
   bool ret = false;
   if (left_rect_ != left_rect || right_rect_ != right_rect)
       ret = true;
index 9419dc6..0b62ec7 100644 (file)
@@ -104,17 +104,13 @@ SelectionControllerEfl::~SelectionControllerEfl() {
 }
 
 void SelectionControllerEfl::SetSelectionStatus(bool enable) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "enable", enable);
-#endif
   selection_data_->SetStatus(enable);
 }
 
 bool SelectionControllerEfl::GetSelectionStatus() const {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "status",
                selection_data_->GetStatus());
-#endif
   return selection_data_->GetStatus();
 }
 
@@ -131,34 +127,26 @@ void SelectionControllerEfl::PlatformLanguageChanged(keynode_t* keynode, void* d
 #endif
 
 void SelectionControllerEfl::SetSelectionEditable(bool enable) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "enable", enable);
-#endif
   selection_data_->SetEditable(enable);
 }
 
 bool SelectionControllerEfl::GetSelectionEditable() const {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "editable",
                selection_data_->GetEditable());
-#endif
   return selection_data_->GetEditable();
 }
 
 bool SelectionControllerEfl::GetCaretSelectionStatus() const {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__, "caret selection",
                selection_mode_ == SelectionMode::CARET);
-#endif
   return selection_mode_ == SelectionMode::CARET;
 }
 
 void SelectionControllerEfl::SetControlsTemporarilyHidden(bool value,
                                                           bool set_forcefully) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT1("selection,efl", __PRETTY_FUNCTION__,
                "controls are hidden:", value);
-#endif
   if (controls_temporarily_hidden_ == value)
     return;
   // Make sure to show selection controls only when no finger
@@ -314,9 +302,7 @@ bool SelectionControllerEfl::UpdateSelectionDataAndShow(
     const gfx::Rect& left_rect,
     const gfx::Rect& right_rect,
     bool /* show */) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
   DetermineSelectionMode(left_rect, right_rect);
   bool selection_changed =
       selection_data_->UpdateRectData(left_rect, right_rect);
@@ -346,9 +332,7 @@ bool SelectionControllerEfl::IsCaretMode() const {
 
 void SelectionControllerEfl::ShowHandleAndContextMenuIfRequired(
     Reason explicit_reason) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
   Reason saved_reason = selection_change_reason_;
   Reason effective_reason = selection_change_reason_;
 
@@ -826,10 +810,8 @@ void SelectionControllerEfl::PostHandleTapGesture(bool is_content_editable) {
 
 bool SelectionControllerEfl::IsSelectionValid(const gfx::Rect& left_rect,
                                               const gfx::Rect& right_rect) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT2("selection,efl", __PRETTY_FUNCTION__, "left_rect",
                left_rect.ToString(), "right_rect", right_rect.ToString());
-#endif
   // For all normal cases the widht will be 0 and we want to check empty which
   // Implies x, y, h w all to be 0
   if ((IsRectEmpty(left_rect) || IsRectEmpty(right_rect))) {
@@ -854,9 +836,7 @@ bool SelectionControllerEfl::IsSelectionValid(const gfx::Rect& left_rect,
 }
 
 void SelectionControllerEfl::ClearSelection() {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
   Clear();
   CancelContextMenu(0);
   SetSelectionStatus(false);
@@ -866,9 +846,7 @@ void SelectionControllerEfl::ClearSelection() {
 }
 
 void SelectionControllerEfl::OnParentParentViewMove() {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT0("selection,efl", __PRETTY_FUNCTION__);
-#endif
   // Update positions of large handle and selection range handles
   input_handle_->Move(selection_data_->GetLeftRect().bottom_left());
   start_handle_->Move(start_handle_->GetBasePosition());
index dd2d943..ef0391d 100644 (file)
@@ -213,10 +213,8 @@ SelectionHandleEfl::HandleDirection SelectionHandleEfl::CalculateDirection(
 void SelectionHandleEfl::ChangeObjectDirection(HandleDirection direction) {
   if (!controller_.rwhva()->offscreen_helper())
     return;
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   TRACE_EVENT2("selection,efl", __PRETTY_FUNCTION__, "handle type",
                handle_type_, "direction", direction);
-#endif
   is_top_ = (direction == DirectionTopNormal || direction == DirectionTopReverse);
 
   switch (direction) {
index 6933b96..e42ff01 100644 (file)
@@ -126,9 +126,7 @@ static GLSharedContextEflPrivate* g_private_part = NULL;
 // static
 void GLSharedContextEfl::Initialize(Evas_Object* object) {
   if (!g_private_part) {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
-    base::ThreadRestrictions::ScopedAllowIO allow_io;
-#endif
+    base::ScopedAllowBlocking allow_io;
     g_private_part = new GLSharedContextEflPrivate(object);
   }
 }
index 11edbeb..93c96a1 100644 (file)
@@ -171,10 +171,10 @@ void BrowsingDataRemoverEfl::ClearQuotaManagedDataOnIOThread() {
   // OnGotQuotaManagedOrigins().
   quota_managed_origins_to_delete_count_ = 0;
   quota_managed_storage_types_to_delete_count_ = 0;
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
-  if (delete_begin_.is_null())
-    ClearQuotaManagedDataInternal(blink::mojom::StorageType::kPersistent);
-#endif
+  if (delete_begin_.is_null()) {
+    ClearQuotaManagedDataInternal(
+        blink::mojom::StorageType::kDeprecatedPersistent);
+  }
   // Do the same for temporary quota.
   ClearQuotaManagedDataInternal(blink::mojom::StorageType::kTemporary);
 
index 666377b..a9e6417 100644 (file)
@@ -743,17 +743,14 @@ void EWebView::Stop() {
 }
 
 void EWebView::Suspend() {
-  CHECK(web_contents_);
 #if BUILDFLAG(IS_TIZEN)
+  CHECK(web_contents_);
   if (IsMobileProfile() && web_contents_->IsFullscreen())
     web_contents_->ExitFullscreen(true);
-#endif
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   RenderViewHost* rvh = web_contents_->GetRenderViewHost();
   RenderFrameHost* rfh = web_contents_->GetPrimaryMainFrame();
   CHECK(rvh);
   CHECK(rfh);
-  rfh->BlockRequestsForFrame();
   if (rvh->IsRenderViewLive()) {
     RenderWidgetHostImpl* rwhi = static_cast<RenderWidgetHostImpl*>(rvh->GetWidget());
     rwhi->PauseScheduledTasks();
@@ -762,13 +759,12 @@ void EWebView::Suspend() {
 }
 
 void EWebView::Resume() {
+#if BUILDFLAG(IS_TIZEN)
   CHECK(web_contents_);
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   RenderViewHost* rvh = web_contents_->GetRenderViewHost();
   RenderFrameHost* rfh = web_contents_->GetPrimaryMainFrame();
   CHECK(rvh);
   CHECK(rfh);
-  rfh->ResumeBlockedRequestsForFrame();
   if (rvh->IsRenderViewLive() && rwhva())
     rwhva()->host()->UnPauseScheduledTasks();
 #endif
@@ -2368,19 +2364,17 @@ content::WebContentsViewAura* EWebView::GetWebContentsViewAura() const {
 }
 
 bool EWebView::SetDrawsTransparentBackground(bool enabled) {
+#if BUILDFLAG(IS_TIZEN)
   RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
   if (!render_view_host || !rwhva())
     return false;
 
-#if BUILDFLAG(IS_EFL)
   if (!rwhva()->offscreen_helper())
     return false;
   elm_object_style_set(rwhva()->offscreen_helper()->content_image_elm_host(),
                        enabled ? "transparent" : "default");
   evas_object_image_alpha_set(rwhva()->offscreen_helper()->content_image(),
                               enabled);
-#endif
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   GetWebContentsViewAura()->SetBackgroundColor(enabled ? SK_ColorTRANSPARENT
                                                        : SK_ColorWHITE);
   static_cast<RenderViewHostImpl*>(render_view_host)
@@ -2388,12 +2382,14 @@ bool EWebView::SetDrawsTransparentBackground(bool enabled) {
       ->GetAssociatedFrameWidget()
       ->SetDrawsTransparentBackground(enabled);
   rwhva()->SetBackgroundColor(enabled ? SK_ColorTRANSPARENT : SK_ColorWHITE);
-#endif
   return true;
+#else
+  return false;
+#endif
 }
 
 bool EWebView::GetDrawsTransparentBackground() {
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
+#if BUILDFLAG(IS_TIZEN)
   return GetWebContentsViewAura()->GetBackgroundColor() == SK_ColorTRANSPARENT;
 #else
   return false;
@@ -2401,6 +2397,7 @@ bool EWebView::GetDrawsTransparentBackground() {
 }
 
 bool EWebView::SetBackgroundColor(int red, int green, int blue, int alpha) {
+#if BUILDFLAG(IS_TIZEN)
   if (!alpha)
     return SetDrawsTransparentBackground(true);
 
@@ -2408,15 +2405,12 @@ bool EWebView::SetBackgroundColor(int red, int green, int blue, int alpha) {
   if (!render_view_host || !rwhva())
     return false;
 
-#if BUILDFLAG(IS_EFL)
   if (!rwhva()->offscreen_helper())
     return false;
   elm_object_style_set(rwhva()->offscreen_helper()->content_image_elm_host(),
                        alpha < 255 ? "transparent" : "default");
   evas_object_image_alpha_set(rwhva()->offscreen_helper()->content_image(),
                               alpha < 255);
-#endif
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
   GetWebContentsViewAura()->SetBackgroundColor(
       SkColorSetARGB(alpha, red, green, blue));
   static_cast<RenderViewHostImpl*>(render_view_host)
@@ -2424,9 +2418,11 @@ bool EWebView::SetBackgroundColor(int red, int green, int blue, int alpha) {
       ->GetAssociatedFrameWidget()
       ->SetBackgroundColor(red, green, blue, alpha);
   rwhva()->SetBackgroundColor(SkColorSetARGB(alpha, red, green, blue));
-#endif
 
   return true;
+#else
+  return false;
+#endif
 }
 
 void EWebView::GetSessionData(const char** data, unsigned* length) const {
index e68e7aa..b105b81 100644 (file)
@@ -175,9 +175,7 @@ EwkGlobalData* EwkGlobalData::GetInstance() {
 
   instance_->browser_main_runner_ = BrowserMainRunner::Create();
   instance_->browser_main_runner_->Initialize(std::move(main_funtion_params));
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
-  base::ThreadRestrictions::ScopedAllowIO allow_io;
-#endif
+  base::ScopedAllowBlocking allow_io;
   if (base::CommandLine::ForCurrentProcess()->HasSwitch(
           switches::kSingleProcess)) {
     content::UtilityProcessHost::RegisterUtilityMainThreadFactory(
index f2a11f5..4168c8c 100644 (file)
@@ -272,9 +272,8 @@ void URLRequestContextGetterEfl::CreateSQLitePersistentCookieStore(
 
   if (path.empty())
     return;
-#if !defined(EWK_BRINGUP)  // FIXME: m114 bringup
-  base::ThreadRestrictions::ScopedAllowIO allow_io;
-#endif
+
+  base::ScopedAllowBlocking allow_io;
   if (base::DirectoryExists(path) || base::CreateDirectory(path)) {
     const base::FilePath& cookie_path = path.AppendASCII("Cookies");
     persistent_store = new net::SQLitePersistentCookieStore(