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

Side by Side Diff: components/webcrypto/jwk.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « components/webcrypto/algorithms/hmac_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/webcrypto/jwk.h" 5 #include "components/webcrypto/jwk.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 346
347 return Status::Success(); 347 return Status::Success();
348 } 348 }
349 349
350 JwkWriter::JwkWriter(const std::string& algorithm, 350 JwkWriter::JwkWriter(const std::string& algorithm,
351 bool extractable, 351 bool extractable,
352 blink::WebCryptoKeyUsageMask usages, 352 blink::WebCryptoKeyUsageMask usages,
353 const std::string& kty) { 353 const std::string& kty) {
354 if (!algorithm.empty()) 354 if (!algorithm.empty())
355 dict_.SetString("alg", algorithm); 355 dict_.SetString("alg", algorithm);
356 dict_.Set("key_ops", CreateJwkKeyOpsFromWebCryptoUsages(usages).release()); 356 dict_.Set("key_ops", CreateJwkKeyOpsFromWebCryptoUsages(usages));
357 dict_.SetBoolean("ext", extractable); 357 dict_.SetBoolean("ext", extractable);
358 dict_.SetString("kty", kty); 358 dict_.SetString("kty", kty);
359 } 359 }
360 360
361 void JwkWriter::SetString(const std::string& member_name, 361 void JwkWriter::SetString(const std::string& member_name,
362 const std::string& value) { 362 const std::string& value) {
363 dict_.SetString(member_name, value); 363 dict_.SetString(member_name, value);
364 } 364 }
365 365
366 void JwkWriter::SetBytes(const std::string& member_name, 366 void JwkWriter::SetBytes(const std::string& member_name,
(...skipping 15 matching lines...) Expand all
382 utf8_bytes->assign(json.begin(), json.end()); 382 utf8_bytes->assign(json.begin(), json.end());
383 } 383 }
384 384
385 Status GetWebCryptoUsagesFromJwkKeyOpsForTest( 385 Status GetWebCryptoUsagesFromJwkKeyOpsForTest(
386 const base::ListValue* key_ops, 386 const base::ListValue* key_ops,
387 blink::WebCryptoKeyUsageMask* usages) { 387 blink::WebCryptoKeyUsageMask* usages) {
388 return GetWebCryptoUsagesFromJwkKeyOps(key_ops, usages); 388 return GetWebCryptoUsagesFromJwkKeyOps(key_ops, usages);
389 } 389 }
390 390
391 } // namespace webcrypto 391 } // namespace webcrypto
OLDNEW
« no previous file with comments | « components/webcrypto/algorithms/hmac_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698