OpenCoverage

qqmltypeloader_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmltypeloader_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8class QQmlScriptData;-
9class QQmlScriptBlob;-
10class QQmlQmldirData;-
11class QQmlTypeLoader;-
12class QQmlComponentPrivate;-
13class QQmlTypeData;-
14class QQmlTypeLoader;-
15class QQmlExtensionInterface;-
16class QQmlProfiler;-
17struct QQmlCompileError;-
18-
19namespace QmlIR {-
20struct Document;-
21}-
22-
23class __attribute__((visibility("default"))) QQmlDataBlob : public QQmlRefCount-
24{-
25public:-
26 enum Status {-
27 Null,-
28 Loading,-
29 WaitingForDependencies,-
30 ResolvingDependencies,-
31 Complete,-
32 Error-
33 };-
34-
35 enum Type {-
36 QmlFile = QQmlAbstractUrlInterceptor::QmlFile,-
37 JavaScriptFile = QQmlAbstractUrlInterceptor::JavaScriptFile,-
38 QmldirFile = QQmlAbstractUrlInterceptor::QmldirFile-
39 };-
40-
41 QQmlDataBlob(const QUrl &, Type, QQmlTypeLoader* manager);-
42 ~QQmlDataBlob() override;-
43-
44 void startLoading();-
45-
46 QQmlTypeLoader *typeLoader() const { return
executed 489193 times by 142 tests: return m_typeLoader;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
m_typeLoader;
executed 489193 times by 142 tests: return m_typeLoader;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
}
489193
47-
48 Type type() const;-
49-
50 Status status() const;-
51 bool isNull() const;-
52 bool isLoading() const;-
53 bool isWaiting() const;-
54 bool isComplete() const;-
55 bool isError() const;-
56 bool isCompleteOrError() const;-
57-
58 qreal progress() const;-
59-
60 QUrl url() const;-
61 QString urlString() const;-
62 QUrl finalUrl() const;-
63 QString finalUrlString() const;-
64-
65 QList<QQmlError> errors() const;-
66-
67 class SourceCodeData {-
68 public:-
69 QString readAll(QString *error) const;-
70 QDateTime sourceTimeStamp() const;-
71 bool exists() const;-
72 bool isEmpty() const;-
73 private:-
74 friend class QQmlDataBlob;-
75 friend class QQmlTypeLoader;-
76 QString inlineSourceCode;-
77 QFileInfo fileInfo;-
78 bool hasInlineSourceCode = false;-
79 };-
80-
81protected:-
82-
83 void setError(const QQmlError &);-
84 void setError(const QList<QQmlError> &errors);-
85 void setError(const QQmlCompileError &error);-
86 void setError(const QVector<QQmlCompileError> &errors);-
87 void setError(const QString &description);-
88 void addDependency(QQmlDataBlob *);-
89-
90-
91 virtual void dataReceived(const SourceCodeData &) = 0;-
92 virtual void initializeFromCachedUnit(const QV4::CompiledData::Unit*) = 0;-
93 virtual void done();-
94-
95 virtual void networkError(QNetworkReply::NetworkError);-
96-
97 virtual void dependencyError(QQmlDataBlob *);-
98 virtual void dependencyComplete(QQmlDataBlob *);-
99 virtual void allDependenciesDone();-
100-
101-
102 virtual void downloadProgressChanged(qreal);-
103 virtual void completed();-
104-
105protected:-
106-
107 QQmlTypeLoader *m_typeLoader;-
108-
109private:-
110 friend class QQmlTypeLoader;-
111 friend class QQmlTypeLoaderThread;-
112-
113 void tryDone();-
114 void cancelAllWaitingFor();-
115 void notifyAllWaitingOnMe();-
116 void notifyComplete(QQmlDataBlob *);-
117-
118 struct ThreadData {-
119 inline ThreadData();-
120 inline QQmlDataBlob::Status status() const;-
121 inline void setStatus(QQmlDataBlob::Status);-
122 inline bool isAsync() const;-
123 inline void setIsAsync(bool);-
124 inline quint8 progress() const;-
125 inline void setProgress(quint8);-
126-
127 private:-
128 QAtomicInt _p;-
129 };-
130 ThreadData m_data;-
131-
132-
133-
134-
135-
136 QList<QQmlError> m_errors;-
137-
138 Type m_type;-
139-
140 QUrl m_url;-
141 QUrl m_finalUrl;-
142 mutable QString m_urlString;-
143 mutable QString m_finalUrlString;-
144-
145-
146 QList<QQmlDataBlob *> m_waitingOnMe;-
147-
148-
149 QVector<QQmlRefPointer<QQmlDataBlob>> m_waitingFor;-
150-
151 int m_redirectCount:30;-
152 bool m_inCallback:1;-
153 bool m_isDone:1;-
154};-
155-
156class QQmlTypeLoaderThread;-
157-
158class QQmlTypeLoaderQmldirContent-
159{-
160private:-
161 friend class QQmlTypeLoader;-
162-
163 void setContent(const QString &location, const QString &content);-
164 void setError(const QQmlError &);-
165-
166public:-
167 QQmlTypeLoaderQmldirContent();-
168 QQmlTypeLoaderQmldirContent(const QQmlTypeLoaderQmldirContent &) = default;-
169 QQmlTypeLoaderQmldirContent &operator=(const QQmlTypeLoaderQmldirContent &) = default;-
170-
171 bool hasContent() const { return
executed 171259 times by 141 tests: return m_hasContent;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
m_hasContent;
executed 171259 times by 141 tests: return m_hasContent;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
}
171259
172 bool hasError() const;-
173 QList<QQmlError> errors(const QString &uri) const;-
174-
175 QString typeNamespace() const;-
176-
177 QQmlDirComponents components() const;-
178 QQmlDirScripts scripts() const;-
179 QQmlDirPlugins plugins() const;-
180-
181 QString pluginLocation() const;-
182-
183 bool designerSupported() const;-
184-
185private:-
186 QQmlDirParser m_parser;-
187 QString m_location;-
188 bool m_hasContent = false;-
189};-
190-
191class __attribute__((visibility("default"))) QQmlTypeLoader-
192{-
193 public: static inline QString tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate("QQmlTypeLoader", sourceText, disambiguation, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate("QQmlTypeLoader", sourceText, disambiguation, n); } private:-
194public:-
195 enum Mode { PreferSynchronous, Asynchronous, Synchronous };-
196-
197 class __attribute__((visibility("default"))) Blob : public QQmlDataBlob-
198 {-
199 public:-
200 Blob(const QUrl &url, QQmlDataBlob::Type type, QQmlTypeLoader *loader);-
201 ~Blob() override;-
202-
203 const QQmlImports &imports() const { return
executed 145432 times by 142 tests: return m_importCache;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
m_importCache;
executed 145432 times by 142 tests: return m_importCache;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
}
145432
204-
205 void setCachedUnitStatus(QQmlMetaType::CachedUnitLookupError status) { m_cachedUnitStatus = status; }
executed 9660 times by 128 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
9660
206-
207 protected:-
208 bool addImport(const QV4::CompiledData::Import *import, QList<QQmlError> *errors);-
209-
210 bool fetchQmldir(const QUrl &url, const QV4::CompiledData::Import *import, int priority, QList<QQmlError> *errors);-
211 bool updateQmldir(const QQmlRefPointer<QQmlQmldirData> &data, const QV4::CompiledData::Import *import, QList<QQmlError> *errors);-
212-
213 private:-
214 virtual bool qmldirDataAvailable(const QQmlRefPointer<QQmlQmldirData> &, QList<QQmlError> *);-
215-
216 virtual void scriptImported(const QQmlRefPointer<QQmlScriptBlob> &, const QV4::CompiledData::Location &, const QString &, const QString &) {}-
217-
218 void dependencyComplete(QQmlDataBlob *) override;-
219-
220 protected:-
221 virtual QString stringAt(int) const { return
never executed: return QString();
QString();
never executed: return QString();
}
0
222-
223 bool isDebugging() const;-
224-
225 QQmlImports m_importCache;-
226 QHash<const QV4::CompiledData::Import*, int> m_unresolvedImports;-
227 QVector<QQmlRefPointer<QQmlQmldirData>> m_qmldirs;-
228 QQmlMetaType::CachedUnitLookupError m_cachedUnitStatus = QQmlMetaType::CachedUnitLookupError::NoError;-
229 };-
230-
231 QQmlTypeLoader(QQmlEngine *);-
232 ~QQmlTypeLoader();-
233-
234 QQmlImportDatabase *importDatabase() const;-
235-
236 static QUrl normalize(const QUrl &unNormalizedUrl);-
237-
238 QQmlRefPointer<QQmlTypeData> getType(const QUrl &unNormalizedUrl, Mode mode = PreferSynchronous);-
239 QQmlRefPointer<QQmlTypeData> getType(const QByteArray &, const QUrl &url, Mode mode = PreferSynchronous);-
240-
241 QQmlRefPointer<QQmlScriptBlob> getScript(const QUrl &unNormalizedUrl);-
242 QQmlRefPointer<QQmlQmldirData> getQmldir(const QUrl &);-
243-
244 QString absoluteFilePath(const QString &path);-
245 bool directoryExists(const QString &path);-
246-
247 const QQmlTypeLoaderQmldirContent qmldirContent(const QString &filePath);-
248 void setQmldirContent(const QString &filePath, const QString &content);-
249-
250 void clearCache();-
251 void trimCache();-
252-
253 bool isTypeLoaded(const QUrl &url) const;-
254 bool isScriptLoaded(const QUrl &url) const;-
255-
256 void lock() { m_mutex.lock(); }
executed 687506 times by 142 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
687506
257 void unlock() { m_mutex.unlock(); }
executed 687506 times by 142 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
687506
258-
259 void load(QQmlDataBlob *, Mode = PreferSynchronous);-
260 void loadWithStaticData(QQmlDataBlob *, const QByteArray &, Mode = PreferSynchronous);-
261 void loadWithCachedUnit(QQmlDataBlob *blob, const QV4::CompiledData::Unit *unit, Mode mode = PreferSynchronous);-
262-
263 QQmlEngine *engine() const;-
264 void initializeEngine(QQmlExtensionInterface *, const char *);-
265 void invalidate();-
266-
267-
268-
269-
270-
271 QQmlProfiler *profiler() const { return
executed 55623 times by 142 tests: return m_profiler.data();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
m_profiler.data();
executed 55623 times by 142 tests: return m_profiler.data();
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
}
55623
272 void setProfiler(QQmlProfiler *profiler);-
273-
274-
275-
276private:-
277 friend class QQmlDataBlob;-
278 friend class QQmlTypeLoaderThread;-
279-
280 friend class QQmlTypeLoaderNetworkReplyProxy;-
281-
282-
283 void shutdownThread();-
284-
285 void loadThread(QQmlDataBlob *);-
286 void loadWithStaticDataThread(QQmlDataBlob *, const QByteArray &);-
287 void loadWithCachedUnitThread(QQmlDataBlob *blob, const QV4::CompiledData::Unit *unit);-
288-
289 void networkReplyFinished(QNetworkReply *);-
290 void networkReplyProgress(QNetworkReply *, qint64, qint64);-
291-
292 typedef QHash<QNetworkReply *, QQmlDataBlob *> NetworkReplies;-
293-
294-
295 void setData(QQmlDataBlob *, const QByteArray &);-
296 void setData(QQmlDataBlob *, const QString &fileName);-
297 void setData(QQmlDataBlob *, const QQmlDataBlob::SourceCodeData &);-
298 void setCachedUnit(QQmlDataBlob *blob, const QV4::CompiledData::Unit *unit);-
299-
300 template<typename T>-
301 struct TypedCallback-
302 {-
303 TypedCallback(T *object, void (T::*func)(QQmlTypeData *)) : o(object), mf(func) {}
never executed: end of block
0
304-
305 static void redirect(void *arg, QQmlTypeData *type)-
306 {-
307 TypedCallback<T> *self = reinterpret_cast<TypedCallback<T> *>(arg);-
308 ((self->o)->*(self->mf))(type);-
309 }
never executed: end of block
0
310-
311 private:-
312 T *o;-
313 void (T::*mf)(QQmlTypeData *);-
314 };-
315-
316 typedef QHash<QUrl, QQmlTypeData *> TypeCache;-
317 typedef QHash<QUrl, QQmlScriptBlob *> ScriptCache;-
318 typedef QHash<QUrl, QQmlQmldirData *> QmldirCache;-
319 typedef QCache<QString, QCache<QString, bool> > ImportDirCache;-
320 typedef QStringHash<QQmlTypeLoaderQmldirContent *> ImportQmlDirCache;-
321-
322 QQmlEngine *m_engine;-
323 QQmlTypeLoaderThread *m_thread;-
324 QMutex &m_mutex;-
325-
326-
327 QScopedPointer<QQmlProfiler> m_profiler;-
328-
329-
330-
331 NetworkReplies m_networkReplies;-
332-
333 TypeCache m_typeCache;-
334 int m_typeCacheTrimThreshold;-
335 ScriptCache m_scriptCache;-
336 QmldirCache m_qmldirCache;-
337 ImportDirCache m_importDirCache;-
338 ImportQmlDirCache m_importQmlDirCache;-
339-
340 template<typename Loader>-
341 void doLoad(const Loader &loader, QQmlDataBlob *blob, Mode mode);-
342 void updateTypeCacheTrimThreshold();-
343-
344 friend struct PlainLoader;-
345 friend struct CachedLoader;-
346 friend struct StaticLoader;-
347};-
348-
349class __attribute__((visibility("default"))) QQmlTypeData : public QQmlTypeLoader::Blob-
350{-
351 public: static inline QString tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate("QQmlTypeData", sourceText, disambiguation, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate("QQmlTypeData", sourceText, disambiguation, n); } private:-
352public:-
353 struct TypeReference-
354 {-
355 TypeReference() : majorVersion(0), minorVersion(0), needsCreation(true) {}
executed 77697 times by 142 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
77697
356-
357 QV4::CompiledData::Location location;-
358 QQmlType type;-
359 int majorVersion;-
360 int minorVersion;-
361 QQmlRefPointer<QQmlTypeData> typeData;-
362 QString prefix;-
363 QString qualifiedName() const;-
364 bool needsCreation;-
365 };-
366-
367 struct ScriptReference-
368 {-
369 QV4::CompiledData::Location location;-
370 QString qualifier;-
371 QQmlRefPointer<QQmlScriptBlob> script;-
372 };-
373-
374private:-
375 friend class QQmlTypeLoader;-
376-
377 QQmlTypeData(const QUrl &, QQmlTypeLoader *);-
378-
379public:-
380 ~QQmlTypeData() override;-
381-
382 const QList<ScriptReference> &resolvedScripts() const;-
383-
384 QV4::CompiledData::CompilationUnit *compilationUnit() const;-
385-
386-
387 struct TypeDataCallback {-
388 virtual ~TypeDataCallback();-
389 virtual void typeDataProgress(QQmlTypeData *, qreal) {}-
390 virtual void typeDataReady(QQmlTypeData *) {}-
391 };-
392 void registerCallback(TypeDataCallback *);-
393 void unregisterCallback(TypeDataCallback *);-
394-
395protected:-
396 void done() override;-
397 void completed() override;-
398 void dataReceived(const SourceCodeData &) override;-
399 void initializeFromCachedUnit(const QV4::CompiledData::Unit *unit) override;-
400 void allDependenciesDone() override;-
401 void downloadProgressChanged(qreal) override;-
402-
403 QString stringAt(int index) const override;-
404-
405private:-
406 bool tryLoadFromDiskCache();-
407 bool loadFromSource();-
408 void restoreIR(QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit);-
409 void continueLoadFromIR();-
410 void resolveTypes();-
411 QQmlCompileError buildTypeResolutionCaches(-
412 QQmlRefPointer<QQmlTypeNameCache> *typeNameCache,-
413 QV4::CompiledData::ResolvedTypeReferenceMap *resolvedTypeCache-
414 ) const;-
415 void compile(const QQmlRefPointer<QQmlTypeNameCache> &typeNameCache,-
416 const QV4::CompiledData::ResolvedTypeReferenceMap &resolvedTypeCache, const QV4::CompiledData::DependentTypesHasher &dependencyHasher);-
417 void createTypeAndPropertyCaches(const QQmlRefPointer<QQmlTypeNameCache> &typeNameCache,-
418 const QV4::CompiledData::ResolvedTypeReferenceMap &resolvedTypeCache);-
419 bool resolveType(const QString &typeName, int &majorVersion, int &minorVersion,-
420 TypeReference &ref, int lineNumber = -1, int columnNumber = -1,-
421 bool reportErrors = true,-
422 QQmlType::RegistrationType registrationType = QQmlType::AnyRegistrationType);-
423-
424 void scriptImported(const QQmlRefPointer<QQmlScriptBlob> &blob, const QV4::CompiledData::Location &location, const QString &qualifier, const QString &nameSpace) override;-
425-
426-
427 SourceCodeData m_backupSourceCode;-
428 QScopedPointer<QmlIR::Document> m_document;-
429 QV4::CompiledData::TypeReferenceMap m_typeReferences;-
430-
431 QList<ScriptReference> m_scripts;-
432-
433 QSet<QString> m_namespaces;-
434 QList<TypeReference> m_compositeSingletons;-
435-
436-
437-
438-
439 QMap<int, TypeReference> m_resolvedTypes;-
440 bool m_typesResolved:1;-
441-
442 QQmlRefPointer<QV4::CompiledData::CompilationUnit> m_compiledData;-
443-
444 QList<TypeDataCallback *> m_callbacks;-
445-
446 bool m_implicitImportLoaded;-
447 bool loadImplicitImport();-
448};-
449class __attribute__((visibility("default"))) QQmlScriptData : public QQmlCleanup, public QQmlRefCount-
450{-
451private:-
452 friend class QQmlTypeLoader;-
453-
454 QQmlScriptData();-
455-
456public:-
457 ~QQmlScriptData() override;-
458-
459 QUrl url;-
460 QString urlString;-
461 QQmlTypeNameCache *typeNameCache;-
462 QVector<QQmlRefPointer<QQmlScriptBlob>> scripts;-
463-
464 QV4::ReturnedValue scriptValueForContext(QQmlContextData *parentCtxt);-
465-
466protected:-
467 void clear() override;-
468-
469private:-
470 friend class QQmlScriptBlob;-
471-
472 void initialize(QQmlEngine *);-
473-
474 bool m_loaded;-
475 QQmlRefPointer<QV4::CompiledData::CompilationUnit> m_precompiledScript;-
476 QV4::Script *m_program;-
477 QV4::PersistentValue m_value;-
478};-
479-
480class __attribute__((visibility("default"))) QQmlScriptBlob : public QQmlTypeLoader::Blob-
481{-
482private:-
483 friend class QQmlTypeLoader;-
484-
485 QQmlScriptBlob(const QUrl &, QQmlTypeLoader *);-
486-
487public:-
488 ~QQmlScriptBlob() override;-
489-
490 struct ScriptReference-
491 {-
492 QV4::CompiledData::Location location;-
493 QString qualifier;-
494 QString nameSpace;-
495 QQmlRefPointer<QQmlScriptBlob> script;-
496 };-
497-
498 QQmlRefPointer<QQmlScriptData> scriptData() const;-
499-
500protected:-
501 void dataReceived(const SourceCodeData &) override;-
502 void initializeFromCachedUnit(const QV4::CompiledData::Unit *unit) override;-
503 void done() override;-
504-
505 QString stringAt(int index) const override;-
506-
507private:-
508 void scriptImported(const QQmlRefPointer<QQmlScriptBlob> &blob, const QV4::CompiledData::Location &location, const QString &qualifier, const QString &nameSpace) override;-
509 void initializeFromCompilationUnit(const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &unit);-
510-
511 QList<ScriptReference> m_scripts;-
512 QQmlRefPointer<QQmlScriptData> m_scriptData;-
513};-
514-
515class __attribute__((visibility("default"))) QQmlQmldirData : public QQmlTypeLoader::Blob-
516{-
517private:-
518 friend class QQmlTypeLoader;-
519-
520 QQmlQmldirData(const QUrl &, QQmlTypeLoader *);-
521-
522public:-
523 const QString &content() const;-
524-
525 const QV4::CompiledData::Import *import(QQmlTypeLoader::Blob *) const;-
526 void setImport(QQmlTypeLoader::Blob *, const QV4::CompiledData::Import *);-
527-
528 int priority(QQmlTypeLoader::Blob *) const;-
529 void setPriority(QQmlTypeLoader::Blob *, int);-
530-
531protected:-
532 void dataReceived(const SourceCodeData &) override;-
533 void initializeFromCachedUnit(const QV4::CompiledData::Unit *) override;-
534-
535private:-
536 QString m_content;-
537 QHash<QQmlTypeLoader::Blob *, const QV4::CompiledData::Import *> m_imports;-
538 QHash<QQmlTypeLoader::Blob *, int> m_priorities;-
539};-
540-
541-
542-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0