diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index cebede6e59..a1fad7e8e8 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -14,6 +14,7 @@ #include "atom/browser/web_dialog_helper.h" #include "atom/common/atom_constants.h" #include "base/files/file_util.h" +#include "base/memory/ptr_util.h" #include "chrome/browser/printing/print_preview_message_handler.h" #include "chrome/browser/printing/print_view_manager_basic.h" #include "chrome/browser/ssl/security_state_tab_helper.h" @@ -384,7 +385,7 @@ void CommonWebContentsDelegate::DevToolsAddFileSystem( auto pref_service = GetPrefService(GetDevToolsWebContents()); DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths); update.Get()->SetWithoutPathExpansion( - path.AsUTF8Unsafe(), base::Value::CreateNullValue()); + path.AsUTF8Unsafe(), base::MakeUnique()); web_contents_->CallClientFunction("DevToolsAPI.fileSystemAdded", file_system_value.get(), diff --git a/atom/browser/mac/dict_util.mm b/atom/browser/mac/dict_util.mm index 136ec1aba5..32141cdeb5 100644 --- a/atom/browser/mac/dict_util.mm +++ b/atom/browser/mac/dict_util.mm @@ -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 NSArrayToListValue(NSArray* arr) { if (sub_arr) result->Append(std::move(sub_arr)); else - result->Append(base::Value::CreateNullValue()); + result->Append(base::MakeUnique()); } else if ([value isKindOfClass:[NSDictionary class]]) { std::unique_ptr sub_dict = NSDictionaryToDictionaryValue(value); if (sub_dict) result->Append(std::move(sub_dict)); else - result->Append(base::Value::CreateNullValue()); + result->Append(base::MakeUnique()); } else { result->AppendString(base::SysNSStringToUTF8([value description])); } @@ -104,7 +105,7 @@ std::unique_ptr NSDictionaryToDictionaryValue( result->SetWithoutPathExpansion(str_key, std::move(sub_arr)); else result->SetWithoutPathExpansion(str_key, - base::Value::CreateNullValue()); + base::MakeUnique()); } else if ([value isKindOfClass:[NSDictionary class]]) { std::unique_ptr sub_dict = NSDictionaryToDictionaryValue(value); @@ -112,7 +113,7 @@ std::unique_ptr NSDictionaryToDictionaryValue( result->SetWithoutPathExpansion(str_key, std::move(sub_dict)); else result->SetWithoutPathExpansion(str_key, - base::Value::CreateNullValue()); + base::MakeUnique()); } else { result->SetStringWithoutPathExpansion( str_key, diff --git a/atom/common/native_mate_converters/v8_value_converter.cc b/atom/common/native_mate_converters/v8_value_converter.cc index fe4976ce64..35e3436e24 100644 --- a/atom/common/native_mate_converters/v8_value_converter.cc +++ b/atom/common/native_mate_converters/v8_value_converter.cc @@ -10,6 +10,7 @@ #include #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/values.h" #include "native_mate/dictionary.h" @@ -308,10 +309,10 @@ base::Value* V8ValueConverter::FromV8ValueImpl( return nullptr; if (val->IsExternal()) - return base::Value::CreateNullValue().release(); + return base::MakeUnique().release(); if (val->IsNull()) - return base::Value::CreateNullValue().release(); + return base::MakeUnique().release(); if (val->IsBoolean()) return new base::Value(val->ToBoolean()->Value()); @@ -381,7 +382,7 @@ base::Value* V8ValueConverter::FromV8Array( v8::Isolate* isolate) const { ScopedUniquenessGuard uniqueness_guard(state, val); if (!uniqueness_guard.is_valid()) - return base::Value::CreateNullValue().release(); + return base::MakeUnique().release(); std::unique_ptr scope; // If val was created in a different context than our current one, change to @@ -410,7 +411,7 @@ base::Value* V8ValueConverter::FromV8Array( else // JSON.stringify puts null in places where values don't serialize, for // example undefined and functions. Emulate that behavior. - result->Append(base::Value::CreateNullValue()); + result->Append(base::MakeUnique()); } return result; } @@ -429,7 +430,7 @@ base::Value* V8ValueConverter::FromV8Object( v8::Isolate* isolate) const { ScopedUniquenessGuard uniqueness_guard(state, val); if (!uniqueness_guard.is_valid()) - return base::Value::CreateNullValue().release(); + return base::MakeUnique().release(); std::unique_ptr scope; // If val was created in a different context than our current one, change to