summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2018-09-20 10:26:37 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2018-10-29 09:43:04 +0000
commit36d230c44c7e2f6fccf224b4a0ab5efe77117e0a (patch)
tree1a782829d2838908a461799bf4b8fd651dad6958 /src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
parent2a6193b00e1d756e9a7a6032640b413c184ae4f0 (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/render_widget_host_view_qt_delegate_widget.h')
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
index 4dc47dfdd..74c9e3413 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
@@ -46,6 +46,11 @@
#include <QQuickItem>
#include <QQuickWidget>
+QT_BEGIN_NAMESPACE
+class QWebEnginePage;
+class QWebEnginePagePrivate;
+QT_END_NAMESPACE
+
namespace QtWebEngineCore {
// Useful information keyboard and mouse QEvent propagation.
@@ -58,8 +63,8 @@ class RenderWidgetHostViewQtDelegateWidget : public QQuickWidget, public RenderW
Q_OBJECT
public:
RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, QWidget *parent = 0);
+ ~RenderWidgetHostViewQtDelegateWidget();
- void initAsChild(WebContentsAdapterClient* container) override;
void initAsPopup(const QRect&) override;
QRectF screenRect() const override;
QRectF contentsRect() const override;
@@ -95,9 +100,13 @@ protected:
private slots:
void onWindowPosChanged();
+ void connectRemoveParentBeforeParentDelete();
+ void disconnectRemoveParentBeforeParentDelete();
void removeParentBeforeParentDelete();
private:
+ friend QWebEnginePagePrivate;
+
RenderWidgetHostViewQtDelegateClient *m_client;
QScopedPointer<QQuickItem> m_rootItem;
bool m_isPopup;
@@ -105,6 +114,7 @@ private:
QColor m_clearColor;
QPoint m_lastGlobalPos;
QList<QMetaObject::Connection> m_windowConnections;
+ QWebEnginePage *m_page = nullptr;
};
} // namespace QtWebEngineCore