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

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: headers 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
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..f15ea483e06614c10e1c57e8cc42aa47022c5fee 100644
--- a/ash/common/system/chromeos/network/tray_sms.cc
+++ b/ash/common/system/chromeos/network/tray_sms.cc
@@ -4,6 +4,9 @@
#include "ash/common/system/chromeos/network/tray_sms.h"
+#include <memory>
+#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"
@@ -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();
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
sky 2016/10/03 21:48:18 MakeUnique?
dict->SetString(kSmsNumberKey, message_number);
dict->SetString(kSmsTextKey, message_text);
- messages_.Append(dict);
+ messages_.Append(std::move(dict));
Update(true);
}

Powered by Google App Engine
This is Rietveld 408576698