Chromium Code Reviews| Index: components/policy/core/browser/browser_policy_connector.cc |
| diff --git a/components/policy/core/browser/browser_policy_connector.cc b/components/policy/core/browser/browser_policy_connector.cc |
| index 1bad6f404ef76d2032eb6571ab945256368ca2cf..ead92324b6ba51131fa46d8aaa7764d45b161251 100644 |
| --- a/components/policy/core/browser/browser_policy_connector.cc |
| +++ b/components/policy/core/browser/browser_policy_connector.cc |
| @@ -44,7 +44,16 @@ bool MatchDomain(const base::string16& domain, const base::string16& pattern) { |
| UErrorCode status = U_ZERO_ERROR; |
| const icu::UnicodeString icu_pattern(pattern.data(), pattern.length()); |
| icu::RegexMatcher matcher(icu_pattern, UREGEX_CASE_INSENSITIVE, status); |
| - DCHECK(U_SUCCESS(status)) << "Invalid domain pattern: " << pattern; |
| + if (!U_SUCCESS(status)) { |
| + // http://crbug.com/365351 - if for some reason the matcher creation fails |
| + // just return that the pattern doesn't match the domain. This is safe |
| + // because the calling method (IsNonEnterpriseUser()) is just used to enable |
| + // an optimization for non-enterprise users - better to skip the |
| + // optimization than crash. |
| + DLOG(ERROR) << "Possible invalid domain pattern: " << pattern |
|
Joao da Silva
2014/07/10 10:23:41
WDYT of gathering some UMA samples for this? We co
|
| + << " - Error: " << status; |
| + return false; |
| + } |
| icu::UnicodeString icu_input(domain.data(), domain.length()); |
| matcher.reset(icu_input); |
| status = U_ZERO_ERROR; |