History

Only whitespace changes

Dale Glass committed 4 years ago

Commit 87ba20e1 parent 3347cc524 files · +183 −183Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+15−15
@@ -139,7 +139,7 @@ static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine) { · 138 unmodified lines
139139 QString fileName = contextInfo.fileName();
140140 int lineNumber = contextInfo.lineNumber();
141141 QString functionName = contextInfo.functionName();
142−
142+
143143 location = functionName;
144144 if (!fileName.isEmpty()) {
145145 if (location.isEmpty()) {
@@ -155,10 +155,10 @@ static QScriptValue debugPrint(QScriptContext* context, QScriptEngine* engine) { · 9 unmodified lines
155155 if (location.isEmpty()) {
156156 location = scriptEngine->getFilename();
157157 }
158−
158+
159159 // give the script engine a chance to notify the system about this message
160160 scriptEngine->print(message);
161−
161+
162162 // send the message to debug log
163163 qCDebug(scriptengine_script, "[%s] %s", qUtf8Printable(location), qUtf8Printable(message));
164164 } else {
@@ -366,20 +366,20 @@ void ScriptEngine::executeOnScriptThread(std::function<void()> function, const Q · 201 unmodified lines
366366 void ScriptEngine::waitTillDoneRunning(bool shutdown) {
367367 // Engine should be stopped already, but be defensive
368368 stop();
369−
369+
370370 auto workerThread = thread();
371−
371+
372372 if (workerThread == QThread::currentThread()) {
373373 qCWarning(scriptengine) << "ScriptEngine::waitTillDoneRunning called, but the script is on the same thread:" << getFilename();
374374 return;
375375 }
376−
376+
377377 if (_isThreaded && workerThread) {
378378 // We should never be waiting (blocking) on our own thread
379379 assert(workerThread != QThread::currentThread());
380380
381381 #if 0
382− // 26 Feb 2021 - Disabled this OSX-specific code because it causes OSX to crash on shutdown; without this code, OSX
382+ // 26 Feb 2021 - Disabled this OSX-specific code because it causes OSX to crash on shutdown; without this code, OSX
383383 // doesn't crash on shutdown. Qt 5.12.3 and Qt 5.15.2.
384384 //
385385 // On mac, don't call QCoreApplication::processEvents() here. This is to prevent
@@ -1042,7 +1042,7 @@ void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& · 656 unmodified lines
10421042 };
10431043
10441044 /*@jsdoc
1045− * <p>The name of an entity event. When the entity event occurs, any function that has been registered for that event
1045+ * <p>The name of an entity event. When the entity event occurs, any function that has been registered for that event
10461046 * via {@link Script.addEventHandler} is called with parameters per the entity event.</p>
10471047 * <table>
10481048 * <thead>
@@ -1338,7 +1338,7 @@ void ScriptEngine::run() { · 289 unmodified lines
13381338
13391339 emit finished(_fileNameString, qSharedPointerCast<ScriptEngine>(sharedFromThis()));
13401340
1341− // Don't leave our local-file-access flag laying around, reset it to false when the scriptengine
1341+ // Don't leave our local-file-access flag laying around, reset it to false when the scriptengine
13421342 // thread is finished
13431343 hifi::scripting::setLocalAccessSafeThread(false);
13441344 _isRunning = false;
@@ -1852,7 +1852,7 @@ QScriptValue ScriptEngine::require(const QString& moduleId) { · 507 unmodified lines
18521852 // modules get cached in `Script.require.cache` and (similar to Node.js) users can access it
18531853 // to inspect particular entries and invalidate them by deleting the key:
18541854 // `delete Script.require.cache[Script.require.resolve(moduleId)];`
1855−
1855+
18561856 // Check to see if we should invalidate the cache based on a user setting.
18571857 Setting::Handle<bool> getCachebustSetting {"cachebustScriptRequire", false };
18581858
@@ -2390,25 +2390,25 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 531 unmodified lines
23902390
23912391 // Entity Script Whitelist toggle check.
23922392 Setting::Handle<bool> whitelistEnabled {"private/whitelistEnabled", false };
2393−
2393+
23942394 if (!whitelistEnabled.get()) {
23952395 passList = true;
23962396 }
2397−
2397+
23982398 // Pull SAFEURLS from the Interface.JSON settings.
23992399 QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
24002400 QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), Qt::SkipEmptyParts);
24012401 safeURLPrefixes += settingsSafeURLS;
24022402 // END Pull SAFEURLS from the Interface.JSON settings.
2403−
2403+
24042404 // Get current domain whitelist bypass, in case an entire domain is whitelisted.
24052405 QString currentDomain = DependencyManager::get<AddressManager>()->getDomainURL().host();
2406−
2406+
24072407 QString domainSafeIP = nodeList->getDomainHandler().getHostname();
24082408 QString domainSafeURL = URL_SCHEME_VIRCADIA + "://" + currentDomain;
24092409 for (const auto& str : safeURLPrefixes) {
24102410 if (domainSafeURL.startsWith(str) || domainSafeIP.startsWith(str)) {
2411− qCDebug(scriptengine) << whitelistPrefix << "Whitelist Bypassed, entire domain is whitelisted. Current Domain Host: "
2411+ qCDebug(scriptengine) << whitelistPrefix << "Whitelist Bypassed, entire domain is whitelisted. Current Domain Host: "
24122412 << nodeList->getDomainHandler().getHostname()
24132413 << "Current Domain: " << currentDomain;
24142414 passList = true;