Changeset 62837 in webkit


Ignore:
Timestamp:
Jul 8, 2010 2:17:12 PM (14 years ago)
Author:
luiz@webkit.org
Message:

2010-07-08 Luiz Agostini <luiz.agostini@openbossa.org>

Reviewed by Kenneth Rohde Christiansen.

[Qt] Move socket objects to connection's thread
https://bugs.webkit.org/show_bug.cgi?id=41897

To receive network related notifications in the WorkQueue thread, the
QLocalSocket instances must be moved to that thread.

  • Platform/CoreIPC/qt/ConnectionQt.cpp: (CoreIPC::Connection::open):
  • Platform/WorkQueue.h:
  • Platform/qt/WorkQueueQt.cpp: (WorkQueue::moveSocketToWorkThread):
Location:
trunk/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r62825 r62837  
     12010-07-08  Luiz Agostini  <luiz.agostini@openbossa.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt] Move socket objects to connection's thread
     6        https://bugs.webkit.org/show_bug.cgi?id=41897
     7
     8        To receive network related notifications in the WorkQueue thread, the
     9        QLocalSocket instances must be moved to that thread.
     10
     11        * Platform/CoreIPC/qt/ConnectionQt.cpp:
     12        (CoreIPC::Connection::open):
     13        * Platform/WorkQueue.h:
     14        * Platform/qt/WorkQueueQt.cpp:
     15        (WorkQueue::moveSocketToWorkThread):
     16
    1172010-07-08  Alice Liu  <alice.liu@apple.com>
    218
  • trunk/WebKit2/Platform/CoreIPC/qt/ConnectionQt.cpp

    r62790 r62837  
    9292        m_socket = WebKit::ProcessLauncher::takePendingConnection();
    9393        m_isConnected = m_socket;
    94         if (m_isConnected)
     94        if (m_isConnected) {
     95            m_connectionQueue.moveSocketToWorkThread(m_socket);
    9596            m_connectionQueue.connectSignal(m_socket, SIGNAL(readyRead()), WorkItem::create(this, &Connection::readyReadHandler));
     97        }
    9698    } else {
    9799        m_socket = new QLocalSocket();
    98100        m_socket->connectToServer(m_serverName);
     101        m_connectionQueue.moveSocketToWorkThread(m_socket);
    99102        m_connectionQueue.connectSignal(m_socket, SIGNAL(readyRead()), WorkItem::create(this, &Connection::readyReadHandler));
    100103        m_isConnected = m_socket->waitForConnected();
  • trunk/WebKit2/Platform/WorkQueue.h

    r62358 r62837  
    3939
    4040#if PLATFORM(QT)
     41class QLocalSocket;
    4142class QObject;
    4243class QThread;
     
    6970#elif PLATFORM(QT)
    7071    void connectSignal(QObject*, const char* signal, std::auto_ptr<WorkItem>);
    71     void disconnectSignal(QObject*, const char* signa);
     72    void disconnectSignal(QObject*, const char* signal);
     73
     74    void moveSocketToWorkThread(QLocalSocket*);
    7275#endif
    7376
  • trunk/WebKit2/Platform/qt/WorkQueueQt.cpp

    r62256 r62837  
    2727#include "WorkQueue.h"
    2828
     29#include <QLocalSocket>
    2930#include <QObject>
    3031#include <QThread>
     
    9394}
    9495
     96void WorkQueue::moveSocketToWorkThread(QLocalSocket* socket)
     97{
     98    ASSERT(m_workThread);
     99    ASSERT(socket);
     100
     101    socket->setParent(0);
     102    socket->moveToThread(m_workThread);
     103}
     104
    95105void WorkQueue::platformInitialize(const char*)
    96106{
Note: See TracChangeset for help on using the changeset viewer.