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

Unified Diff: content/common/font_list_mac.mm

Issue 2817603003: Remove ListValue::Append(raw ptr) on Mac and iOS (Closed)
Patch Set: Comments 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
Index: content/common/font_list_mac.mm
diff --git a/content/common/font_list_mac.mm b/content/common/font_list_mac.mm
index 5eebf2c05c129482170504c665354710ca9622e9..2648a32c0708e36a1aa82bf4e5d24ded27b0e203 100644
--- a/content/common/font_list_mac.mm
+++ b/content/common/font_list_mac.mm
@@ -6,7 +6,10 @@
#import <Cocoa/Cocoa.h>
+#include <utility>
+
#include "base/mac/scoped_nsautorelease_pool.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
@@ -31,12 +34,10 @@ std::unique_ptr<base::ListValue> GetFontList_SlowBlocking() {
for (NSString* family_name in sortedFonts) {
NSString* localized_family_name = fonts_dict[family_name];
- base::ListValue* font_item = new base::ListValue();
- base::string16 family = base::SysNSStringToUTF16(family_name);
- base::string16 loc_family = base::SysNSStringToUTF16(localized_family_name);
- font_item->Append(new base::Value(family));
- font_item->Append(new base::Value(loc_family));
- font_list->Append(font_item);
+ auto font_item = base::MakeUnique<base::ListValue>();
+ font_item->AppendString(base::SysNSStringToUTF16(family_name));
+ font_item->AppendString(base::SysNSStringToUTF16(localized_family_name));
+ font_list->Append(std::move(font_item));
}
return font_list;
« no previous file with comments | « content/browser/accessibility/accessibility_tree_formatter_mac.mm ('k') | ios/chrome/browser/passwords/password_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698