diff options
author | shess <shess@chromium.org> | 2015-03-11 21:17:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-12 04:18:04 +0000 |
commit | d3e139b38e89492aa2be03f8c738069e4230a45c (patch) | |
tree | 58430ad92476e6ed5a812cdd3debc3d52d3b4b50 | |
parent | dc6486b36e13df6a7237b4e9a7699941c5380320 (diff) | |
download | chromium_src-d3e139b38e89492aa2be03f8c738069e4230a45c.zip chromium_src-d3e139b38e89492aa2be03f8c738069e4230a45c.tar.gz chromium_src-d3e139b38e89492aa2be03f8c738069e4230a45c.tar.bz2 |
[osx] Whitelist NSException thrown by Cocoa on Yosemite.
During background processing to extract an address term from text
(probably), nil is being passed as the string to process. Hilarity
ensues.
BUG=466076
Review URL: https://codereview.chromium.org/993423003
Cr-Commit-Position: refs/heads/master@{#320233}
-rw-r--r-- | chrome/browser/chrome_browser_application_mac.mm | 14 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm index e3a8ff2..ac4a87a 100644 --- a/chrome/browser/chrome_browser_application_mac.mm +++ b/chrome/browser/chrome_browser_application_mac.mm @@ -31,6 +31,7 @@ enum ExceptionEventType { EXCEPTION_VIEW_NOT_IN_WINDOW, EXCEPTION_NSURL_INIT_NIL, EXCEPTION_NSDATADETECTOR_NIL_STRING, + EXCEPTION_NSREGULAREXPRESSION_NIL_STRING, // Always keep this at the end. EXCEPTION_MAX, @@ -126,8 +127,8 @@ static IMP gOriginalInitIMP = NULL; fatal = NO; } - // TODO(shess): <http://crbug.com/316759> OSX 10.9 is failing - // trying to extract structure from a string. + // <http://crbug.com/316759> OSX 10.9 fails trying to extract + // structure from a string. NSString* const kNSDataDetectorNilCheck = @"*** -[NSDataDetector enumerateMatchesInString:" @"options:range:usingBlock:]: nil argument"; @@ -135,6 +136,15 @@ static IMP gOriginalInitIMP = NULL; RecordExceptionEvent(EXCEPTION_NSDATADETECTOR_NIL_STRING); fatal = NO; } + + // <http://crbug.com/466076> OSX 10.10 moved the method. + NSString* const kNSRegularExpressionNilCheck = + @"*** -[NSRegularExpression enumerateMatchesInString:" + @"options:range:usingBlock:]: nil argument"; + if ([aReason isEqualToString:kNSRegularExpressionNilCheck]) { + RecordExceptionEvent(EXCEPTION_NSREGULAREXPRESSION_NIL_STRING); + fatal = NO; + } } // Dear reader: Something you just did provoked an NSException. diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index dd3788b..25e1fee 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -55180,6 +55180,10 @@ To add a new entry, add it with any value and run test to compute valid value. Whitelisted exception for bug 316759. Suspect background address detection, field unknown. </int> + <int value="5" label="EXCEPTION_NSREGULAREXPRESSION_NIL_STRING"> + Whitelisted exception for bug 466076. Suspect background address detection, + field unknown. + </int> </enum> <enum name="OSXFullscreenParameters" type="int"> |