Bug 542267 - get rid nsAccessNode::gIsAccessibilityActive, r=davidb

This commit is contained in:
Alexander Surkov 2010-01-27 23:10:02 +08:00
parent e76bbb4fe9
commit 30fbafac45
3 changed files with 3 additions and 23 deletions

View File

@ -75,9 +75,7 @@
nsIStringBundle *nsAccessNode::gStringBundle = 0; nsIStringBundle *nsAccessNode::gStringBundle = 0;
nsIStringBundle *nsAccessNode::gKeyStringBundle = 0; nsIStringBundle *nsAccessNode::gKeyStringBundle = 0;
nsIDOMNode *nsAccessNode::gLastFocusedNode = 0; nsIDOMNode *nsAccessNode::gLastFocusedNode = 0;
#ifdef DEBUG
PRBool nsAccessNode::gIsAccessibilityActive = PR_FALSE;
#endif
PRBool nsAccessNode::gIsCacheDisabled = PR_FALSE; PRBool nsAccessNode::gIsCacheDisabled = PR_FALSE;
PRBool nsAccessNode::gIsFormFillEnabled = PR_FALSE; PRBool nsAccessNode::gIsFormFillEnabled = PR_FALSE;
nsAccessNodeHashtable nsAccessNode::gGlobalDocAccessibleCache; nsAccessNodeHashtable nsAccessNode::gGlobalDocAccessibleCache;
@ -230,7 +228,8 @@ NS_IMETHODIMP nsAccessNode::GetOwnerWindow(void **aWindow)
already_AddRefed<nsApplicationAccessibleWrap> already_AddRefed<nsApplicationAccessibleWrap>
nsAccessNode::GetApplicationAccessible() nsAccessNode::GetApplicationAccessible()
{ {
NS_ASSERTION(gIsAccessibilityActive, "Accessibility wasn't initialized!"); NS_ASSERTION(!nsAccessibilityService::gIsShutdown,
"Accessibility wasn't initialized!");
if (!gApplicationAccessible) { if (!gApplicationAccessible) {
nsApplicationAccessibleWrap::PreCreate(); nsApplicationAccessibleWrap::PreCreate();
@ -256,9 +255,6 @@ nsAccessNode::GetApplicationAccessible()
void nsAccessNode::InitXPAccessibility() void nsAccessNode::InitXPAccessibility()
{ {
NS_ASSERTION(!gIsAccessibilityActive,
"Accessibility was initialized already!");
nsCOMPtr<nsIStringBundleService> stringBundleService = nsCOMPtr<nsIStringBundleService> stringBundleService =
do_GetService(NS_STRINGBUNDLE_CONTRACTID); do_GetService(NS_STRINGBUNDLE_CONTRACTID);
if (stringBundleService) { if (stringBundleService) {
@ -279,9 +275,6 @@ void nsAccessNode::InitXPAccessibility()
prefBranch->GetBoolPref("browser.formfill.enable", &gIsFormFillEnabled); prefBranch->GetBoolPref("browser.formfill.enable", &gIsFormFillEnabled);
} }
#ifdef DEBUG
gIsAccessibilityActive = PR_TRUE;
#endif
NotifyA11yInitOrShutdown(PR_TRUE); NotifyA11yInitOrShutdown(PR_TRUE);
} }
@ -304,8 +297,6 @@ void nsAccessNode::ShutdownXPAccessibility()
// which happens when xpcom is shutting down // which happens when xpcom is shutting down
// at exit of program // at exit of program
NS_ASSERTION(gIsAccessibilityActive, "Accessibility was shutdown already!");
NS_IF_RELEASE(gStringBundle); NS_IF_RELEASE(gStringBundle);
NS_IF_RELEASE(gKeyStringBundle); NS_IF_RELEASE(gKeyStringBundle);
NS_IF_RELEASE(gLastFocusedNode); NS_IF_RELEASE(gLastFocusedNode);
@ -318,9 +309,6 @@ void nsAccessNode::ShutdownXPAccessibility()
NS_IF_RELEASE(gApplicationAccessible); NS_IF_RELEASE(gApplicationAccessible);
gApplicationAccessible = nsnull; gApplicationAccessible = nsnull;
#ifdef DEBUG
gIsAccessibilityActive = PR_FALSE;
#endif
NotifyA11yInitOrShutdown(PR_FALSE); NotifyA11yInitOrShutdown(PR_FALSE);
} }

View File

@ -202,9 +202,6 @@ protected:
static nsIStringBundle *gStringBundle; static nsIStringBundle *gStringBundle;
static nsIStringBundle *gKeyStringBundle; static nsIStringBundle *gKeyStringBundle;
#ifdef DEBUG
static PRBool gIsAccessibilityActive;
#endif
static PRBool gIsCacheDisabled; static PRBool gIsCacheDisabled;
static PRBool gIsFormFillEnabled; static PRBool gIsFormFillEnabled;

View File

@ -593,9 +593,6 @@ __try {
void nsAccessNodeWrap::InitAccessibility() void nsAccessNodeWrap::InitAccessibility()
{ {
NS_ASSERTION(!gIsAccessibilityActive,
"Accessibility was initialized already!");
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID)); nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefBranch) { if (prefBranch) {
prefBranch->GetBoolPref("accessibility.disableenumvariant", &gIsEnumVariantSupportDisabled); prefBranch->GetBoolPref("accessibility.disableenumvariant", &gIsEnumVariantSupportDisabled);
@ -622,8 +619,6 @@ void nsAccessNodeWrap::ShutdownAccessibility()
NS_IF_RELEASE(gTextEvent); NS_IF_RELEASE(gTextEvent);
::DestroyCaret(); ::DestroyCaret();
NS_ASSERTION(gIsAccessibilityActive, "Accessibility was shutdown already!");
nsAccessNode::ShutdownXPAccessibility(); nsAccessNode::ShutdownXPAccessibility();
} }