diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2018-09-20 10:26:37 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2018-10-29 09:43:04 +0000 |
commit | 36d230c44c7e2f6fccf224b4a0ab5efe77117e0a (patch) | |
tree | 1a782829d2838908a461799bf4b8fd651dad6958 /src/webenginewidgets/api/qwebenginepage_p.h | |
parent | 2a6193b00e1d756e9a7a6032640b413c184ae4f0 (diff) |
Stop showing speculative frames
Chromium creates "speculative" frames (RenderFrameHost and company) for pending
cross-process navigations (and maybe other navigations too). For example, a
redirect from http://qt.io to https://qt.io will trigger this, as described in
the bug report.
These speculative frames are loading in the background and only shown once they
are officially ready (as decided by the RenderFrameHostManager and signaled to
WebContentsObserver::RenderViewHostChanged). At least, this is how it's supposed
to work and how it works in Chrome. In WebEngine, however, we actually show
these speculative frames as soon as they are created and before they are ready.
This runs into the problem that the if the speculative frame is dropped (instead
of committed), then Chromium will not ask us to re-show the old frame (since it
hasn't actually asked to us to show the new frame, it naturally assumes we are
still showing the old one).
Fixes: QTBUG-68727
Change-Id: I9d53035ce60e3a002d5412d4473d940a32644b5d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage_p.h')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index dc8a34af6..eecbf0b65 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -65,6 +65,7 @@ namespace QtWebEngineCore { class RenderWidgetHostViewQtDelegate; +class RenderWidgetHostViewQtDelegateWidget; class WebContentsAdapter; } @@ -150,6 +151,7 @@ public: void printRequested() override; const QObject *holdingQObject() const override; ClientType clientType() override { return QtWebEngineCore::WebContentsAdapterClient::WidgetsClient; } + void widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegate *newWidget) override; QtWebEngineCore::ProfileAdapter *profileAdapter() override; QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override; @@ -166,6 +168,10 @@ public: void setFullScreenMode(bool); void ensureInitialized() const; + static void bindPageAndView(QWebEnginePage *page, QWebEngineView *view); + static void bindPageAndWidget(QWebEnginePage *page, + QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *widget); + QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter; QWebEngineHistory *history; QWebEngineProfile *profile; @@ -187,6 +193,7 @@ public: bool defaultAudioMuted; qreal defaultZoomFactor; QTimer wasShownTimer; + QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget *widget = nullptr; mutable QtWebEngineCore::CallbackDirectory m_callbacks; mutable QAction *actions[QWebEnginePage::WebActionCount]; |