OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 return false; | 174 return false; |
175 } | 175 } |
176 | 176 |
177 bool LookupAlgorithmIdByName(const String& algorithm_name, | 177 bool LookupAlgorithmIdByName(const String& algorithm_name, |
178 WebCryptoAlgorithmId& id) { | 178 WebCryptoAlgorithmId& id) { |
179 const AlgorithmNameMapping* begin = kAlgorithmNameMappings; | 179 const AlgorithmNameMapping* begin = kAlgorithmNameMappings; |
180 const AlgorithmNameMapping* end = | 180 const AlgorithmNameMapping* end = |
181 kAlgorithmNameMappings + WTF_ARRAY_LENGTH(kAlgorithmNameMappings); | 181 kAlgorithmNameMappings + WTF_ARRAY_LENGTH(kAlgorithmNameMappings); |
182 | 182 |
183 ASSERT(VerifyAlgorithmNameMappings(begin, end)); | 183 #if DCHECK_IS_ON() |
| 184 DCHECK(VerifyAlgorithmNameMappings(begin, end)); |
| 185 #endif |
184 | 186 |
185 const AlgorithmNameMapping* it; | 187 const AlgorithmNameMapping* it; |
186 if (algorithm_name.Impl()->Is8Bit()) | 188 if (algorithm_name.Impl()->Is8Bit()) |
187 it = std::lower_bound(begin, end, algorithm_name.Impl(), | 189 it = std::lower_bound(begin, end, algorithm_name.Impl(), |
188 &AlgorithmNameComparator<LChar>); | 190 &AlgorithmNameComparator<LChar>); |
189 else | 191 else |
190 it = std::lower_bound(begin, end, algorithm_name.Impl(), | 192 it = std::lower_bound(begin, end, algorithm_name.Impl(), |
191 &AlgorithmNameComparator<UChar>); | 193 &AlgorithmNameComparator<UChar>); |
192 | 194 |
193 if (it == end) | 195 if (it == end) |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 } // namespace | 1095 } // namespace |
1094 | 1096 |
1095 bool NormalizeAlgorithm(const AlgorithmIdentifier& raw, | 1097 bool NormalizeAlgorithm(const AlgorithmIdentifier& raw, |
1096 WebCryptoOperation op, | 1098 WebCryptoOperation op, |
1097 WebCryptoAlgorithm& algorithm, | 1099 WebCryptoAlgorithm& algorithm, |
1098 AlgorithmError* error) { | 1100 AlgorithmError* error) { |
1099 return ParseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); | 1101 return ParseAlgorithmIdentifier(raw, op, algorithm, ErrorContext(), error); |
1100 } | 1102 } |
1101 | 1103 |
1102 } // namespace blink | 1104 } // namespace blink |
OLD | NEW |