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

Unified Diff: remoting/base/rsa_key_pair.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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 | « remoting/base/rsa_key_pair.h ('k') | remoting/base/url_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/rsa_key_pair.cc
diff --git a/remoting/base/rsa_key_pair.cc b/remoting/base/rsa_key_pair.cc
index 98a153b4367dc1d9760314a79800f5dd03f67454..5d393610f04bc7a43ed0bf4ce0de07f1d0beafc9 100644
--- a/remoting/base/rsa_key_pair.cc
+++ b/remoting/base/rsa_key_pair.cc
@@ -21,8 +21,8 @@
namespace remoting {
-RsaKeyPair::RsaKeyPair(scoped_ptr<crypto::RSAPrivateKey> key)
- : key_(std::move(key)){
+RsaKeyPair::RsaKeyPair(std::unique_ptr<crypto::RSAPrivateKey> key)
+ : key_(std::move(key)) {
DCHECK(key_);
}
@@ -30,7 +30,8 @@ RsaKeyPair::~RsaKeyPair() {}
// static
scoped_refptr<RsaKeyPair> RsaKeyPair::Generate() {
- scoped_ptr<crypto::RSAPrivateKey> key(crypto::RSAPrivateKey::Create(2048));
+ std::unique_ptr<crypto::RSAPrivateKey> key(
+ crypto::RSAPrivateKey::Create(2048));
if (!key) {
LOG(ERROR) << "Cannot generate private key.";
return NULL;
@@ -48,7 +49,7 @@ scoped_refptr<RsaKeyPair> RsaKeyPair::FromString(
}
std::vector<uint8_t> key_buf(key_str.begin(), key_str.end());
- scoped_ptr<crypto::RSAPrivateKey> key(
+ std::unique_ptr<crypto::RSAPrivateKey> key(
crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_buf));
if (!key) {
LOG(ERROR) << "Invalid private key.";
@@ -80,7 +81,7 @@ std::string RsaKeyPair::GetPublicKey() const {
}
std::string RsaKeyPair::SignMessage(const std::string& message) const {
- scoped_ptr<crypto::SignatureCreator> signature_creator(
+ std::unique_ptr<crypto::SignatureCreator> signature_creator(
crypto::SignatureCreator::Create(key_.get(),
crypto::SignatureCreator::SHA1));
signature_creator->Update(reinterpret_cast<const uint8_t*>(message.c_str()),
« no previous file with comments | « remoting/base/rsa_key_pair.h ('k') | remoting/base/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698