Bug 1078163 - WorkerNavigator strings should honor general.*.override prefs in e10s mode, r=khuey

This commit is contained in:
Andrea Marchesini 2014-10-08 13:56:50 +01:00
parent 917934b1e1
commit bee67f1318
2 changed files with 10 additions and 18 deletions

View File

@ -371,6 +371,8 @@ Navigator::GetAcceptLanguages(nsTArray<nsString>& aLanguages)
{
MOZ_ASSERT(NS_IsMainThread());
aLanguages.Clear();
// E.g. "de-de, en-us,en".
const nsAdoptingString& acceptLang =
Preferences::GetLocalizedString("intl.accept_languages");

View File

@ -175,9 +175,6 @@ uint32_t gMaxWorkersPerDomain = MAX_WORKERS_PER_DOMAIN;
// Does not hold an owning reference.
RuntimeService* gRuntimeService = nullptr;
// Only non-null during the call to Init.
RuntimeService* gRuntimeServiceDuringInit = nullptr;
#ifdef ENABLE_TESTS
bool gTestPBackground = false;
#endif // ENABLE_TESTS
@ -327,7 +324,7 @@ LoadRuntimeOptions(const char* aPrefName, void* /* aClosure */)
AssertIsOnMainThread();
RuntimeService* rts = RuntimeService::GetService();
if (!rts && !gRuntimeServiceDuringInit) {
if (!rts) {
// May be shutting down, just bail.
return;
}
@ -388,7 +385,7 @@ LoadGCZealOptions(const char* /* aPrefName */, void* /* aClosure */)
AssertIsOnMainThread();
RuntimeService* rts = RuntimeService::GetService();
if (!rts && !gRuntimeServiceDuringInit) {
if (!rts) {
// May be shutting down, just bail.
return;
}
@ -451,7 +448,7 @@ LoadJSGCMemoryOptions(const char* aPrefName, void* /* aClosure */)
RuntimeService* rts = RuntimeService::GetService();
if (!rts && !gRuntimeServiceDuringInit) {
if (!rts) {
// May be shutting down, just bail.
return;
}
@ -1398,19 +1395,18 @@ RuntimeService::GetOrCreateService()
AssertIsOnMainThread();
if (!gRuntimeService) {
nsRefPtr<RuntimeService> service = new RuntimeService();
if (NS_FAILED(service->Init())) {
// The observer service now owns us until shutdown.
gRuntimeService = new RuntimeService();
if (NS_FAILED(gRuntimeService->Init())) {
NS_WARNING("Failed to initialize!");
service->Cleanup();
gRuntimeService->Cleanup();
gRuntimeService = nullptr;
return nullptr;
}
#ifdef ENABLE_TESTS
gTestPBackground = mozilla::Preferences::GetBool("pbackground.testing", false);
#endif // ENABLE_TESTS
// The observer service now owns us until shutdown.
gRuntimeService = service;
}
return gRuntimeService;
@ -1825,9 +1821,6 @@ RuntimeService::Init()
NS_WARNING("Failed to register for offline notification event!");
}
NS_ASSERTION(!gRuntimeServiceDuringInit, "This should be null!");
gRuntimeServiceDuringInit = this;
if (NS_FAILED(Preferences::RegisterCallback(
LoadJSGCMemoryOptions,
PREF_JS_OPTIONS_PREFIX PREF_MEM_OPTIONS_PREFIX,
@ -1885,9 +1878,6 @@ RuntimeService::Init()
NS_WARNING("Failed to register pref callbacks!");
}
NS_ASSERTION(gRuntimeServiceDuringInit == this, "Should be 'this'!");
gRuntimeServiceDuringInit = nullptr;
// We assume atomic 32bit reads/writes. If this assumption doesn't hold on
// some wacky platform then the worst that could happen is that the close
// handler will run for a slightly different amount of time.