[M94 Migration][DA]Use the current SiteInstance for error page navigation 11/290711/5
authorChandan Padhi <c.padhi@samsung.com>
Fri, 11 Dec 2020 07:52:11 +0000 (13:22 +0530)
committerBot Blink <blinkbot@samsung.com>
Fri, 14 Apr 2023 00:18:33 +0000 (00:18 +0000)
Using the current SiteInstance instead of a new one would ensure that
a speculative RenderFrameHost is not created and the existing one is
used during error page navigation. This would avoid creation of a new
RWHVEfl(and a new content_image) that renders the existing content_image
invalid resulting in crash/white screen.

Reference Patch : https://review.tizen.org/gerrit/#/c/249422/

Change-Id: Ifdf34847e4314ca1adb6685a344800519554ad6f
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
content/browser/renderer_host/render_frame_host_manager.cc

index 005d75e7344afda5bd6c7732ec0b8cc8dd47a690..5bd71c3ea43497e0386738703c2907e94f0bd48a 100644 (file)
@@ -1882,6 +1882,13 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
     return current_instance;
   }
 
+#if defined(OS_TIZEN_DA_PRODUCT)
+  // Using the current SiteInstance ensures that a speculative RenderFrameHost
+  // is not created during error page navigations.
+  if (current_instance->GetSiteURL() == GURL(kUnreachableWebDataURL))
+    return current_instance;
+#endif
+
   // Determine if we need a new BrowsingInstance for this entry.  If true, this
   // implies that it will get a new SiteInstance (and likely process), and that
   // other tabs in the current BrowsingInstance will be unable to script it.