зеркало из https://github.com/mozilla/gecko-dev.git
Back out 2 changesets (bug 1174386) for mochitest and xpcshell bustage.
Backed out changeset 71634609bbaf (bug 1174386) Backed out changeset 9726b95aadf6 (bug 1174386) MozReview-Commit-ID: CBB0CFQSjQu
This commit is contained in:
Родитель
23ed88ef86
Коммит
edd0c6d29f
|
@ -987,7 +987,6 @@ class WorkerThreadPrimaryRunnable final : public Runnable
|
|||
WorkerPrivate* mWorkerPrivate;
|
||||
RefPtr<WorkerThread> mThread;
|
||||
JSRuntime* mParentRuntime;
|
||||
JS::UniqueChars mDefaultLocale;
|
||||
|
||||
class FinishedRunnable final : public Runnable
|
||||
{
|
||||
|
@ -1012,10 +1011,8 @@ class WorkerThreadPrimaryRunnable final : public Runnable
|
|||
public:
|
||||
WorkerThreadPrimaryRunnable(WorkerPrivate* aWorkerPrivate,
|
||||
WorkerThread* aThread,
|
||||
JSRuntime* aParentRuntime,
|
||||
JS::UniqueChars aDefaultLocale)
|
||||
: mWorkerPrivate(aWorkerPrivate), mThread(aThread)
|
||||
, mParentRuntime(aParentRuntime), mDefaultLocale(Move(aDefaultLocale))
|
||||
JSRuntime* aParentRuntime)
|
||||
: mWorkerPrivate(aWorkerPrivate), mThread(aThread), mParentRuntime(aParentRuntime)
|
||||
{
|
||||
MOZ_ASSERT(aWorkerPrivate);
|
||||
MOZ_ASSERT(aThread);
|
||||
|
@ -1629,16 +1626,9 @@ RuntimeService::ScheduleWorker(WorkerPrivate* aWorkerPrivate)
|
|||
}
|
||||
|
||||
JSRuntime* rt = CycleCollectedJSRuntime::Get()->Runtime();
|
||||
JSRuntime* parentRuntime = JS_GetParentRuntime(rt);
|
||||
JS::UniqueChars defaultLocale =
|
||||
parentRuntime ? JS_GetDefaultLocale(JS_GetContext(parentRuntime)) : nullptr;
|
||||
if (!parentRuntime) {
|
||||
NS_WARNING("Could not obtain parent runtime's locale!");
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
new WorkerThreadPrimaryRunnable(aWorkerPrivate, thread, parentRuntime,
|
||||
Move(defaultLocale));
|
||||
new WorkerThreadPrimaryRunnable(aWorkerPrivate, thread,
|
||||
JS_GetParentRuntime(rt));
|
||||
if (NS_FAILED(thread->DispatchPrimaryRunnable(friendKey, runnable.forget()))) {
|
||||
UnregisterWorker(aWorkerPrivate);
|
||||
return false;
|
||||
|
@ -2557,14 +2547,6 @@ WorkerThreadPrimaryRunnable::Run()
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (mDefaultLocale) {
|
||||
if (!JS_SetDefaultLocale(cx, mDefaultLocale.get())) {
|
||||
NS_WARNING("Could not set worker locale!");
|
||||
}
|
||||
|
||||
mDefaultLocale = nullptr;
|
||||
}
|
||||
|
||||
{
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
PseudoStack* stack = mozilla_get_pseudo_stack();
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
self.onmessage = function (data) {
|
||||
let myLocale = Intl.NumberFormat().resolvedOptions().locale;
|
||||
self.postMessage(myLocale);
|
||||
};
|
||||
|
|
@ -1 +0,0 @@
|
|||
content locale ./
|
|
@ -1,12 +0,0 @@
|
|||
function run_test() {
|
||||
do_load_manifest("data/chrome.manifest");
|
||||
do_test_pending();
|
||||
let mainThreadLocale = Intl.NumberFormat().resolvedOptions().locale;
|
||||
let testWorker = new Worker("chrome://locale/content/bug1174386_worker.js");
|
||||
testWorker.onmessage = function (e) {
|
||||
let workerLocale = e.data;
|
||||
equal(mainThreadLocale, workerLocale, "Worker should inherit Intl locale from main thread.");
|
||||
do_test_finished();
|
||||
};
|
||||
testWorker.postMessage("go!");
|
||||
}
|
|
@ -2,9 +2,6 @@
|
|||
head =
|
||||
tail =
|
||||
skip-if = toolkit == 'gonk'
|
||||
support-files =
|
||||
data/bug1174386_worker.js
|
||||
data/chrome.manifest
|
||||
|
||||
[test_bug22310.js]
|
||||
skip-if = toolkit != "windows" && toolkit != "cocoa"
|
||||
|
@ -17,7 +14,6 @@ skip-if = toolkit == "windows" || toolkit == "cocoa"
|
|||
skip-if = toolkit != "cocoa"
|
||||
|
||||
[test_bug1086527.js]
|
||||
[test_bug1174386.js]
|
||||
[test_pluralForm.js]
|
||||
[test_pluralForm_english.js]
|
||||
[test_pluralForm_makeGetter.js]
|
||||
|
|
|
@ -5819,16 +5819,6 @@ JS_SetDefaultLocale(JSContext* cx, const char* locale)
|
|||
return cx->setDefaultLocale(locale);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(UniqueChars)
|
||||
JS_GetDefaultLocale(JSContext* cx)
|
||||
{
|
||||
AssertHeapIsIdle(cx);
|
||||
if (const char* locale = cx->getDefaultLocale())
|
||||
return UniqueChars(JS_strdup(cx, locale));
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS_ResetDefaultLocale(JSContext* cx)
|
||||
{
|
||||
|
|
|
@ -5038,12 +5038,6 @@ JS_ParseJSONWithReviver(JSContext* cx, JS::HandleString str, JS::HandleValue rev
|
|||
extern JS_PUBLIC_API(bool)
|
||||
JS_SetDefaultLocale(JSContext* cx, const char* locale);
|
||||
|
||||
/**
|
||||
* Look up the default locale for the ECMAScript Internationalization API.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JS::UniqueChars)
|
||||
JS_GetDefaultLocale(JSContext* cx);
|
||||
|
||||
/**
|
||||
* Reset the default locale to OS defaults.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче