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

Unified Diff: remoting/host/it2me/it2me_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/it2me/it2me_native_messaging_host.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
index b824c1b58ad9e4b5862be308f2672cdda52e8661..bee792e0b34c3d493870a90687d64aa80a4d41b3 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host.cc
@@ -13,6 +13,7 @@
#include "base/callback_helpers.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -133,7 +134,7 @@ void It2MeNativeMessagingHost::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)) {
@@ -183,9 +184,7 @@ void It2MeNativeMessagingHost::ProcessHello(
response->SetString("version", STRINGIZE(VERSION));
// This list will be populated when new features are added.
- std::unique_ptr<base::ListValue> supported_features_list(
- new base::ListValue());
- response->Set("supportedFeatures", supported_features_list.release());
+ response->Set("supportedFeatures", base::MakeUnique<base::ListValue>());
SendMessageToClient(std::move(response));
}
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/host/security_key/security_key_extension_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698