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

Unified Diff: crypto/symmetric_key_win.cc

Issue 1870233002: Convert crypto to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 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 | « crypto/symmetric_key_unittest.cc ('k') | net/android/keystore_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/symmetric_key_win.cc
diff --git a/crypto/symmetric_key_win.cc b/crypto/symmetric_key_win.cc
index ac8e614e514f099847a2656691ac93380528fa93..1acfcd01c4940834600cc6dd3daaf1bfd5b2bc70 100644
--- a/crypto/symmetric_key_win.cc
+++ b/crypto/symmetric_key_win.cc
@@ -7,10 +7,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <vector>
// TODO(wtc): replace scoped_array by std::vector.
-#include "base/memory/scoped_ptr.h"
#include "base/sys_byteorder.h"
namespace crypto {
@@ -171,7 +171,7 @@ bool GenerateHMACKey(size_t key_size_in_bits,
ALG_ID alg,
ScopedHCRYPTPROV* provider,
ScopedHCRYPTKEY* key,
- scoped_ptr<BYTE[]>* raw_key) {
+ std::unique_ptr<BYTE[]>* raw_key) {
DCHECK(provider);
DCHECK(key);
DCHECK(raw_key);
@@ -188,7 +188,7 @@ bool GenerateHMACKey(size_t key_size_in_bits,
return false;
DWORD key_size_in_bytes = static_cast<DWORD>(key_size_in_bits / 8);
- scoped_ptr<BYTE[]> random(new BYTE[key_size_in_bytes]);
+ std::unique_ptr<BYTE[]> random(new BYTE[key_size_in_bytes]);
ok = CryptGenRandom(safe_provider, key_size_in_bytes, random.get());
if (!ok)
return false;
@@ -323,7 +323,7 @@ SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
ScopedHCRYPTKEY key;
bool ok = false;
- scoped_ptr<BYTE[]> raw_key;
+ std::unique_ptr<BYTE[]> raw_key;
switch (algorithm) {
case AES:
« no previous file with comments | « crypto/symmetric_key_unittest.cc ('k') | net/android/keystore_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698