summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 19:56:46 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 19:56:46 +0000
commitfdf007f94be8ab57b4894c018f7fe788614dcdda (patch)
treefc1b272697b499042fc8d8ed00de77b32e1c4ec1
parenta3c94c713dcf12e7d95b7c4548137d7beb790e9c (diff)
downloadchromium_src-fdf007f94be8ab57b4894c018f7fe788614dcdda.zip
chromium_src-fdf007f94be8ab57b4894c018f7fe788614dcdda.tar.gz
chromium_src-fdf007f94be8ab57b4894c018f7fe788614dcdda.tar.bz2
Need to allow accessibility exceptions to flow to allow the Accessibility Verifier to work.
BUG=none TEST=none Review URL: http://codereview.chromium.org/503048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34975 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_browser_application_mac.mm39
1 files changed, 30 insertions, 9 deletions
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm
index 3aa31013..ce7be61 100644
--- a/chrome/browser/chrome_browser_application_mac.mm
+++ b/chrome/browser/chrome_browser_application_mac.mm
@@ -32,15 +32,36 @@ static IMP gOriginalInitIMP = NULL;
// Method only called when swizzled.
DCHECK(_cmd == @selector(initWithName:reason:userInfo:));
- // Dear reader: something you just did provoked an NSException.
- // Please check your backtrace and see if you can't file a bug with
- // a repro case. You should be able to safely continue past the
- // NOTREACHED(), but feel free to comment it out locally if it is
- // making your job hard.
- DLOG(ERROR) << "Someone is preparing to raise an exception! "
- << base::SysNSStringToUTF8(aName) << " *** "
- << base::SysNSStringToUTF8(aReason);
- NOTREACHED();
+ // Parts of Cocoa rely on creating and throwing exceptions. These are not
+ // worth bugging-out over. It is very important that there be zero chance that
+ // any Chromium code is on the stack; these must be created by Apple code and
+ // then immediately consumed by Apple code.
+ static const NSString* kAcceptableNSExceptionNames[] = {
+ // If an object does not support an accessibility attribute, this will
+ // get thrown.
+ NSAccessibilityException,
+
+ nil
+ };
+
+ BOOL found = NO;
+ for (int i = 0; kAcceptableNSExceptionNames[i]; ++i) {
+ if (aName == kAcceptableNSExceptionNames[i]) {
+ found = YES;
+ }
+ }
+
+ if (!found) {
+ // Dear reader: something you just did provoked an NSException.
+ // Please check your backtrace and see if you can't file a bug with
+ // a repro case. You should be able to safely continue past the
+ // NOTREACHED(), but feel free to comment it out locally if it is
+ // making your job hard.
+ DLOG(ERROR) << "Someone is preparing to raise an exception! "
+ << base::SysNSStringToUTF8(aName) << " *** "
+ << base::SysNSStringToUTF8(aReason);
+ NOTREACHED();
+ }
// Forward to the original version.
return gOriginalInitIMP(self, _cmd, aName, aReason, someUserInfo);