Delegate javascript debugging to Script and V8 debugger clients.

The appropriate client handles the debugging based on the service available at the server side.

Change-Id: I46b66036f700fc7e45e8b38cef7f1ce1445b1122
Reviewed-on: http://codereview.qt.nokia.com/2497
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Aurindam Jana
2011-07-26 16:22:49 +02:00
parent 999265105b
commit ab574ba88d
26 changed files with 1636 additions and 487 deletions

View File

@@ -37,13 +37,21 @@
namespace Debugger {
namespace Internal {
QmlDebuggerClient::QmlDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client)
: QDeclarativeDebugClient(QLatin1String("JSDebugger"), client)
class QmlDebuggerClientPrivate
{
public:
QList<QByteArray> sendBuffer;
};
QmlDebuggerClient::QmlDebuggerClient(QmlJsDebugClient::QDeclarativeDebugConnection* client, QLatin1String clientName)
: QDeclarativeDebugClient(clientName, client),
d(new QmlDebuggerClientPrivate())
{
}
QmlDebuggerClient::~QmlDebuggerClient()
{
delete d;
}
void QmlDebuggerClient::statusChanged(Status status)
@@ -51,9 +59,21 @@ void QmlDebuggerClient::statusChanged(Status status)
emit newStatus(status);
}
void QmlDebuggerClient::messageReceived(const QByteArray &data)
void QmlDebuggerClient::sendMessage(const QByteArray &msg)
{
emit messageWasReceived(data);
if (status() == Enabled) {
QDeclarativeDebugClient::sendMessage(msg);
} else {
d->sendBuffer.append(msg);
}
}
void QmlDebuggerClient::flushSendBuffer()
{
QTC_ASSERT(status() == QDeclarativeDebugClient::Enabled, return);
foreach (const QByteArray &msg, d->sendBuffer)
QDeclarativeDebugClient::sendMessage(msg);
d->sendBuffer.clear();
}
} // Internal