зеркало из 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;
|
WorkerPrivate* mWorkerPrivate;
|
||||||
RefPtr<WorkerThread> mThread;
|
RefPtr<WorkerThread> mThread;
|
||||||
JSRuntime* mParentRuntime;
|
JSRuntime* mParentRuntime;
|
||||||
JS::UniqueChars mDefaultLocale;
|
|
||||||
|
|
||||||
class FinishedRunnable final : public Runnable
|
class FinishedRunnable final : public Runnable
|
||||||
{
|
{
|
||||||
|
@ -1012,10 +1011,8 @@ class WorkerThreadPrimaryRunnable final : public Runnable
|
||||||
public:
|
public:
|
||||||
WorkerThreadPrimaryRunnable(WorkerPrivate* aWorkerPrivate,
|
WorkerThreadPrimaryRunnable(WorkerPrivate* aWorkerPrivate,
|
||||||
WorkerThread* aThread,
|
WorkerThread* aThread,
|
||||||
JSRuntime* aParentRuntime,
|
JSRuntime* aParentRuntime)
|
||||||
JS::UniqueChars aDefaultLocale)
|
: mWorkerPrivate(aWorkerPrivate), mThread(aThread), mParentRuntime(aParentRuntime)
|
||||||
: mWorkerPrivate(aWorkerPrivate), mThread(aThread)
|
|
||||||
, mParentRuntime(aParentRuntime), mDefaultLocale(Move(aDefaultLocale))
|
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aWorkerPrivate);
|
MOZ_ASSERT(aWorkerPrivate);
|
||||||
MOZ_ASSERT(aThread);
|
MOZ_ASSERT(aThread);
|
||||||
|
@ -1629,16 +1626,9 @@ RuntimeService::ScheduleWorker(WorkerPrivate* aWorkerPrivate)
|
||||||
}
|
}
|
||||||
|
|
||||||
JSRuntime* rt = CycleCollectedJSRuntime::Get()->Runtime();
|
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 =
|
nsCOMPtr<nsIRunnable> runnable =
|
||||||
new WorkerThreadPrimaryRunnable(aWorkerPrivate, thread, parentRuntime,
|
new WorkerThreadPrimaryRunnable(aWorkerPrivate, thread,
|
||||||
Move(defaultLocale));
|
JS_GetParentRuntime(rt));
|
||||||
if (NS_FAILED(thread->DispatchPrimaryRunnable(friendKey, runnable.forget()))) {
|
if (NS_FAILED(thread->DispatchPrimaryRunnable(friendKey, runnable.forget()))) {
|
||||||
UnregisterWorker(aWorkerPrivate);
|
UnregisterWorker(aWorkerPrivate);
|
||||||
return false;
|
return false;
|
||||||
|
@ -2557,14 +2547,6 @@ WorkerThreadPrimaryRunnable::Run()
|
||||||
return NS_ERROR_FAILURE;
|
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
|
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||||
PseudoStack* stack = mozilla_get_pseudo_stack();
|
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 =
|
head =
|
||||||
tail =
|
tail =
|
||||||
skip-if = toolkit == 'gonk'
|
skip-if = toolkit == 'gonk'
|
||||||
support-files =
|
|
||||||
data/bug1174386_worker.js
|
|
||||||
data/chrome.manifest
|
|
||||||
|
|
||||||
[test_bug22310.js]
|
[test_bug22310.js]
|
||||||
skip-if = toolkit != "windows" && toolkit != "cocoa"
|
skip-if = toolkit != "windows" && toolkit != "cocoa"
|
||||||
|
@ -17,7 +14,6 @@ skip-if = toolkit == "windows" || toolkit == "cocoa"
|
||||||
skip-if = toolkit != "cocoa"
|
skip-if = toolkit != "cocoa"
|
||||||
|
|
||||||
[test_bug1086527.js]
|
[test_bug1086527.js]
|
||||||
[test_bug1174386.js]
|
|
||||||
[test_pluralForm.js]
|
[test_pluralForm.js]
|
||||||
[test_pluralForm_english.js]
|
[test_pluralForm_english.js]
|
||||||
[test_pluralForm_makeGetter.js]
|
[test_pluralForm_makeGetter.js]
|
||||||
|
|
|
@ -5819,16 +5819,6 @@ JS_SetDefaultLocale(JSContext* cx, const char* locale)
|
||||||
return cx->setDefaultLocale(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_PUBLIC_API(void)
|
||||||
JS_ResetDefaultLocale(JSContext* cx)
|
JS_ResetDefaultLocale(JSContext* cx)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5038,12 +5038,6 @@ JS_ParseJSONWithReviver(JSContext* cx, JS::HandleString str, JS::HandleValue rev
|
||||||
extern JS_PUBLIC_API(bool)
|
extern JS_PUBLIC_API(bool)
|
||||||
JS_SetDefaultLocale(JSContext* cx, const char* locale);
|
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.
|
* Reset the default locale to OS defaults.
|
||||||
*/
|
*/
|
||||||
|
|
Загрузка…
Ссылка в новой задаче