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

Unified Diff: components/policy/core/common/preg_parser_win.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/preg_parser_win.cc
diff --git a/components/policy/core/common/preg_parser_win.cc b/components/policy/core/common/preg_parser_win.cc
index 165f03c99a458ffb254de14302e26109d588ed43..0efcefdaa1d44590f28042444eaf0c17761d4eba 100644
--- a/components/policy/core/common/preg_parser_win.cc
+++ b/components/policy/core/common/preg_parser_win.cc
@@ -19,6 +19,7 @@
#include "base/i18n/case_conversion.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string16.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -119,7 +120,7 @@ std::string DecodePRegStringValue(const std::vector<uint8_t>& data) {
// Decodes a value from a PReg file given as a uint8_t vector.
bool DecodePRegValue(uint32_t type,
const std::vector<uint8_t>& data,
- scoped_ptr<base::Value>* value) {
+ std::unique_ptr<base::Value>* value) {
switch (type) {
case REG_SZ:
case REG_EXPAND_SZ:
@@ -172,7 +173,7 @@ void HandleRecord(const base::string16& key_name,
RegistryDict* subdict = dict->GetKey(name);
if (!subdict) {
subdict = new RegistryDict();
- dict->SetKey(name, make_scoped_ptr(subdict));
+ dict->SetKey(name, base::WrapUnique(subdict));
}
dict = subdict;
}
@@ -183,7 +184,7 @@ void HandleRecord(const base::string16& key_name,
std::string value_name(base::UTF16ToUTF8(value));
if (!base::StartsWith(value_name, kActionTriggerPrefix,
base::CompareCase::SENSITIVE)) {
- scoped_ptr<base::Value> value;
+ std::unique_ptr<base::Value> value;
if (DecodePRegValue(type, data, &value))
dict->SetValue(value_name, std::move(value));
return;
« no previous file with comments | « components/policy/core/common/preg_parser_win.h ('k') | components/policy/core/common/preg_parser_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698