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

Unified Diff: content/browser/accessibility/accessibility_tree_formatter_blink.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
Index: content/browser/accessibility/accessibility_tree_formatter_blink.cc
diff --git a/content/browser/accessibility/accessibility_tree_formatter_blink.cc b/content/browser/accessibility/accessibility_tree_formatter_blink.cc
index ad862ccf8abdf2029e5a95d7577fa2ab9472c9ac..5c845ffe2a6b20ab0519bc3feb7b036a40a4e7c5 100644
--- a/content/browser/accessibility/accessibility_tree_formatter_blink.cc
+++ b/content/browser/accessibility/accessibility_tree_formatter_blink.cc
@@ -4,9 +4,13 @@
#include <stddef.h>
+#include <utility>
+
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/values.h"
#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
#include "content/browser/accessibility/browser_accessibility_manager.h"
#include "ui/gfx/geometry/rect_conversions.h"
@@ -120,7 +124,7 @@ void AccessibilityTreeFormatterBlink::AddProperties(
if (node.HasIntListAttribute(attr)) {
std::vector<int32_t> values;
node.GetIntListAttribute(attr, &values);
- base::ListValue* value_list = new base::ListValue;
+ auto value_list = base::MakeUnique<base::ListValue>();
for (size_t i = 0; i < values.size(); ++i) {
if (ui::IsNodeIdIntListAttribute(attr)) {
BrowserAccessibility* target = node.manager()->GetFromID(values[i]);
@@ -132,7 +136,7 @@ void AccessibilityTreeFormatterBlink::AddProperties(
value_list->AppendInteger(values[i]);
}
}
- dict->Set(ui::ToString(attr), value_list);
+ dict->Set(ui::ToString(attr), std::move(value_list));
}
}

Powered by Google App Engine
This is Rietveld 408576698