Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlprofilerclient_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef QQMLPROFILERCLIENT_P_P_H
6#define QQMLPROFILERCLIENT_P_P_H
7
14
15#include <QtCore/qqueue.h>
16#include <QtCore/qstack.h>
17
18//
19// W A R N I N G
20// -------------
21//
22// This file is not part of the Qt API. It exists purely as an
23// implementation detail. This header file may change from version to
24// version without notice, or even be removed.
25//
26// We mean it.
27//
28
29QT_BEGIN_NAMESPACE
30
31class QQmlProfilerClientPrivate : public QQmlDebugClientPrivate {
32 Q_DECLARE_PUBLIC(QQmlProfilerClient)
33public:
34 QQmlProfilerClientPrivate(QQmlDebugConnection *connection,
35 QQmlProfilerEventReceiver *eventReceiver)
36 : QQmlDebugClientPrivate(QLatin1String("CanvasFrameRate"), connection)
37 , eventReceiver(eventReceiver)
38 , engineControl(new QQmlEngineControlClient(connection))
39 , messageClient(new QQmlDebugMessageClient(connection))
40 , maximumTime(0)
41 , recording(false)
42 , requestedFeatures(0)
43 , recordedFeatures(0)
44 , flushInterval(0)
45 {
46 }
47
48 ~QQmlProfilerClientPrivate() override;
49
50 void sendRecordingStatus(int engineId);
51 bool updateFeatures(ProfileFeature feature);
52 int resolveType(const QQmlProfilerTypedEvent &type);
53 int resolveStackTop();
54 void forwardEvents(const QQmlProfilerEvent &last);
55 void forwardDebugMessages(qint64 untilTimestamp);
56 void processCurrentEvent();
57 void finalize();
58
59 QQmlProfilerEventReceiver *eventReceiver;
60 QScopedPointer<QQmlEngineControlClient> engineControl;
61 QScopedPointer<QQmlDebugMessageClient> messageClient;
62 qint64 maximumTime;
63 bool recording;
64 quint64 requestedFeatures;
65 quint64 recordedFeatures;
66 quint32 flushInterval;
67
68 // Reuse the same event, so that we don't have to constantly reallocate all the data.
69 QQmlProfilerTypedEvent currentEvent;
70 QHash<QQmlProfilerEventType, int> eventTypeIds;
71 QHash<qint64, int> serverTypeIds;
72 QStack<QQmlProfilerTypedEvent> rangesInProgress;
73 QQueue<QQmlProfilerEvent> pendingMessages;
74 QQueue<QQmlProfilerEvent> pendingDebugMessages;
75
76 QList<int> trackedEngines;
77};
78
79QT_END_NAMESPACE
80
81#endif // QQMLPROFILERCLIENT_P_P_H
void setFlushInterval(quint32 flushInterval)
quint64 recordedFeatures() const
void setRequestedFeatures(quint64 features)
virtual void messageReceived(const QByteArray &) override
QQmlProfilerClient(QQmlProfilerClientPrivate &dd)
void onStateChanged(State status)
void sendRecordingStatus(int engineId=-1)
Combined button and popup list for selecting options.