refactor: replace use of deprecated base::JSONWriter::WriteJson()
(#41215)
* refactor: use base::WriteJson() in ListValueToNSArray() refactor: use base::WriteJson() in DictionaryValueToNSDictionary() * refactor: use base::WriteJson() in Debugger::SendCommand() * refactor: use base::WriteJson() in ScriptingExecuteScriptFunction::Run() * refactor: use base::WriteJson() in HandleAccessibilityRequestCallback()
This commit is contained in:
parent
9bfa16ad7f
commit
2ebaebb603
4 changed files with 13 additions and 16 deletions
|
@ -631,10 +631,11 @@ ExtensionFunction::ResponseAction ScriptingExecuteScriptFunction::Run() {
|
|||
std::vector<std::string> string_args;
|
||||
string_args.reserve(injection_.args->size());
|
||||
for (const auto& arg : *injection_.args) {
|
||||
std::string json;
|
||||
if (!base::JSONWriter::Write(arg, &json))
|
||||
if (auto json = base::WriteJson(arg)) {
|
||||
string_args.push_back(std::move(*json));
|
||||
} else {
|
||||
return RespondNow(Error("Unserializable argument passed."));
|
||||
string_args.push_back(std::move(json));
|
||||
}
|
||||
}
|
||||
args_expression = base::JoinString(string_args, ",");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue