refactor: replace base::StringPrintf() calls with absl::StrFormat() (#46050)
The former is now a pass-through for the latter and is slated for removal
Xref: https://issues.chromium.org/issues/40241565
4907781
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
4b72738b41
commit
c5310fff80
3 changed files with 17 additions and 18 deletions
|
@ -1067,9 +1067,9 @@ std::string Session::RegisterPreloadScript(
|
|||
});
|
||||
|
||||
if (it != preload_scripts.end()) {
|
||||
thrower.ThrowError(base::StringPrintf(
|
||||
"Cannot register preload script with existing ID '%s'",
|
||||
new_preload_script.id.c_str()));
|
||||
thrower.ThrowError(
|
||||
absl::StrFormat("Cannot register preload script with existing ID '%s'",
|
||||
new_preload_script.id));
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -1080,8 +1080,8 @@ std::string Session::RegisterPreloadScript(
|
|||
<< new_preload_script.file_path;
|
||||
} else {
|
||||
thrower.ThrowError(
|
||||
base::StringPrintf("Preload script must have absolute path: %s",
|
||||
new_preload_script.file_path.value().c_str()));
|
||||
absl::StrFormat("Preload script must have absolute path: %s",
|
||||
new_preload_script.file_path.value()));
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
@ -1110,9 +1110,8 @@ void Session::UnregisterPreloadScript(gin_helper::ErrorThrower thrower,
|
|||
}
|
||||
|
||||
// If the script is not found, throw an error
|
||||
thrower.ThrowError(base::StringPrintf(
|
||||
"Cannot unregister preload script with non-existing ID '%s'",
|
||||
script_id.c_str()));
|
||||
thrower.ThrowError(absl::StrFormat(
|
||||
"Cannot unregister preload script with non-existing ID '%s'", script_id));
|
||||
}
|
||||
|
||||
std::vector<PreloadScript> Session::GetPreloadScripts() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue