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

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

Issue 318143003: Make CUS interface more resilient by returning a copy of the data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/component_updater/component_updater_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43bc6cf3018c5a3448f54944b0596bcf3e16957a..c439f73b7cbed803ca5a7c68ab4b509b995a2d4e 100644
--- a/chrome/browser/ui/webui/components_ui.cc
+++ b/chrome/browser/ui/webui/components_ui.cc
@@ -168,18 +168,13 @@ base::ListValue* ComponentsUI::LoadComponents() {
// Construct DictionaryValues to return to UI.
base::ListValue* component_list = new base::ListValue();
for (size_t j = 0; j < component_ids.size(); ++j) {
- const component_updater::CrxUpdateItem* item =
- cus->GetComponentDetails(component_ids[j]);
- if (item) {
+ component_updater::CrxUpdateItem item;
+ if (cus->GetComponentDetails(component_ids[j], &item)) {
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->status));
-
+ component_entry->SetString("name", item.component.name);
+ component_entry->SetString("version", item.component.version.GetString());
+ component_entry->SetString("status", ServiceStatusToString(item.status));
component_list->Append(component_entry);
}
}
« no previous file with comments | « chrome/browser/component_updater/component_updater_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698