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

Unified Diff: remoting/host/host_config.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/host/host_config.h ('k') | remoting/host/host_config_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/host_config.cc
diff --git a/remoting/host/host_config.cc b/remoting/host/host_config.cc
index f46496200023aaf98eac776820ffb212274a2a09..95b66e283737c0d817cb4ef8978411e9bebfa5b9 100644
--- a/remoting/host/host_config.cc
+++ b/remoting/host/host_config.cc
@@ -8,20 +8,21 @@
#include "base/files/important_file_writer.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
namespace remoting {
-scoped_ptr<base::DictionaryValue> HostConfigFromJson(
+std::unique_ptr<base::DictionaryValue> HostConfigFromJson(
const std::string& json) {
- scoped_ptr<base::Value> value =
+ std::unique_ptr<base::Value> value =
base::JSONReader::Read(json, base::JSON_ALLOW_TRAILING_COMMAS);
if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) {
LOG(WARNING) << "Failed to parse host config from JSON";
return nullptr;
}
- return make_scoped_ptr(static_cast<base::DictionaryValue*>(value.release()));
+ return base::WrapUnique(static_cast<base::DictionaryValue*>(value.release()));
}
std::string HostConfigToJson(const base::DictionaryValue& host_config) {
@@ -30,7 +31,7 @@ std::string HostConfigToJson(const base::DictionaryValue& host_config) {
return data;
}
-scoped_ptr<base::DictionaryValue> HostConfigFromJsonFile(
+std::unique_ptr<base::DictionaryValue> HostConfigFromJsonFile(
const base::FilePath& config_file) {
// TODO(sergeyu): Implement better error handling here.
std::string serialized;
« no previous file with comments | « remoting/host/host_config.h ('k') | remoting/host/host_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698