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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return 0; | 136 return 0; |
137 return ®istry.m_algorithms[it->value]; | 137 return ®istry.m_algorithms[it->value]; |
138 } | 138 } |
139 | 139 |
140 AlgorithmRegistry::AlgorithmRegistry() | 140 AlgorithmRegistry::AlgorithmRegistry() |
141 { | 141 { |
142 for (size_t i = 0; i < WTF_ARRAY_LENGTH(algorithmNameMappings); ++i) { | 142 for (size_t i = 0; i < WTF_ARRAY_LENGTH(algorithmNameMappings); ++i) { |
143 const AlgorithmNameMapping& mapping = algorithmNameMappings[i]; | 143 const AlgorithmNameMapping& mapping = algorithmNameMappings[i]; |
144 m_algorithmNameToId.add(mapping.algorithmName, mapping.algorithmId); | 144 m_algorithmNameToId.add(mapping.algorithmName, mapping.algorithmId); |
145 m_algorithms[mapping.algorithmId].algorithmName = mapping.algorithmName; | 145 m_algorithms[mapping.algorithmId].algorithmName = mapping.algorithmName; |
| 146 m_algorithms[mapping.algorithmId].algorithmId = mapping.algorithmId; |
146 } | 147 } |
147 | 148 |
148 for (size_t i = 0; i < WTF_ARRAY_LENGTH(operationParamsMappings); ++i) { | 149 for (size_t i = 0; i < WTF_ARRAY_LENGTH(operationParamsMappings); ++i) { |
149 const OperationParamsMapping& mapping = operationParamsMappings[i]; | 150 const OperationParamsMapping& mapping = operationParamsMappings[i]; |
150 m_algorithms[mapping.algorithmId].paramsForOperation[mapping.operation]
= mapping.params; | 151 m_algorithms[mapping.algorithmId].paramsForOperation[mapping.operation]
= mapping.params; |
151 } | 152 } |
152 } | 153 } |
153 | 154 |
154 PassOwnPtr<WebKit::WebCryptoAlgorithmParams> parseAesCbcParams(const Dictionary&
raw) | 155 PassOwnPtr<WebKit::WebCryptoAlgorithmParams> parseAesCbcParams(const Dictionary&
raw) |
155 { | 156 { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 if (!params && paramsType != WebKit::WebCryptoAlgorithmParamsTypeNone) { | 223 if (!params && paramsType != WebKit::WebCryptoAlgorithmParamsTypeNone) { |
223 ec = NotSupportedError; | 224 ec = NotSupportedError; |
224 return false; | 225 return false; |
225 } | 226 } |
226 | 227 |
227 algorithm = WebKit::WebCryptoAlgorithm(info->algorithmId, info->algorithmNam
e, params.release()); | 228 algorithm = WebKit::WebCryptoAlgorithm(info->algorithmId, info->algorithmNam
e, params.release()); |
228 return true; | 229 return true; |
229 } | 230 } |
230 | 231 |
231 } // namespace WebCore | 232 } // namespace WebCore |
OLD | NEW |