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

Unified Diff: remoting/host/setup/me2me_native_messaging_host.cc

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 years, 6 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: remoting/host/setup/me2me_native_messaging_host.cc
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc
index 79db06a350b72ff8a891d1a1e9085d4c11d43ff5..544945f0f23b0c1ae80615e286f1f7f9acea17bc 100644
--- a/remoting/host/setup/me2me_native_messaging_host.cc
+++ b/remoting/host/setup/me2me_native_messaging_host.cc
@@ -96,7 +96,7 @@ Me2MeNativeMessagingHost::~Me2MeNativeMessagingHost() {
void Me2MeNativeMessagingHost::OnMessage(const std::string& message) {
DCHECK(task_runner()->BelongsToCurrentThread());
- std::unique_ptr<base::DictionaryValue> response(new base::DictionaryValue());
+ auto response = base::MakeUnique<base::DictionaryValue>();
std::unique_ptr<base::Value> message_value = base::JSONReader::Read(message);
if (!message_value->IsType(base::Value::Type::DICTIONARY)) {
OnError("Received a message that's not a dictionary.");
@@ -110,7 +110,7 @@ void Me2MeNativeMessagingHost::OnMessage(const std::string& message) {
// might be a string or a number, so cope with both.
const base::Value* id;
if (message_dict->Get("id", &id))
- response->Set("id", id->CreateDeepCopy());
+ response->Set("id", base::MakeUnique<base::Value>(*id));
std::string type;
if (!message_dict->GetString("type", &type)) {
@@ -181,7 +181,7 @@ void Me2MeNativeMessagingHost::ProcessHello(
new base::ListValue());
supported_features_list->AppendStrings(std::vector<std::string>(
kSupportedFeatures, kSupportedFeatures + arraysize(kSupportedFeatures)));
- response->Set("supportedFeatures", supported_features_list.release());
+ response->Set("supportedFeatures", std::move(supported_features_list));
SendMessageToClient(std::move(response));
}
@@ -456,7 +456,7 @@ void Me2MeNativeMessagingHost::SendConfigResponse(
DCHECK(task_runner()->BelongsToCurrentThread());
if (config) {
- response->Set("config", config.release());
+ response->Set("config", std::move(config));
} else {
response->Set("config", base::MakeUnique<base::Value>());
}
@@ -468,7 +468,7 @@ void Me2MeNativeMessagingHost::SendPairedClientsResponse(
std::unique_ptr<base::ListValue> pairings) {
DCHECK(task_runner()->BelongsToCurrentThread());
- response->Set("pairedClients", pairings.release());
+ response->Set("pairedClients", std::move(pairings));
SendMessageToClient(std::move(response));
}
« no previous file with comments | « remoting/host/security_key/security_key_extension_session.cc ('k') | rlz/chromeos/lib/rlz_value_store_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698