diff options
| author | jocelyn.turcotte <jocelyn.turcotte@digia.com> | 2013-01-03 18:17:21 +0000 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-16 18:00:05 +0100 |
| commit | 0ab6ee16c3bb723fe6827864b5b645d5a6f1babe (patch) | |
| tree | 34fb4e92ce60100cc1b866dc6557dbf8d59e1a77 /Source/WebKit2/UIProcess/API | |
| parent | c2c595293e376b2609d8176e86b6f2ad86b45223 (diff) | |
| download | qtwebkit-0ab6ee16c3bb723fe6827864b5b645d5a6f1babe.tar.gz | |
[Qt] Fix a crash when the QQuickWebPage is destroyed between the scene graph sync and render.
https://bugs.webkit.org/show_bug.cgi?id=106018
Reviewed by Simon Hausmann.
The main and rendering threads are only guaranteed to be synchronised in
the updatePaintNode call. In every other cases, QQuickItems cannot be
safely accessed from the rendering thread.
Do as the first patch version in
https://bugs.webkit.org/show_bug.cgi?id=104574 was doing and copy the
ratio value directly to fix the issue.
Also add a note about the threading issue in QQuickWebPage::updatePaintNode.
* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPage::updatePaintNode):
* UIProcess/qt/QtWebPageSGNode.cpp:
(WebKit::QtWebPageSGNode::QtWebPageSGNode):
* UIProcess/qt/QtWebPageSGNode.h:
(QtWebPageSGNode):
(WebKit::QtWebPageSGNode::devicePixelRatio):
(WebKit::QtWebPageSGNode::setDevicePixelRatio):
Change-Id: Ie849f0f23ae9e017fcdce6326fb2126f3ad66248
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess/API')
| -rw-r--r-- | Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp index a1f35ae47..a7d74b2e2 100644 --- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp @@ -91,15 +91,18 @@ QSGNode* QQuickWebPage::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*) if (window && d->webPageProxy->deviceScaleFactor() != window->devicePixelRatio()) { d->webPageProxy->setIntrinsicDeviceScaleFactor(window->devicePixelRatio()); - d->viewportItem->experimental()->test()->devicePixelRatioChanged(); + // This signal is queued since if we are running a threaded renderer. This might cause failures + // if tests are reading the new value between the property change and the signal emission. + emit d->viewportItem->experimental()->test()->devicePixelRatioChanged(); } if (!node) - node = new QtWebPageSGNode(this); + node = new QtWebPageSGNode; node->setRenderer(renderer); node->setScale(d->contentsScale); + node->setDevicePixelRatio(window->devicePixelRatio()); QColor backgroundColor = d->webPageProxy->drawsTransparentBackground() ? Qt::transparent : Qt::white; QRectF backgroundRect(QPointF(0, 0), d->contentsSize); node->setBackground(backgroundRect, backgroundColor); |
