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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 WebCryptoKeyUsageMask keyUsageStringToMask(const String& usageString) | 92 WebCryptoKeyUsageMask keyUsageStringToMask(const String& usageString) |
93 { | 93 { |
94 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyUsageMappings); ++i) { | 94 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyUsageMappings); ++i) { |
95 if (keyUsageMappings[i].name == usageString) | 95 if (keyUsageMappings[i].name == usageString) |
96 return keyUsageMappings[i].value; | 96 return keyUsageMappings[i].value; |
97 } | 97 } |
98 return 0; | 98 return 0; |
99 } | 99 } |
100 | 100 |
101 class DictionaryBuilder : public WebCryptoKeyAlgorithmDictionary { | 101 class DictionaryBuilder : public WebCryptoKeyAlgorithmDictionary { |
| 102 STACK_ALLOCATED(); |
102 public: | 103 public: |
103 explicit DictionaryBuilder(V8ObjectBuilder& builder) | 104 explicit DictionaryBuilder(V8ObjectBuilder& builder) |
104 : m_builder(builder) | 105 : m_builder(builder) |
105 { | 106 { |
106 } | 107 } |
107 | 108 |
108 virtual void setString(const char* propertyName, const char* value) | 109 virtual void setString(const char* propertyName, const char* value) |
109 { | 110 { |
110 m_builder.addString(propertyName, value); | 111 m_builder.addString(propertyName, value); |
111 } | 112 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if (!usage) { | 225 if (!usage) { |
225 result->completeWithError(WebCryptoErrorTypeType, "Invalid keyUsages
argument"); | 226 result->completeWithError(WebCryptoErrorTypeType, "Invalid keyUsages
argument"); |
226 return false; | 227 return false; |
227 } | 228 } |
228 mask |= usage; | 229 mask |= usage; |
229 } | 230 } |
230 return true; | 231 return true; |
231 } | 232 } |
232 | 233 |
233 } // namespace blink | 234 } // namespace blink |
OLD | NEW |