aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-03-09 16:55:13 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-03-13 08:11:01 +0000
commita91b83c0bbafbdfb290f2766d51d12e805506e30 (patch)
tree79c0b1ca91d41b56fbc4c0c110688f36b6dda5af /src/qml/compiler/qv4compileddata.cpp
parent1ba5c5bb017237501fd8e1e97fc00b4817f19fa4 (diff)
Clean up type dependency hashing for QML caching
Instead of passing the engine parameter all the way through the data structure generator, along with the dependent type data structure that is unused otherwise, let's simply provide a function object for the dependency hashing. This is also in preparation for adding singleton types to the dependency hash. Task-number: QTBUG-58486 Change-Id: I5bb5e5c06b7b5c77195cec3da13141333cfea7a8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index d8ff22e9ed..b175abe1f5 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -310,10 +310,9 @@ void CompilationUnit::finalize(QQmlEnginePrivate *engine)
totalObjectCount = objectCount;
}
-bool CompilationUnit::verifyChecksum(QQmlEngine *engine,
- const ResolvedTypeReferenceMap &dependentTypes) const
+bool CompilationUnit::verifyChecksum(const DependentTypesHasher &dependencyHasher) const
{
- if (dependentTypes.isEmpty()) {
+ if (!dependencyHasher) {
for (size_t i = 0; i < sizeof(data->dependencyMD5Checksum); ++i) {
if (data->dependencyMD5Checksum[i] != 0)
return false;
@@ -321,7 +320,7 @@ bool CompilationUnit::verifyChecksum(QQmlEngine *engine,
return true;
}
QCryptographicHash hash(QCryptographicHash::Md5);
- if (!dependentTypes.addToHash(&hash, engine))
+ if (!dependencyHasher(&hash))
return false;
QByteArray checksum = hash.result();
Q_ASSERT(checksum.size() == sizeof(data->dependencyMD5Checksum));