Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: Source/modules/crypto/CryptoKey.cpp

Issue 813903002: replace COMPILE_ASSERT with static_assert in modules/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase on master Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/modules/crypto/NormalizeAlgorithm.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 { WebCryptoKeyUsageEncrypt, "encrypt" }, 68 { WebCryptoKeyUsageEncrypt, "encrypt" },
69 { WebCryptoKeyUsageDecrypt, "decrypt" }, 69 { WebCryptoKeyUsageDecrypt, "decrypt" },
70 { WebCryptoKeyUsageSign, "sign" }, 70 { WebCryptoKeyUsageSign, "sign" },
71 { WebCryptoKeyUsageVerify, "verify" }, 71 { WebCryptoKeyUsageVerify, "verify" },
72 { WebCryptoKeyUsageDeriveKey, "deriveKey" }, 72 { WebCryptoKeyUsageDeriveKey, "deriveKey" },
73 { WebCryptoKeyUsageDeriveBits, "deriveBits" }, 73 { WebCryptoKeyUsageDeriveBits, "deriveBits" },
74 { WebCryptoKeyUsageWrapKey, "wrapKey" }, 74 { WebCryptoKeyUsageWrapKey, "wrapKey" },
75 { WebCryptoKeyUsageUnwrapKey, "unwrapKey" }, 75 { WebCryptoKeyUsageUnwrapKey, "unwrapKey" },
76 }; 76 };
77 77
78 COMPILE_ASSERT(EndOfWebCryptoKeyUsage == (1 << 7) + 1, update_keyUsageMappings); 78 static_assert(EndOfWebCryptoKeyUsage == (1 << 7) + 1, "keyUsageMappings needs to be updated");
79 79
80 const char* keyUsageToString(WebCryptoKeyUsage usage) 80 const char* keyUsageToString(WebCryptoKeyUsage usage)
81 { 81 {
82 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyUsageMappings); ++i) { 82 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyUsageMappings); ++i) {
83 if (keyUsageMappings[i].value == usage) 83 if (keyUsageMappings[i].value == usage)
84 return keyUsageMappings[i].name; 84 return keyUsageMappings[i].name;
85 } 85 }
86 ASSERT_NOT_REACHED(); 86 ASSERT_NOT_REACHED();
87 return 0; 87 return 0;
88 } 88 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (!usage) { 179 if (!usage) {
180 result->completeWithError(WebCryptoErrorTypeType, "Invalid keyUsages argument"); 180 result->completeWithError(WebCryptoErrorTypeType, "Invalid keyUsages argument");
181 return false; 181 return false;
182 } 182 }
183 mask |= usage; 183 mask |= usage;
184 } 184 }
185 return true; 185 return true;
186 } 186 }
187 187
188 } // namespace blink 188 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/modules/crypto/NormalizeAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698