diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-24 11:26:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-24 11:48:46 +0200 |
commit | 1a9759855639b9e2b3cdc0687d3381dcbf6c9815 (patch) | |
tree | b2da51f6eddddb83c2d97cdcfac24d38d2e67a4e /src/qml/debugger/qqmldebugserver.cpp | |
parent | 8217ec1b888f3ff93f004801b018c5f85362c484 (diff) | |
parent | e1fc2793aef53b84a3f1e19b6d6bdf1141340074 (diff) |
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts:
src/imports/qtquick2/plugins.qmltypes
src/qml/debugger/qv8debugservice.cpp
src/qml/qml/qml.pri
src/qml/qml/qqmlcompiler.cpp
src/qml/qml/qqmlcomponent.cpp
src/qml/qml/qqmlcontext.cpp
src/qml/qml/qqmldata_p.h
src/qml/qml/qqmlengine_p.h
src/qml/qml/qqmljavascriptexpression.cpp
src/qml/qml/qqmlxmlhttprequest.cpp
src/qml/qml/v4/qv4bindings.cpp
src/qml/qml/v4/qv4irbuilder.cpp
src/qml/qml/v4/qv4jsonobject_p.h
src/qml/qml/v8/qqmlbuiltinfunctions.cpp
src/qml/qml/v8/qv8bindings.cpp
src/qml/qml/v8/qv8contextwrapper.cpp
src/qml/qml/v8/qv8listwrapper.cpp
src/qml/qml/v8/qv8qobjectwrapper.cpp
src/qml/qml/v8/qv8qobjectwrapper_p.h
src/qml/qml/v8/qv8sequencewrapper_p_p.h
src/qml/qml/v8/qv8typewrapper.cpp
src/qml/qml/v8/qv8valuetypewrapper.cpp
src/qml/types/qqmldelegatemodel.cpp
src/quick/items/context2d/qquickcanvasitem.cpp
src/quick/items/context2d/qquickcontext2d.cpp
sync.profile
tests/auto/qml/qjsengine/tst_qjsengine.cpp
tests/benchmarks/qml/animation/animation.pro
tools/qmlprofiler/qmlprofiler.pro
Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
Diffstat (limited to 'src/qml/debugger/qqmldebugserver.cpp')
-rw-r--r-- | src/qml/debugger/qqmldebugserver.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp index 27e3d226cd..53ad15775c 100644 --- a/src/qml/debugger/qqmldebugserver.cpp +++ b/src/qml/debugger/qqmldebugserver.cpp @@ -102,9 +102,8 @@ public: bool gotHello; bool blockingMode; - QMutex messageArrivedMutex; - QWaitCondition messageArrivedCondition; - QStringList waitingForMessageNames; + QMutex helloMutex; + QWaitCondition helloCondition; QQmlDebugServerThread *thread; QPluginLoader loader; QAtomicInt changeServiceStateCalls; @@ -298,6 +297,7 @@ QQmlDebugServer *QQmlDebugServer::instance() for (; argsIt != argsItEnd; ++argsIt) { const QString strArgument = *argsIt; if (strArgument.startsWith(QLatin1String("port:"))) { + pluginName = QLatin1String("qmldbg_tcp"); portFrom = strArgument.mid(5).toInt(&ok); portTo = portFrom; QStringList::const_iterator argsNext = argsIt + 1; @@ -308,7 +308,6 @@ QQmlDebugServer *QQmlDebugServer::instance() portTo = nextArgument.toInt(&ok); ++argsIt; } - pluginName = QLatin1String("qmldbg_tcp"); } else if (strArgument.startsWith(QLatin1String("host:"))) { hostAddress = strArgument.mid(5); } else if (strArgument == QLatin1String("block")) { @@ -331,11 +330,11 @@ QQmlDebugServer *QQmlDebugServer::instance() QQmlDebugServerPrivate *d = qQmlDebugServer->d_func(); d->blockingMode = block; - QMutexLocker locker(&d->messageArrivedMutex); + QMutexLocker locker(&d->helloMutex); thread->start(); if (d->blockingMode) - d->messageArrivedCondition.wait(&d->messageArrivedMutex); + d->helloCondition.wait(&d->helloMutex); } else { qWarning() << QString(QLatin1String( @@ -418,10 +417,13 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message) if (s_dataStreamVersion > QDataStream().version()) s_dataStreamVersion = QDataStream().version(); } + // Send the hello answer immediately, since it needs to arrive before // the plugins below start sending messages. + QByteArray helloAnswer; { + QReadLocker readPluginsLock(&d->pluginsLock); QQmlDebugStream out(&helloAnswer, QIODevice::WriteOnly); QStringList pluginNames; QList<float> pluginVersions; @@ -447,7 +449,8 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message) d->_q_changeServiceState(iter.value()->name(), newState); } - d->messageArrivedCondition.wakeAll(); + QMutexLocker helloLock(&d->helloMutex); + d->helloCondition.wakeAll(); } else if (op == 1) { @@ -487,9 +490,6 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message) qWarning() << "QML Debugger: Message received for missing plugin" << name << '.'; } else { (*iter)->messageReceived(message); - - if (d->waitingForMessageNames.removeOne(name)) - d->messageArrivedCondition.wakeAll(); } } else { qWarning("QML Debugger: Invalid hello message."); |