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

Unified Diff: content/child/webcrypto/webcrypto_util.cc

Issue 670773003: Cleanup: rename usage_mask --> usages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « content/child/webcrypto/webcrypto_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/webcrypto_util.cc
diff --git a/content/child/webcrypto/webcrypto_util.cc b/content/child/webcrypto/webcrypto_util.cc
index b052bc916d0e55728f33deb8f5feb34a96edb9d3..27614d12e7ab07644d5f6d492489da436cd2846e 100644
--- a/content/child/webcrypto/webcrypto_util.cc
+++ b/content/child/webcrypto/webcrypto_util.cc
@@ -61,12 +61,12 @@ const JwkToWebCryptoUsage kJwkWebCryptoUsageMap[] = {
{"wrapKey", blink::WebCryptoKeyUsageWrapKey},
{"unwrapKey", blink::WebCryptoKeyUsageUnwrapKey}};
-// Modifies the input usage_mask by according to the key_op value.
+// Modifies the input usages by according to the key_op value.
bool JwkKeyOpToWebCryptoUsage(const std::string& key_op,
- blink::WebCryptoKeyUsageMask* usage_mask) {
+ blink::WebCryptoKeyUsageMask* usages) {
for (size_t i = 0; i < arraysize(kJwkWebCryptoUsageMap); ++i) {
if (kJwkWebCryptoUsageMap[i].jwk_key_op == key_op) {
- *usage_mask |= kJwkWebCryptoUsageMap[i].webcrypto_usage;
+ *usages |= kJwkWebCryptoUsageMap[i].webcrypto_usage;
return true;
}
}
@@ -74,10 +74,9 @@ bool JwkKeyOpToWebCryptoUsage(const std::string& key_op,
}
// Composes a Web Crypto usage mask from an array of JWK key_ops values.
-Status GetWebCryptoUsagesFromJwkKeyOps(
- const base::ListValue* jwk_key_ops_value,
- blink::WebCryptoKeyUsageMask* usage_mask) {
- *usage_mask = 0;
+Status GetWebCryptoUsagesFromJwkKeyOps(const base::ListValue* jwk_key_ops_value,
+ blink::WebCryptoKeyUsageMask* usages) {
+ *usages = 0;
for (size_t i = 0; i < jwk_key_ops_value->GetSize(); ++i) {
std::string key_op;
if (!jwk_key_ops_value->GetString(i, &key_op)) {
@@ -85,7 +84,7 @@ Status GetWebCryptoUsagesFromJwkKeyOps(
base::StringPrintf("key_ops[%d]", static_cast<int>(i)), "string");
}
// Unrecognized key_ops are silently skipped.
- ignore_result(JwkKeyOpToWebCryptoUsage(key_op, usage_mask));
+ ignore_result(JwkKeyOpToWebCryptoUsage(key_op, usages));
}
return Status::Success();
}
@@ -93,10 +92,10 @@ Status GetWebCryptoUsagesFromJwkKeyOps(
// Composes a JWK key_ops List from a Web Crypto usage mask.
// Note: Caller must assume ownership of returned instance.
base::ListValue* CreateJwkKeyOpsFromWebCryptoUsages(
- blink::WebCryptoKeyUsageMask usage_mask) {
+ blink::WebCryptoKeyUsageMask usages) {
base::ListValue* jwk_key_ops = new base::ListValue();
for (size_t i = 0; i < arraysize(kJwkWebCryptoUsageMap); ++i) {
- if (usage_mask & kJwkWebCryptoUsageMap[i].webcrypto_usage)
+ if (usages & kJwkWebCryptoUsageMap[i].webcrypto_usage)
jwk_key_ops->AppendString(kJwkWebCryptoUsageMap[i].jwk_key_op);
}
return jwk_key_ops;
« no previous file with comments | « content/child/webcrypto/webcrypto_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698