[Webkit-unassigned] [Bug 38450] New: [Qt] Problem loading multiple pages at once.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 2 23:36:12 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38450

           Summary: [Qt] Problem loading multiple pages at once.
           Product: WebKit
           Version: 420+
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Critical
          Priority: P5
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: allmarx at gmail.com


If you try to load two pages at the same time, on two separate QWebViews, you
run into some very strange issues.  I think this may be some annoying threading
issue deep within the core, but I'm a noob and don't really know.


Here is a quick test case that makes two QWebViews that each load digg.com.  It
logs the output in two QTextEdit windows.

-------------
main.cpp
-------------
#include <QtGui/QApplication>
#include "logger.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    for (int i = 0; i < 2; ++i)
    {
        Logger *log = new Logger();
        QWebView *web = new QWebView();
        QObject::connect(web, SIGNAL(loadFinished(bool)), log,
SLOT(onLoadFinished(bool)));
        web->load(QUrl("http://digg.com"));
        log->show();
    }

    return a.exec();
}

------------
logger.h
------------
#ifndef LOGGER_H
#define LOGGER_H

#include <QTextEdit>
#include <QWebView>
#include <QWebFrame>

class Logger : public QTextEdit
{
Q_OBJECT
public:
    Logger(QWidget *p = 0) : QTextEdit(p) {}
public slots:
    void onLoadFinished(bool ok)
    {
        if (ok)
            this->append("Load successful");
        else
            this->append("Load failed");

        QString html = ((QWebView*)sender())->page()->mainFrame()->toHtml();
        int htmlSize = (html.isNull() || html.isEmpty()) ? 0 : html.length();
        this->append(QString("Html size: %1").arg(htmlSize));
    }
};

#endif // LOGGER_H

--


-- Expected Output: --

*Log 1 and 2*
Load successful
Html size: 92735


-- Actual Output: --

*Log 1*
Load successful
Html size: 92735

*Log 2*
Load successful
Html size: 2057
Load successful
Html size: 92571
Load successful
Html size: 92735


-


Other notes:

This appears to work as expected for google.com (your results may vary), but
digg.com and other websites will fail.  Not sure what the common factor is.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list