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