From 2957239985e6e343bf2e3f3b9a08c6c5ff379bda Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Thu, 24 May 2018 09:45:15 +0200 Subject: Apply settings on pending RVH too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an improvement of: bab4abab Keep settings synchronized when RVH swaps Updating settings during RVH swap is flaky because it happens after the load start of RenderFrame thus it is not guaranteed the ViewMsg_UpdateWebPreferences message is received by the render process before the load finishes. This means that the setting might not be applied on the current page if it was set during the navigation. The new RVH is created at the very beginning of the navigation, so access it via the pending or speculative main frame of the page thereby make it possible to update its settings before the load of RenderFrame starts. Task-number: QTBUG-66656 Task-number: QTBUG-68424 Change-Id: I4fbba597579551bb3329936ccd7b357cf8daa4ea Reviewed-by: Jüri Valdmann --- src/core/web_contents_delegate_qt.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/core/web_contents_delegate_qt.cpp') diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 7f3ced8aa..aae7f4a43 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -527,17 +527,6 @@ void WebContentsDelegateQt::ActivateContents(content::WebContents* contents) contents->Focus(); } -void WebContentsDelegateQt::RenderViewHostChanged(content::RenderViewHost *old_host, content::RenderViewHost *new_host) -{ - Q_ASSERT(new_host); - - // The old RVH can be nullptr if it was shut down. - if (!old_host) - return; - - new_host->UpdateWebkitPreferences(old_host->GetWebkitPreferences()); -} - void WebContentsDelegateQt::RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target) { Q_UNUSED(user_gesture); -- cgit v1.2.3