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

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

Issue 2285933003: Remove more usage of the base::ListValue::Append(Value*) overload. (Closed)
Patch Set: rebase Created 4 years, 4 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/test/chromedriver/window_commands.cc ('k') | content/browser/accessibility/accessibility_ui.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 734fe2b98ecb6ebbace31a4e9ee78b652b654dcc..c5c60391bafd4a22743aba59113746b8451e8922 100644
--- a/content/browser/accessibility/accessibility_tree_formatter.cc
+++ b/content/browser/accessibility/accessibility_tree_formatter.cc
@@ -7,8 +7,10 @@
#include <stddef.h>
#include <memory>
+#include <utility>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -61,9 +63,10 @@ void AccessibilityTreeFormatter::RecursiveBuildAccessibilityTree(
for (size_t i = 0; i < ChildCount(node); ++i) {
BrowserAccessibility* child_node = GetChild(node, i);
- base::DictionaryValue* child_dict = new base::DictionaryValue;
- children->Append(child_dict);
- RecursiveBuildAccessibilityTree(*child_node, child_dict);
+ std::unique_ptr<base::DictionaryValue> child_dict(
+ new base::DictionaryValue);
+ RecursiveBuildAccessibilityTree(*child_node, child_dict.get());
+ children->Append(std::move(child_dict));
}
}
« no previous file with comments | « chrome/test/chromedriver/window_commands.cc ('k') | content/browser/accessibility/accessibility_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698