chore: use std::make_unique/base::MakeRefCounted when possible (#29510)
This commit is contained in:
parent
a4decffe9a
commit
79cb5144ae
38 changed files with 106 additions and 101 deletions
|
@ -315,7 +315,7 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
|
|||
auto list = std::make_unique<base::ListValue>();
|
||||
if (!ConvertFromV8(isolate, val, list.get()))
|
||||
return false;
|
||||
*out = new network::ResourceRequestBody();
|
||||
*out = base::MakeRefCounted<network::ResourceRequestBody>();
|
||||
for (size_t i = 0; i < list->GetSize(); ++i) {
|
||||
base::DictionaryValue* dict = nullptr;
|
||||
std::string type;
|
||||
|
|
|
@ -391,7 +391,7 @@ std::unique_ptr<base::Value> V8ValueConverter::FromV8Array(
|
|||
val->CreationContext() != isolate->GetCurrentContext())
|
||||
scope = std::make_unique<v8::Context::Scope>(val->CreationContext());
|
||||
|
||||
std::unique_ptr<base::ListValue> result(new base::ListValue());
|
||||
auto result = std::make_unique<base::ListValue>();
|
||||
|
||||
// Only fields with integer keys are carried over to the ListValue.
|
||||
for (uint32_t i = 0; i < val->Length(); ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue