diff options
Diffstat (limited to 'src/qmldebug/qqmlprofilerclient_p_p.h')
-rw-r--r-- | src/qmldebug/qqmlprofilerclient_p_p.h | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/src/qmldebug/qqmlprofilerclient_p_p.h b/src/qmldebug/qqmlprofilerclient_p_p.h index 9c44113aa8..cf0145409a 100644 --- a/src/qmldebug/qqmlprofilerclient_p_p.h +++ b/src/qmldebug/qqmlprofilerclient_p_p.h @@ -40,8 +40,15 @@ #ifndef QQMLPROFILERCLIENT_P_P_H #define QQMLPROFILERCLIENT_P_P_H -#include "qqmlprofilerclient_p.h" #include "qqmldebugclient_p_p.h" +#include "qqmldebugmessageclient_p.h" +#include "qqmlenginecontrolclient_p.h" +#include "qqmlprofilerclient_p.h" +#include "qqmlprofilertypedevent_p.h" + +#include <private/qqmlprofilerdefinitions_p.h> + +#include <QtCore/qqueue.h> // // W A R N I N G @@ -56,20 +63,48 @@ QT_BEGIN_NAMESPACE -struct QQmlProfilerRangeType -{ - QQmlEventLocation location; - QString name; -}; - -class QQmlProfilerClientPrivate : public QQmlDebugClientPrivate -{ +class QQmlProfilerClientPrivate : public QQmlDebugClientPrivate, public QQmlProfilerDefinitions { Q_DECLARE_PUBLIC(QQmlProfilerClient) public: - QQmlProfilerClientPrivate(QQmlDebugConnection *connection); - quint64 features; + QQmlProfilerClientPrivate(QQmlDebugConnection *connection, + QQmlProfilerEventReceiver *eventReceiver) + : QQmlDebugClientPrivate(QLatin1String("CanvasFrameRate"), connection) + , eventReceiver(eventReceiver) + , engineControl(new QQmlEngineControlClient(connection)) + , maximumTime(0) + , recording(false) + , requestedFeatures(0) + , recordedFeatures(0) + , flushInterval(0) + { + } + + virtual ~QQmlProfilerClientPrivate() override {} + + void sendRecordingStatus(int engineId); + bool updateFeatures(ProfileFeature feature); + int resolveType(const QQmlProfilerTypedEvent &type); + int resolveStackTop(); + void forwardEvents(const QQmlProfilerEvent &last); + void processCurrentEvent(); + void finalize(); + + QQmlProfilerEventReceiver *eventReceiver; + QScopedPointer<QQmlEngineControlClient> engineControl; + QScopedPointer<QQmlDebugMessageClient> messageClient; + qint64 maximumTime; + bool recording; + quint64 requestedFeatures; + quint64 recordedFeatures; + quint32 flushInterval; - QHash<qint64, QQmlProfilerRangeType> types; + // Reuse the same event, so that we don't have to constantly reallocate all the data. + QQmlProfilerTypedEvent currentEvent; + QHash<QQmlProfilerEventType, int> eventTypeIds; + QHash<qint64, int> serverTypeIds; + QStack<QQmlProfilerTypedEvent> rangesInProgress; + QQueue<QQmlProfilerEvent> pendingMessages; + QQueue<QQmlProfilerEvent> pendingDebugMessages; }; QT_END_NAMESPACE |