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

Unified Diff: chrome/test/chromedriver/element_util.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/element_util.h ('k') | chrome/test/chromedriver/logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/element_util.cc
diff --git a/chrome/test/chromedriver/element_util.cc b/chrome/test/chromedriver/element_util.cc
index 7ba14d30791ff33dcf8afa465c08ef2cee4a0f10..057ebd505d0361c8e63c434497cbd8aa3220ebdf 100644
--- a/chrome/test/chromedriver/element_util.cc
+++ b/chrome/test/chromedriver/element_util.cc
@@ -72,8 +72,8 @@ bool ParseFromValue(base::Value* value, WebRect* rect) {
return true;
}
-base::Value* CreateValueFrom(const WebRect& rect) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+std::unique_ptr<base::DictionaryValue> CreateValueFrom(const WebRect& rect) {
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetInteger("left", rect.X());
dict->SetInteger("top", rect.Y());
dict->SetInteger("width", rect.Width());
@@ -207,14 +207,15 @@ Status GetElementBorder(
} // namespace
-base::DictionaryValue* CreateElement(const std::string& element_id) {
- base::DictionaryValue* element = new base::DictionaryValue();
+std::unique_ptr<base::DictionaryValue> CreateElement(
+ const std::string& element_id) {
+ std::unique_ptr<base::DictionaryValue> element(new base::DictionaryValue());
element->SetString(kElementKey, element_id);
return element;
}
-base::Value* CreateValueFrom(const WebPoint& point) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+std::unique_ptr<base::DictionaryValue> CreateValueFrom(const WebPoint& point) {
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetInteger("x", point.x);
dict->SetInteger("y", point.y);
return dict;
« no previous file with comments | « chrome/test/chromedriver/element_util.h ('k') | chrome/test/chromedriver/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698