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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const KeyUsageMapping keyUsageMappings[] = { | 66 const KeyUsageMapping keyUsageMappings[] = { |
67 { blink::WebCryptoKeyUsageEncrypt, "encrypt" }, | 67 { blink::WebCryptoKeyUsageEncrypt, "encrypt" }, |
68 { blink::WebCryptoKeyUsageDecrypt, "decrypt" }, | 68 { blink::WebCryptoKeyUsageDecrypt, "decrypt" }, |
69 { blink::WebCryptoKeyUsageSign, "sign" }, | 69 { blink::WebCryptoKeyUsageSign, "sign" }, |
70 { blink::WebCryptoKeyUsageVerify, "verify" }, | 70 { blink::WebCryptoKeyUsageVerify, "verify" }, |
71 { blink::WebCryptoKeyUsageDeriveKey, "deriveKey" }, | 71 { blink::WebCryptoKeyUsageDeriveKey, "deriveKey" }, |
72 { blink::WebCryptoKeyUsageWrapKey, "wrapKey" }, | 72 { blink::WebCryptoKeyUsageWrapKey, "wrapKey" }, |
73 { blink::WebCryptoKeyUsageUnwrapKey, "unwrapKey" }, | 73 { blink::WebCryptoKeyUsageUnwrapKey, "unwrapKey" }, |
74 }; | 74 }; |
75 | 75 |
76 COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 6) + 1, update_keyUsageMap
pings); | 76 COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 7) + 1, update_keyUsageMap
pings); |
77 | 77 |
78 const char* keyUsageToString(blink::WebCryptoKeyUsage usage) | 78 const char* keyUsageToString(blink::WebCryptoKeyUsage usage) |
79 { | 79 { |
80 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyUsageMappings); ++i) { | 80 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyUsageMappings); ++i) { |
81 if (keyUsageMappings[i].value == usage) | 81 if (keyUsageMappings[i].value == usage) |
82 return keyUsageMappings[i].name; | 82 return keyUsageMappings[i].name; |
83 } | 83 } |
84 ASSERT_NOT_REACHED(); | 84 ASSERT_NOT_REACHED(); |
85 return 0; | 85 return 0; |
86 } | 86 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 } | 217 } |
218 return true; | 218 return true; |
219 } | 219 } |
220 | 220 |
221 void Key::trace(Visitor* visitor) | 221 void Key::trace(Visitor* visitor) |
222 { | 222 { |
223 visitor->trace(m_algorithm); | 223 visitor->trace(m_algorithm); |
224 } | 224 } |
225 | 225 |
226 } // namespace WebCore | 226 } // namespace WebCore |
OLD | NEW |