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

Unified Diff: components/policy/core/common/proxy_policy_provider.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
Index: components/policy/core/common/proxy_policy_provider.cc
diff --git a/components/policy/core/common/proxy_policy_provider.cc b/components/policy/core/common/proxy_policy_provider.cc
index 74f95c9af172fd8df98190b0ca37bf1be4860b7f..a1af2c2bbd6d40ac64610f8453ad3ee16ea1614b 100644
--- a/components/policy/core/common/proxy_policy_provider.cc
+++ b/components/policy/core/common/proxy_policy_provider.cc
@@ -4,10 +4,10 @@
#include "components/policy/core/common/proxy_policy_provider.h"
+#include <memory>
#include <utility>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "components/policy/core/common/policy_bundle.h"
namespace policy {
@@ -26,7 +26,7 @@ void ProxyPolicyProvider::SetDelegate(ConfigurationPolicyProvider* delegate) {
delegate_->AddObserver(this);
OnUpdatePolicy(delegate_);
} else {
- UpdatePolicy(scoped_ptr<PolicyBundle>(new PolicyBundle()));
+ UpdatePolicy(std::unique_ptr<PolicyBundle>(new PolicyBundle()));
}
}
@@ -48,7 +48,7 @@ void ProxyPolicyProvider::RefreshPolicies() {
// Subtle: if a RefreshPolicies() call comes after Shutdown() then the
// current bundle should be served instead. This also does the right thing
// if SetDelegate() was never called before.
- scoped_ptr<PolicyBundle> bundle(new PolicyBundle());
+ std::unique_ptr<PolicyBundle> bundle(new PolicyBundle());
bundle->CopyFrom(policies());
UpdatePolicy(std::move(bundle));
}
@@ -57,7 +57,7 @@ void ProxyPolicyProvider::RefreshPolicies() {
void ProxyPolicyProvider::OnUpdatePolicy(
ConfigurationPolicyProvider* provider) {
DCHECK_EQ(delegate_, provider);
- scoped_ptr<PolicyBundle> bundle(new PolicyBundle());
+ std::unique_ptr<PolicyBundle> bundle(new PolicyBundle());
bundle->CopyFrom(delegate_->policies());
UpdatePolicy(std::move(bundle));
}

Powered by Google App Engine
This is Rietveld 408576698