Remove base::Value::CreateNullValue
https://codereview.chromium.org/2792573002
This commit is contained in:
parent
c7f2e2731c
commit
3d700ee49f
3 changed files with 13 additions and 10 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "atom/browser/mac/dict_util.h"
|
||||
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
|
||||
|
@ -45,14 +46,14 @@ std::unique_ptr<base::ListValue> NSArrayToListValue(NSArray* arr) {
|
|||
if (sub_arr)
|
||||
result->Append(std::move(sub_arr));
|
||||
else
|
||||
result->Append(base::Value::CreateNullValue());
|
||||
result->Append(base::MakeUnique<base::Value>());
|
||||
} else if ([value isKindOfClass:[NSDictionary class]]) {
|
||||
std::unique_ptr<base::DictionaryValue> sub_dict =
|
||||
NSDictionaryToDictionaryValue(value);
|
||||
if (sub_dict)
|
||||
result->Append(std::move(sub_dict));
|
||||
else
|
||||
result->Append(base::Value::CreateNullValue());
|
||||
result->Append(base::MakeUnique<base::Value>());
|
||||
} else {
|
||||
result->AppendString(base::SysNSStringToUTF8([value description]));
|
||||
}
|
||||
|
@ -104,7 +105,7 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
|||
result->SetWithoutPathExpansion(str_key, std::move(sub_arr));
|
||||
else
|
||||
result->SetWithoutPathExpansion(str_key,
|
||||
base::Value::CreateNullValue());
|
||||
base::MakeUnique<base::Value>());
|
||||
} else if ([value isKindOfClass:[NSDictionary class]]) {
|
||||
std::unique_ptr<base::DictionaryValue> sub_dict =
|
||||
NSDictionaryToDictionaryValue(value);
|
||||
|
@ -112,7 +113,7 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
|||
result->SetWithoutPathExpansion(str_key, std::move(sub_dict));
|
||||
else
|
||||
result->SetWithoutPathExpansion(str_key,
|
||||
base::Value::CreateNullValue());
|
||||
base::MakeUnique<base::Value>());
|
||||
} else {
|
||||
result->SetStringWithoutPathExpansion(
|
||||
str_key,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue