Showing the changes to libraries/script-engine/src/ScriptCache.h (1 of 2 files). Show all
Unified · Split
| @@ -12,6 +12,7 @@ · 11 unmodified lines | |||
| 12 | #ifndef hifi_ScriptCache_h | 12 | #ifndef hifi_ScriptCache_h |
| 13 | #define hifi_ScriptCache_h | 13 | #define hifi_ScriptCache_h |
| 14 | 14 | ||
| 15 | #include <mutex> | ||
| 15 | #include <ResourceCache.h> | 16 | #include <ResourceCache.h> |
| 16 | 17 | ||
| 17 | class ScriptUser { | 18 | class ScriptUser { |
| @@ -27,6 +28,9 @@ class ScriptCache : public QObject, public Dependency { · 9 unmodified lines | |||
| 27 | Q_OBJECT | 28 | Q_OBJECT |
| 28 | SINGLETON_DEPENDENCY | 29 | SINGLETON_DEPENDENCY |
| 29 | 30 | ||
| 31 | using Mutex = std::mutex; | ||
| 32 | using Lock = std::unique_lock<Mutex>; | ||
| 33 | |||
| 30 | public: | 34 | public: |
| 31 | void clearCache(); | 35 | void clearCache(); |
| 32 | void getScriptContents(const QString& scriptOrURL, contentAvailableCallback contentAvailable, bool forceDownload = false); | 36 | void getScriptContents(const QString& scriptOrURL, contentAvailableCallback contentAvailable, bool forceDownload = false); |
| @@ -46,6 +50,7 @@ private slots: · 13 unmodified lines | |||
| 46 | private: | 50 | private: |
| 47 | ScriptCache(QObject* parent = NULL); | 51 | ScriptCache(QObject* parent = NULL); |
| 48 | 52 | ||
| 53 | Mutex _containerLock; | ||
| 49 | QMultiMap<QUrl, contentAvailableCallback> _contentCallbacks; | 54 | QMultiMap<QUrl, contentAvailableCallback> _contentCallbacks; |
| 50 | 55 | ||
| 51 | QHash<QUrl, QString> _scriptCache; | 56 | QHash<QUrl, QString> _scriptCache; |