Backed out changeset 5e45ffaf38e9 (bug 1627460) for causing crash in test_importScripts.html

This commit is contained in:
Noemi Erli
2020-04-08 14:21:44 +03:00
parent 65e0da5043
commit f98760f1d8
2 changed files with 2 additions and 18 deletions

View File

@@ -37,7 +37,6 @@
#include "mozilla/dom/WorkerNavigator.h"
#include "mozilla/dom/cache/CacheStorage.h"
#include "mozilla/StorageAccess.h"
#include "GeckoProfiler.h"
#include "nsContentUtils.h"
#include "nsJSUtils.h"
#include "nsServiceManagerUtils.h"
@@ -287,20 +286,8 @@ void WorkerGlobalScope::ImportScripts(JSContext* aCx,
stack = GetCurrentStackForNetMonitor(aCx);
}
{
#ifdef MOZ_GECKO_PROFILER
nsCString urls = NS_ConvertUTF16toUTF8(aScriptURLs[0]);
const uint32_t urlCount = aScriptURLs.Length();
for (uint32_t index = 1; index < urlCount; index++) {
urls.AppendLiteral(",");
urls.Append(NS_ConvertUTF16toUTF8(aScriptURLs[index]));
}
AUTO_PROFILER_TEXT_MARKER_CAUSE("ImportScripts", urls, JS, Nothing(),
profiler_get_backtrace());
#endif
workerinternals::Load(mWorkerPrivate, std::move(stack), aScriptURLs,
WorkerScript, aRv);
}
workerinternals::Load(mWorkerPrivate, std::move(stack), aScriptURLs,
WorkerScript, aRv);
}
int32_t WorkerGlobalScope::SetTimeout(JSContext* aCx, Function& aHandler,

View File

@@ -88,7 +88,6 @@
* @return {*} An object containing the properties exported by the module.
*/
return function require(path) {
let startTime = performance.now();
if (typeof path != "string" || !path.includes("://")) {
throw new TypeError(
"The argument to require() must be a string uri, got " + path
@@ -147,8 +146,6 @@
// after all.
modules.delete(path);
throw ex;
} finally {
ChromeUtils.addProfilerMarker("require", startTime, path);
}
Object.freeze(module.exports);