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

Unified Diff: ash/common/system/chromeos/network/tray_sms.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique Created 4 years, 2 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 | « no previous file | chrome/browser/chromeos/arc/arc_policy_bridge_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/network/tray_sms.cc
diff --git a/ash/common/system/chromeos/network/tray_sms.cc b/ash/common/system/chromeos/network/tray_sms.cc
index 05d3b5b08511fe97d543ecec63a0e28c1e303296..a66886308ce283668e8021676646bbf9dab10b54 100644
--- a/ash/common/system/chromeos/network/tray_sms.cc
+++ b/ash/common/system/chromeos/network/tray_sms.cc
@@ -4,6 +4,8 @@
#include "ash/common/system/chromeos/network/tray_sms.h"
+#include <utility>
+
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/metrics/user_metrics_action.h"
#include "ash/common/system/tray/fixed_sized_scroll_view.h"
@@ -16,6 +18,7 @@
#include "ash/common/system/tray/tray_notification_view.h"
#include "ash/common/wm_shell.h"
#include "ash/resources/vector_icons/vector_icons.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chromeos/network/network_event_log.h"
@@ -368,10 +371,10 @@ void TraySms::MessageReceived(const base::DictionaryValue& message) {
"Received SMS from: " + message_number + " with text: " + message_text,
"");
- base::DictionaryValue* dict = new base::DictionaryValue();
+ auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetString(kSmsNumberKey, message_number);
dict->SetString(kSmsTextKey, message_text);
- messages_.Append(dict);
+ messages_.Append(std::move(dict));
Update(true);
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_policy_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698