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

Unified Diff: Source/modules/crypto/Key.cpp

Issue 18801015: WebCrypto: Update the key usage names to reflect recent changes to the spec. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/crypto/Key.h ('k') | Source/modules/crypto/Key.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/Key.cpp
diff --git a/Source/modules/crypto/Key.cpp b/Source/modules/crypto/Key.cpp
index 7bba028c40b205e6dd444182a0ffa595a44f37cf..d10fbd4249dd3403a7e9efe49896250bff693730 100644
--- a/Source/modules/crypto/Key.cpp
+++ b/Source/modules/crypto/Key.cpp
@@ -62,12 +62,12 @@ const char* keyUsageToString(WebKit::WebCryptoKeyUsage usage)
return "sign";
case WebKit::WebCryptoKeyUsageVerify:
return "verify";
- case WebKit::WebCryptoKeyUsageDerive:
- return "derive";
- case WebKit::WebCryptoKeyUsageWrap:
- return "wrap";
- case WebKit::WebCryptoKeyUsageUnwrap:
- return "unwrap";
+ case WebKit::WebCryptoKeyUsageDeriveKey:
+ return "deriveKey";
+ case WebKit::WebCryptoKeyUsageWrapKey:
+ return "wrapKey";
+ case WebKit::WebCryptoKeyUsageUnwrapKey:
+ return "unwrapKey";
case WebKit::EndOfWebCryptoKeyUsage:
break;
}
@@ -104,14 +104,14 @@ Algorithm* Key::algorithm()
// instead is return the same (immutable) array. (Javascript callers can
// distinguish this by doing an == test on the arrays and seeing they are
// different).
-Vector<String> Key::keyUsage() const
+Vector<String> Key::usages() const
{
Vector<String> result;
// The WebCryptoKeyUsage values are consecutive powers of 2. Test each one in order.
for (int i = 0; (1 << i) < WebKit::EndOfWebCryptoKeyUsage; ++i) {
WebKit::WebCryptoKeyUsage usage = static_cast<WebKit::WebCryptoKeyUsage>(1 << i);
- if (m_key.keyUsage() & usage)
+ if (m_key.usages() & usage)
result.append(ASCIILiteral(keyUsageToString(usage)));
}
return result;
« no previous file with comments | « Source/modules/crypto/Key.h ('k') | Source/modules/crypto/Key.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698