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

Side by Side Diff: content/child/webcrypto/webcrypto_impl.cc

Issue 670433005: Cleanup: Use default constructor for WebCryptoKey rather than createNull() factory method. (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 unified diff | Download patch
« no previous file with comments | « content/child/webcrypto/test/test_helpers.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 "content/child/webcrypto/webcrypto_impl.h" 5 #include "content/child/webcrypto/webcrypto_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 unsigned int key_data_size, 231 unsigned int key_data_size,
232 const blink::WebCryptoAlgorithm& algorithm, 232 const blink::WebCryptoAlgorithm& algorithm,
233 bool extractable, 233 bool extractable,
234 blink::WebCryptoKeyUsageMask usage_mask, 234 blink::WebCryptoKeyUsageMask usage_mask,
235 const blink::WebCryptoResult& result) 235 const blink::WebCryptoResult& result)
236 : BaseState(result), 236 : BaseState(result),
237 format(format), 237 format(format),
238 key_data(key_data, key_data + key_data_size), 238 key_data(key_data, key_data + key_data_size),
239 algorithm(algorithm), 239 algorithm(algorithm),
240 extractable(extractable), 240 extractable(extractable),
241 usage_mask(usage_mask), 241 usage_mask(usage_mask) {}
242 key(blink::WebCryptoKey::createNull()) {}
243 242
244 const blink::WebCryptoKeyFormat format; 243 const blink::WebCryptoKeyFormat format;
245 const std::vector<uint8_t> key_data; 244 const std::vector<uint8_t> key_data;
246 const blink::WebCryptoAlgorithm algorithm; 245 const blink::WebCryptoAlgorithm algorithm;
247 const bool extractable; 246 const bool extractable;
248 const blink::WebCryptoKeyUsageMask usage_mask; 247 const blink::WebCryptoKeyUsageMask usage_mask;
249 248
250 blink::WebCryptoKey key; 249 blink::WebCryptoKey key;
251 }; 250 };
252 251
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 bool extractable, 316 bool extractable,
318 blink::WebCryptoKeyUsageMask usages, 317 blink::WebCryptoKeyUsageMask usages,
319 const blink::WebCryptoResult& result) 318 const blink::WebCryptoResult& result)
320 : BaseState(result), 319 : BaseState(result),
321 format(format), 320 format(format),
322 wrapped_key(wrapped_key, wrapped_key + wrapped_key_size), 321 wrapped_key(wrapped_key, wrapped_key + wrapped_key_size),
323 wrapping_key(wrapping_key), 322 wrapping_key(wrapping_key),
324 unwrap_algorithm(unwrap_algorithm), 323 unwrap_algorithm(unwrap_algorithm),
325 unwrapped_key_algorithm(unwrapped_key_algorithm), 324 unwrapped_key_algorithm(unwrapped_key_algorithm),
326 extractable(extractable), 325 extractable(extractable),
327 usages(usages), 326 usages(usages) {}
328 unwrapped_key(blink::WebCryptoKey::createNull()) {}
329 327
330 const blink::WebCryptoKeyFormat format; 328 const blink::WebCryptoKeyFormat format;
331 const std::vector<uint8_t> wrapped_key; 329 const std::vector<uint8_t> wrapped_key;
332 const blink::WebCryptoKey wrapping_key; 330 const blink::WebCryptoKey wrapping_key;
333 const blink::WebCryptoAlgorithm unwrap_algorithm; 331 const blink::WebCryptoAlgorithm unwrap_algorithm;
334 const blink::WebCryptoAlgorithm unwrapped_key_algorithm; 332 const blink::WebCryptoAlgorithm unwrapped_key_algorithm;
335 const bool extractable; 333 const bool extractable;
336 const blink::WebCryptoKeyUsageMask usages; 334 const blink::WebCryptoKeyUsageMask usages;
337 335
338 blink::WebCryptoKey unwrapped_key; 336 blink::WebCryptoKey unwrapped_key;
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 &key); 723 &key);
726 } 724 }
727 725
728 bool WebCryptoImpl::serializeKeyForClone( 726 bool WebCryptoImpl::serializeKeyForClone(
729 const blink::WebCryptoKey& key, 727 const blink::WebCryptoKey& key,
730 blink::WebVector<unsigned char>& key_data) { 728 blink::WebVector<unsigned char>& key_data) {
731 return webcrypto::SerializeKeyForClone(key, &key_data); 729 return webcrypto::SerializeKeyForClone(key, &key_data);
732 } 730 }
733 731
734 } // namespace content 732 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/test/test_helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698