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

Unified Diff: content/browser/accessibility/accessibility_tree_formatter.cc

Issue 2891933004: Remove raw base::DictionaryValue::Set in //content (Closed)
Patch Set: Rebase Created 3 years, 7 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 | content/browser/accessibility/accessibility_tree_formatter_auralinux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/accessibility_tree_formatter.cc
diff --git a/content/browser/accessibility/accessibility_tree_formatter.cc b/content/browser/accessibility/accessibility_tree_formatter.cc
index 1b67e306638ae6ac2061d3f85fd4ea817c177ec4..6a37b875bb57aec4be5dc4dd316e96edb6122431 100644
--- a/content/browser/accessibility/accessibility_tree_formatter.cc
+++ b/content/browser/accessibility/accessibility_tree_formatter.cc
@@ -58,8 +58,7 @@ void AccessibilityTreeFormatter::RecursiveBuildAccessibilityTree(
const BrowserAccessibility& node, base::DictionaryValue* dict) {
AddProperties(node, dict);
- base::ListValue* children = new base::ListValue;
- dict->Set(kChildrenDictAttr, children);
+ auto children = base::MakeUnique<base::ListValue>();
for (size_t i = 0; i < ChildCount(node); ++i) {
BrowserAccessibility* child_node = GetChild(node, i);
@@ -68,6 +67,7 @@ void AccessibilityTreeFormatter::RecursiveBuildAccessibilityTree(
RecursiveBuildAccessibilityTree(*child_node, child_dict.get());
children->Append(std::move(child_dict));
}
+ dict->Set(kChildrenDictAttr, std::move(children));
}
void AccessibilityTreeFormatter::RecursiveFormatAccessibilityTree(
« no previous file with comments | « no previous file | content/browser/accessibility/accessibility_tree_formatter_auralinux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698