refactoring: use std::make_unique<T> (#13245)
This commit is contained in:
parent
4dec5ec5f9
commit
28fd571d0c
29 changed files with 64 additions and 86 deletions
|
@ -62,9 +62,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
|
|||
atom::NSDictionaryToDictionaryValue(user_notification.userInfo);
|
||||
atom::Browser::Get()->DidFinishLaunching(*launch_info);
|
||||
} else {
|
||||
std::unique_ptr<base::DictionaryValue> empty_info(
|
||||
new base::DictionaryValue);
|
||||
atom::Browser::Get()->DidFinishLaunching(*empty_info);
|
||||
atom::Browser::Get()->DidFinishLaunching(base::DictionaryValue());
|
||||
}
|
||||
|
||||
#if BUILDFLAG(USE_ALLOCATOR_SHIM)
|
||||
|
|
|
@ -26,7 +26,7 @@ std::unique_ptr<base::ListValue> NSArrayToListValue(NSArray* arr) {
|
|||
if (!arr)
|
||||
return nullptr;
|
||||
|
||||
std::unique_ptr<base::ListValue> result(new base::ListValue);
|
||||
auto result = std::make_unique<base::ListValue>();
|
||||
for (id value in arr) {
|
||||
if ([value isKindOfClass:[NSString class]]) {
|
||||
result->AppendString(base::SysNSStringToUTF8(value));
|
||||
|
@ -79,7 +79,7 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
|||
if (!dict)
|
||||
return nullptr;
|
||||
|
||||
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue);
|
||||
auto result = std::make_unique<base::DictionaryValue>();
|
||||
for (id key in dict) {
|
||||
std::string str_key = base::SysNSStringToUTF8(
|
||||
[key isKindOfClass:[NSString class]] ? key : [key description]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue