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 , maximumTime(0)
40 , recording(false)
41 , requestedFeatures(0)
42 , recordedFeatures(0)
43 , flushInterval(0)
44 {
45 }
46
47 ~QQmlProfilerClientPrivate() override;
48
49 void sendRecordingStatus(int engineId);
50 bool updateFeatures(ProfileFeature feature);
51 int resolveType(const QQmlProfilerTypedEvent &type);
52 int resolveStackTop();
53 void forwardEvents(const QQmlProfilerEvent &last);
54 void forwardDebugMessages(qint64 untilTimestamp);
55 void processCurrentEvent();
56 void finalize();
57
58 QQmlProfilerEventReceiver *eventReceiver;
59 QScopedPointer<QQmlEngineControlClient> engineControl;
60 QScopedPointer<QQmlDebugMessageClient> messageClient;
61 qint64 maximumTime;
62 bool recording;
63 quint64 requestedFeatures;
64 quint64 recordedFeatures;
65 quint32 flushInterval;
66
67 // Reuse the same event, so that we don't have to constantly reallocate all the data.
68 QQmlProfilerTypedEvent currentEvent;
69 QHash<QQmlProfilerEventType, int> eventTypeIds;
70 QHash<qint64, int> serverTypeIds;
71 QStack<QQmlProfilerTypedEvent> rangesInProgress;
72 QQueue<QQmlProfilerEvent> pendingMessages;
73 QQueue<QQmlProfilerEvent> pendingDebugMessages;
74
75 QList<int> trackedEngines;
76};
77
78QT_END_NAMESPACE
79
80#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.