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

Unified Diff: components/os_crypt/os_crypt_posix.cc

Issue 1884743002: Convert a few components from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint 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 | « components/os_crypt/os_crypt_mac.mm ('k') | components/pdf/browser/pdf_web_contents_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/os_crypt/os_crypt_posix.cc
diff --git a/components/os_crypt/os_crypt_posix.cc b/components/os_crypt/os_crypt_posix.cc
index b5dc3348622ba9777c558eb41aac817adb204e6c..44f04b3801fead7d45d2758260c9721db6bf9334 100644
--- a/components/os_crypt/os_crypt_posix.cc
+++ b/components/os_crypt/os_crypt_posix.cc
@@ -6,8 +6,9 @@
#include <stddef.h>
+#include <memory>
+
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "crypto/encryptor.h"
#include "crypto/symmetric_key.h"
@@ -43,7 +44,7 @@ crypto::SymmetricKey* GetEncryptionKey() {
std::string salt(kSalt);
// Create an encryption key from our password and salt.
- scoped_ptr<crypto::SymmetricKey> encryption_key(
+ std::unique_ptr<crypto::SymmetricKey> encryption_key(
crypto::SymmetricKey::DeriveKeyFromPassword(crypto::SymmetricKey::AES,
password,
salt,
@@ -83,7 +84,7 @@ bool OSCrypt::EncryptString(const std::string& plaintext,
return true;
}
- scoped_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey());
+ std::unique_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey());
if (!encryption_key.get())
return false;
@@ -125,7 +126,7 @@ bool OSCrypt::DecryptString(const std::string& ciphertext,
// Strip off the versioning prefix before decrypting.
std::string raw_ciphertext = ciphertext.substr(strlen(kObfuscationPrefix));
- scoped_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey());
+ std::unique_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey());
if (!encryption_key.get())
return false;
« no previous file with comments | « components/os_crypt/os_crypt_mac.mm ('k') | components/pdf/browser/pdf_web_contents_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698