Changeset 49770 in webkit
- Timestamp:
- Oct 19, 2009 3:44:43 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r49769 r49770 1 2009-10-19 Girish Ramakrishnan <girish@forwardbias.in> 2 3 Reviewed by Holger Freyther. 4 5 [Qt] Windowed Plugins: Fix crash when QWebPage is deleted after QWebView. 6 7 Fixes various sources of crashes: 8 1. The PluginContainer is a child of QWebView. When the view gets deleted, 9 the PluginView is not notified about the deletion of PluginContainer. 10 2. QWebView destructor does not set client to 0. 11 3. Sometimes pending paint events are sent after the plugin has died, so add 12 a check in PluginView::setNPWindowIfNeeded. 13 14 https://bugs.webkit.org/show_bug.cgi?id=30354 15 16 * plugins/qt/PluginContainerQt.cpp: 17 (PluginContainerQt::~PluginContainerQt): 18 * plugins/qt/PluginViewQt.cpp: 19 (WebCore::PluginView::setNPWindowIfNeeded): 20 1 21 2009-10-19 Jakob Truelsen <antialize@gmail.com> 2 22 -
trunk/WebCore/plugins/qt/PluginContainerQt.cpp
r44381 r49770 74 74 { 75 75 delete m_clientWrapper; 76 m_pluginView->setPlatformPluginWidget(0); 76 77 } 77 78 -
trunk/WebCore/plugins/qt/PluginViewQt.cpp
r49502 r49770 463 463 return; 464 464 465 // Check if the platformPluginWidget still exists 466 if (m_isWindowed && !platformPluginWidget()) 467 return; 468 465 469 if (!m_hasPendingGeometryChange) 466 470 return; … … 468 472 469 473 if (m_isWindowed) { 470 ASSERT(platformPluginWidget());471 474 platformPluginWidget()->setGeometry(m_windowRect); 472 475 // if setMask is set with an empty QRegion, no clipping will -
trunk/WebKit/qt/Api/qwebview.cpp
r49502 r49770 246 246 QWebView::~QWebView() 247 247 { 248 if (d->page) 248 if (d->page) { 249 249 d->page->d->view = 0; 250 d->page->d->client = 0; 251 } 250 252 251 253 if (d->page && d->page->parent() == this) -
trunk/WebKit/qt/ChangeLog
r49769 r49770 1 2009-10-19 Girish Ramakrishnan <girish@forwardbias.in> 2 3 Reviewed by Holger Freyther. 4 5 [Qt] Windowed Plugins: Fix crash when QWebPage is deleted after QWebView. 6 7 Fixes various sources of crashes: 8 1. The PluginContainer is a child of QWebView. When the view gets deleted, 9 the PluginView is not notified about the deletion of PluginContainer. 10 2. QWebView destructor does not set client to 0. 11 3. Sometimes pending paint events are sent after the plugin has died, so add 12 a check in PluginView::setNPWindowIfNeeded. 13 14 https://bugs.webkit.org/show_bug.cgi?id=30354 15 16 * Api/qwebview.cpp: 17 (QWebView::~QWebView): 18 * tests/qwebview/qwebview.pro: 19 * tests/qwebview/tst_qwebview.cpp: 20 (tst_QWebView::reusePage_data): 21 (tst_QWebView::reusePage): 22 1 23 2009-10-19 Jakob Truelsen <antialize@gmail.com> 2 24 -
trunk/WebKit/qt/tests/qwebview/qwebview.pro
r48528 r49770 5 5 QT += testlib network 6 6 QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR 7 DEFINES += SRCDIR=\\\"$$PWD/\\\" 7 8 8 9 symbian:TARGET.UID3 = 0xA000E53F -
trunk/WebKit/qt/tests/qwebview/tst_qwebview.cpp
r46485 r49770 2 2 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) 3 3 Copyright (C) 2009 Torch Mobile Inc. 4 Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> 4 5 5 6 This library is free software; you can redistribute it and/or … … 27 28 #include <qdiriterator.h> 28 29 #include <qwebkitversion.h> 30 #include <qwebframe.h> 29 31 30 32 class tst_QWebView : public QObject … … 43 45 void guessUrlFromString(); 44 46 void getWebKitVersion(); 47 48 void reusePage_data(); 49 void reusePage(); 45 50 }; 46 51 … … 168 173 } 169 174 175 void tst_QWebView::reusePage_data() 176 { 177 QTest::addColumn<QString>("html"); 178 QTest::newRow("WithoutPlugin") << "<html><body id='b'>text</body></html>"; 179 QTest::newRow("WindowedPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf'></embed></body></html>"); 180 QTest::newRow("WindowlessPlugin") << QString("<html><body id='b'>text<embed src='resources/test.swf' wmode=\"transparent\"></embed></body></html>"); 181 } 182 183 void tst_QWebView::reusePage() 184 { 185 QDir::setCurrent(SRCDIR); 186 187 QFETCH(QString, html); 188 QWebView* view1 = new QWebView; 189 QPointer<QWebPage> page = new QWebPage; 190 view1->setPage(page); 191 page->settings()->setAttribute(QWebSettings::PluginsEnabled, true); 192 QWebFrame* mainFrame = page->mainFrame(); 193 mainFrame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath())); 194 if (html.contains("</embed>")) { 195 // some reasonable time for the PluginStream to feed test.swf to flash and start painting 196 QTest::qWait(2000); 197 } 198 199 view1->show(); 200 QTest::qWait(2000); 201 delete view1; 202 QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view 203 204 QWebView *view2 = new QWebView; 205 view2->setPage(page); 206 view2->show(); // in Windowless mode, you should still be able to see the plugin here 207 QTest::qWait(2000); 208 delete view2; 209 210 delete page; // must not crash 211 212 QDir::setCurrent(QApplication::applicationDirPath()); 213 } 214 170 215 QTEST_MAIN(tst_QWebView) 171 216 #include "tst_qwebview.moc"
Note: See TracChangeset
for help on using the changeset viewer.