refactor: remove stray .c_str()
calls for absl::StrFormat()
(#47578)
refactor: remove stray .c_str() calls for absl::StrFormat() StrFormat() understands std::string, std::string_view Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
79d6160bdc
commit
4268bf91e4
10 changed files with 27 additions and 34 deletions
|
@ -199,9 +199,8 @@ GURL ElectronManagementAPIDelegate::GetIconURL(
|
|||
ExtensionIconSet::Match match,
|
||||
bool grayscale) const {
|
||||
GURL icon_url(absl::StrFormat(
|
||||
"%s%s/%d/%d%s", chrome::kChromeUIExtensionIconURL,
|
||||
extension->id().c_str(), icon_size, static_cast<int>(match),
|
||||
grayscale ? "?grayscale=true" : ""));
|
||||
"%s%s/%d/%d%s", chrome::kChromeUIExtensionIconURL, extension->id(),
|
||||
icon_size, static_cast<int>(match), grayscale ? "?grayscale=true" : ""));
|
||||
CHECK(icon_url.is_valid());
|
||||
return icon_url;
|
||||
}
|
||||
|
|
|
@ -215,7 +215,7 @@ bool CollectFramesForInjection(const api::scripting::InjectionTarget& target,
|
|||
ExtensionApiFrameIdMap::DocumentIdFromString(id);
|
||||
|
||||
if (!document_id) {
|
||||
*error_out = absl::StrFormat("Invalid document id %s", id.c_str());
|
||||
*error_out = absl::StrFormat("Invalid document id %s", id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ bool CollectFramesForInjection(const api::scripting::InjectionTarget& target,
|
|||
// request.
|
||||
if (!frame || content::WebContents::FromRenderFrameHost(frame) != tab) {
|
||||
*error_out = absl::StrFormat("No document with id %s in tab with id %d",
|
||||
id.c_str(), target.tab_id);
|
||||
id, target.tab_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -499,8 +499,8 @@ ExtensionFunction::ResponseAction ScriptingExecuteScriptFunction::Run() {
|
|||
args_expression = base::JoinString(string_args, ",");
|
||||
}
|
||||
|
||||
std::string code_to_execute = absl::StrFormat(
|
||||
"(%s)(%s)", injection_.func->c_str(), args_expression.c_str());
|
||||
std::string code_to_execute =
|
||||
absl::StrFormat("(%s)(%s)", *injection_.func, args_expression);
|
||||
|
||||
std::vector<mojom::JSSourcePtr> sources;
|
||||
sources.push_back(mojom::JSSource::New(std::move(code_to_execute), GURL()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue