bug 1023509 - only initialize platform accessibility in the main process r=davidb

Since platform accessibility software only interacts with the main
process there's no reason to do platform specific things in the content
processes.  Eventually we should also be able to only create generic
accessibles that don't use the platform wrapper classes, but that will
take more work so we'll keep creating them in the content processes for
now.
This commit is contained in:
Trevor Saunders 2014-06-10 15:54:06 -04:00 committed by Trevor Saunders
parent e2399dd5c7
commit 67065ba91a

View File

@ -1257,7 +1257,11 @@ nsAccessibilityService::Init()
logging::CheckEnv();
#endif
if (XRE_GetProcessType() == GeckoProcessType_Default)
gApplicationAccessible = new ApplicationAccessibleWrap();
else
gApplicationAccessible = new ApplicationAccessible();
NS_ADDREF(gApplicationAccessible); // will release in Shutdown()
#ifdef MOZ_CRASHREPORTER
@ -1274,6 +1278,7 @@ nsAccessibilityService::Init()
gIsShutdown = false;
// Now its safe to start platform accessibility.
if (XRE_GetProcessType() == GeckoProcessType_Default)
PlatformInit();
return true;
@ -1316,7 +1321,9 @@ nsAccessibilityService::Shutdown()
gIsShutdown = true;
if (XRE_GetProcessType() == GeckoProcessType_Default)
PlatformShutdown();
gApplicationAccessible->Shutdown();
NS_RELEASE(gApplicationAccessible);
gApplicationAccessible = nullptr;