| 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));
|
| }
|
|
|
|
|