forked from qt-creator/qt-creator
Tracing: Move the type storage out of the trace manager
When we replay events we want to keep this constant and pass it to the event receivers as separate entity. This way we can move the replaying to a separate thread. When loading we will have a similar situation, but then the loading thread will create a new type storage and later assign that to the trace manager. Change-Id: I11402ed1e0663da6da5b61b15bba40e1a62adc4b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -109,8 +109,9 @@ int QmlProfilerTraceClientPrivate::resolveType(const QmlTypedEvent &event)
|
||||
if (it != serverTypeIds.constEnd()) {
|
||||
typeIndex = it.value();
|
||||
} else {
|
||||
typeIndex = modelManager->numEventTypes();
|
||||
modelManager->addEventType(event.type);
|
||||
// We can potentially move the type away here, as we don't need to access it anymore,
|
||||
// but that requires some more refactoring.
|
||||
typeIndex = modelManager->appendEventType(QmlEventType(event.type));
|
||||
serverTypeIds[event.serverTypeId] = typeIndex;
|
||||
}
|
||||
} else {
|
||||
@@ -119,8 +120,7 @@ int QmlProfilerTraceClientPrivate::resolveType(const QmlTypedEvent &event)
|
||||
if (it != eventTypeIds.constEnd()) {
|
||||
typeIndex = it.value();
|
||||
} else {
|
||||
typeIndex = modelManager->numEventTypes();
|
||||
modelManager->addEventType(event.type);
|
||||
typeIndex = modelManager->appendEventType(QmlEventType(event.type));
|
||||
eventTypeIds[event.type] = typeIndex;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user