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

Unified Diff: components/policy/core/common/policy_map.cc

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
« no previous file with comments | « components/policy/core/common/policy_map.h ('k') | components/policy/core/common/policy_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/policy_map.cc
diff --git a/components/policy/core/common/policy_map.cc b/components/policy/core/common/policy_map.cc
index febad177ecbe2b902f027574c9f444d25c819b2c..4c225684e353f7c039ca55d50e1adf3f637fc7c9 100644
--- a/components/policy/core/common/policy_map.cc
+++ b/components/policy/core/common/policy_map.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/callback.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
namespace policy {
@@ -24,8 +25,8 @@ void PolicyMap::Entry::DeleteOwnedMembers() {
external_data_fetcher = NULL;
}
-scoped_ptr<PolicyMap::Entry> PolicyMap::Entry::DeepCopy() const {
- scoped_ptr<Entry> copy(new Entry);
+std::unique_ptr<PolicyMap::Entry> PolicyMap::Entry::DeepCopy() const {
+ std::unique_ptr<Entry> copy(new Entry);
copy->level = level;
copy->scope = scope;
copy->source = source;
@@ -112,10 +113,10 @@ void PolicyMap::CopyFrom(const PolicyMap& other) {
}
}
-scoped_ptr<PolicyMap> PolicyMap::DeepCopy() const {
+std::unique_ptr<PolicyMap> PolicyMap::DeepCopy() const {
PolicyMap* copy = new PolicyMap();
copy->CopyFrom(*this);
- return make_scoped_ptr(copy);
+ return base::WrapUnique(copy);
}
void PolicyMap::MergeFrom(const PolicyMap& other) {
« no previous file with comments | « components/policy/core/common/policy_map.h ('k') | components/policy/core/common/policy_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698