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

Unified Diff: components/policy/core/common/cloud/policy_builder.h

Issue 1902633006: Convert //components/policy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and use namespace alias 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
Index: components/policy/core/common/cloud/policy_builder.h
diff --git a/components/policy/core/common/cloud/policy_builder.h b/components/policy/core/common/cloud/policy_builder.h
index 630da6712be74a2ecbd7638ddb6a8d5440ae6ce8..be3297ae2a7cab8c0593bfbf3df8c83639e7322c 100644
--- a/components/policy/core/common/cloud/policy_builder.h
+++ b/components/policy/core/common/cloud/policy_builder.h
@@ -7,12 +7,12 @@
#include <stdint.h>
+#include <memory>
#include <string>
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#include "crypto/rsa_private_key.h"
#include "policy/proto/cloud_policy.pb.h"
@@ -59,7 +59,7 @@ class PolicyBuilder {
return policy_;
}
- scoped_ptr<crypto::RSAPrivateKey> GetSigningKey();
+ std::unique_ptr<crypto::RSAPrivateKey> GetSigningKey();
void SetSigningKey(const crypto::RSAPrivateKey& key);
void SetDefaultSigningKey();
void UnsetSigningKey();
@@ -69,7 +69,7 @@ class PolicyBuilder {
// new_public_key field, as if it were an initial key provision.
void SetDefaultInitialSigningKey();
- scoped_ptr<crypto::RSAPrivateKey> GetNewSigningKey();
+ std::unique_ptr<crypto::RSAPrivateKey> GetNewSigningKey();
void SetDefaultNewSigningKey();
void UnsetNewSigningKey();
@@ -78,14 +78,14 @@ class PolicyBuilder {
virtual void Build();
// Returns a copy of policy().
- scoped_ptr<enterprise_management::PolicyFetchResponse> GetCopy();
+ std::unique_ptr<enterprise_management::PolicyFetchResponse> GetCopy();
// Returns a binary policy blob, i.e. an encoded PolicyFetchResponse.
std::string GetBlob();
// These return hard-coded testing keys. Don't use in production!
- static scoped_ptr<crypto::RSAPrivateKey> CreateTestSigningKey();
- static scoped_ptr<crypto::RSAPrivateKey> CreateTestOtherSigningKey();
+ static std::unique_ptr<crypto::RSAPrivateKey> CreateTestSigningKey();
+ static std::unique_ptr<crypto::RSAPrivateKey> CreateTestOtherSigningKey();
// Verification signatures for the two hard-coded testing keys above. These
// signatures are valid only for the kFakeDomain domain.
@@ -102,7 +102,7 @@ class PolicyBuilder {
std::string* signature);
enterprise_management::PolicyFetchResponse policy_;
- scoped_ptr<enterprise_management::PolicyData> policy_data_;
+ std::unique_ptr<enterprise_management::PolicyData> policy_data_;
std::string payload_data_;
// The keys cannot be stored in NSS. Temporary keys are not guaranteed to
@@ -145,7 +145,7 @@ class TypedPolicyBuilder : public PolicyBuilder {
}
private:
- scoped_ptr<PayloadProto> payload_;
+ std::unique_ptr<PayloadProto> payload_;
DISALLOW_COPY_AND_ASSIGN(TypedPolicyBuilder);
};

Powered by Google App Engine
This is Rietveld 408576698