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

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

Issue 2820823005: Revert of Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: Created 3 years, 8 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/ui/webui/components_ui.h ('k') | chrome/browser/ui/webui/cookies_tree_model_util.cc » ('j') | 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 d815653ffc42925125f9655647d4e06bad03325a..2b716f5d6953be2e09b6e36f308d77358615a2a7 100644
--- a/chrome/browser/ui/webui/components_ui.cc
+++ b/chrome/browser/ui/webui/components_ui.cc
@@ -104,8 +104,9 @@
void ComponentsDOMHandler::HandleRequestComponentsData(
const base::ListValue* args) {
+ base::ListValue* list = ComponentsUI::LoadComponents();
base::DictionaryValue result;
- result.Set("components", ComponentsUI::LoadComponents());
+ result.Set("components", list);
web_ui()->CallJavascriptFunctionUnsafe("returnComponentsData", result);
}
@@ -163,14 +164,14 @@
}
// static
-std::unique_ptr<base::ListValue> ComponentsUI::LoadComponents() {
+base::ListValue* ComponentsUI::LoadComponents() {
component_updater::ComponentUpdateService* cus =
g_browser_process->component_updater();
std::vector<std::string> component_ids;
component_ids = cus->GetComponentIDs();
// Construct DictionaryValues to return to UI.
- auto component_list = base::MakeUnique<base::ListValue>();
+ base::ListValue* component_list = new base::ListValue();
for (size_t j = 0; j < component_ids.size(); ++j) {
update_client::CrxUpdateItem item;
if (cus->GetComponentDetails(component_ids[j], &item)) {
« no previous file with comments | « chrome/browser/ui/webui/components_ui.h ('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