summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-03-14 18:28:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-21 14:39:36 +0100
commitf06cb10ce5a6d543d97bd05484179f56b60e6e5a (patch)
treee352b7684b03fbb5e729204484178fd087971287 /src/webengine/api/qquickwebengineview.cpp
parent5613f356635e810dcc1e3849011bec5764095963 (diff)
Base load signals on Blink loader events
This mainly remove the use of the LoadingStateChanged callback, which is tied to DidStartLoading and DidStopLoading. Those signals are handled from the browser process side, also wrapping the time where the render process is initialized. We can't rely on those signals for loadStarted, but afterward rely on the Blink loader for loadFinished. We must use the same source for both. Instead only rely on Blink callbacks ultimately related to network events. This gives us a behavior closer to QtWebKit. The major compromise that this forces us to to accept is that loadStarted is now triggered asynchronously. This will basically break anything expecting loadStarted to be emitted synchronously from the load method. This also adjust autotests to get a few more passing. Initial-patch-by: Pierre Rossi <pierre.rossi@digia.com> Change-Id: Ib6c0170df891d1b7f8ed4dc1d483985523e267dc Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 58262cd3f..27282e111 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -72,7 +72,6 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
, contextMenuExtraItems(0)
, loadProgress(0)
, inspectable(false)
- , m_isLoading(false)
, m_isFullScreen(false)
, devicePixelRatio(QGuiApplication::primaryScreen()->devicePixelRatio())
, m_dpiScale(1.0)
@@ -213,17 +212,6 @@ void QQuickWebEngineViewPrivate::iconChanged(const QUrl &url)
Q_EMIT q->iconChanged();
}
-void QQuickWebEngineViewPrivate::loadingStateChanged()
-{
- Q_Q(QQuickWebEngineView);
- const bool wasLoading = m_isLoading;
- m_isLoading = adapter->isLoading();
- if (m_isLoading && !wasLoading) {
- QQuickWebEngineLoadRequest loadRequest(q->url(), QQuickWebEngineView::LoadStartedStatus);
- Q_EMIT q->loadingChanged(&loadRequest);
- }
-}
-
void QQuickWebEngineViewPrivate::loadProgressChanged(int progress)
{
Q_Q(QQuickWebEngineView);
@@ -242,6 +230,13 @@ qreal QQuickWebEngineViewPrivate::dpiScale() const
return m_dpiScale;
}
+void QQuickWebEngineViewPrivate::loadStarted(const QUrl &provisionalUrl)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineLoadRequest loadRequest(provisionalUrl, QQuickWebEngineView::LoadStartedStatus);
+ Q_EMIT q->loadingChanged(&loadRequest);
+}
+
void QQuickWebEngineViewPrivate::loadFinished(bool success, int error_code, const QString &error_description)
{
Q_Q(QQuickWebEngineView);