History

make ResourceManager be owned by DependencyManager

Seth Alves committed 9 years ago

Commit 794495c1 parent 561786023 files · +68 −65Browse files

Showing the changes to libraries/script-engine/src/ScriptCache.cpp (1 of 23 files). Show all

Unified · Split

libraries/script-engine/src/ScriptCache.cpp+4−4
@@ -57,7 +57,7 @@ void ScriptCache::clearATPScriptsFromCache() { · 56 unmodified lines
5757 }
5858
5959 void ScriptCache::deleteScript(const QUrl& unnormalizedURL) {
60− QUrl url = ResourceManager::normalizeURL(unnormalizedURL);
60+ QUrl url = DependencyManager::get<ResourceManager>()->normalizeURL(unnormalizedURL);
6161 Lock lock(_containerLock);
6262 if (_scriptCache.contains(url)) {
6363 qCDebug(scriptengine) << "Delete script from cache:" << url.toString();
@@ -70,7 +70,7 @@ void ScriptCache::getScriptContents(const QString& scriptOrURL, contentAvailable · 6 unmodified lines
7070 qCDebug(scriptengine) << "ScriptCache::getScriptContents() on thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]";
7171 #endif
7272 QUrl unnormalizedURL(scriptOrURL);
73− QUrl url = ResourceManager::normalizeURL(unnormalizedURL);
73+ QUrl url = DependencyManager::get<ResourceManager>()->normalizeURL(unnormalizedURL);
7474
7575 // attempt to determine if this is a URL to a script, or if this is actually a script itself (which is valid in the
7676 // entityScript use case)
@@ -109,7 +109,7 @@ void ScriptCache::getScriptContents(const QString& scriptOrURL, contentAvailable · 32 unmodified lines
109109 #ifdef THREAD_DEBUGGING
110110 qCDebug(scriptengine) << "about to call: ResourceManager::createResourceRequest(this, url); on thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]";
111111 #endif
112− auto request = ResourceManager::createResourceRequest(nullptr, url);
112+ auto request = DependencyManager::get<ResourceManager>()->createResourceRequest(nullptr, url);
113113 Q_ASSERT(request);
114114 request->setCacheEnabled(!forceDownload);
115115 connect(request, &ResourceRequest::finished, this, [=]{ scriptContentAvailable(maxRetries); });
@@ -166,7 +166,7 @@ void ScriptCache::scriptContentAvailable(int maxRetries) { · 50 unmodified lines
166166 qCDebug(scriptengine) << QString("Retrying script request [%1 / %2]: %3")
167167 .arg(attempt).arg(maxRetries).arg(url.toString());
168168
169− auto request = ResourceManager::createResourceRequest(nullptr, url);
169+ auto request = DependencyManager::get<ResourceManager>()->createResourceRequest(nullptr, url);
170170 Q_ASSERT(request);
171171
172172 // We've already made a request, so the cache must be disabled or it wasn't there, so enabling