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

Unified Diff: chrome/browser/ui/webui/components_ui.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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: chrome/browser/ui/webui/components_ui.cc
diff --git a/chrome/browser/ui/webui/components_ui.cc b/chrome/browser/ui/webui/components_ui.cc
index 40bb188d3015f4af1bde140b51a12bd60191f9c6..e1662d67e7187099e14c53ac354e531547ea9cd0 100644
--- a/chrome/browser/ui/webui/components_ui.cc
+++ b/chrome/browser/ui/webui/components_ui.cc
@@ -7,7 +7,9 @@
#include <stddef.h>
#include <algorithm>
+#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include "base/macros.h"
@@ -172,12 +174,13 @@ base::ListValue* ComponentsUI::LoadComponents() {
for (size_t j = 0; j < component_ids.size(); ++j) {
update_client::CrxUpdateItem item;
if (cus->GetComponentDetails(component_ids[j], &item)) {
- base::DictionaryValue* component_entry = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> component_entry(
+ new base::DictionaryValue());
component_entry->SetString("id", component_ids[j]);
component_entry->SetString("name", item.component.name);
component_entry->SetString("version", item.component.version.GetString());
component_entry->SetString("status", ServiceStatusToString(item.state));
- component_list->Append(component_entry);
+ component_list->Append(std::move(component_entry));
}
}
« no previous file with comments | « chrome/browser/ui/webui/certificate_viewer_webui.cc ('k') | chrome/browser/ui/webui/cookies_tree_model_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698