refactor: remove banned std::to_string() calls (#41087)
* refactor: do not use banned std::to_string() in ServiceWorkerContext::GetAllRunningWorkerInfo() * refactor: do not use banned std::to_string() in REPORT_AND_RETURN_IF_FAILED() * refactor: do not use banned std::to_string() in JSChunkedDataPipeGetter::OnWriteChunkComplete() * refactor: do not use banned std::to_string() in SetCrashKey() * chore: remove unused #include
This commit is contained in:
parent
d13a93fb61
commit
4164ef93ad
18 changed files with 31 additions and 35 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "shell/common/crash_keys.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
@ -12,6 +13,7 @@
|
|||
#include "base/environment.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "components/crash/core/common/crash_key.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
|
@ -55,11 +57,12 @@ void SetCrashKey(const std::string& key, const std::string& value) {
|
|||
if (key.size() >= kMaxCrashKeyNameLength) {
|
||||
node::Environment* env =
|
||||
node::Environment::GetCurrent(JavascriptEnvironment::GetIsolate());
|
||||
EmitWarning(env,
|
||||
"The crash key name, \"" + key + "\", is longer than " +
|
||||
std::to_string(kMaxCrashKeyNameLength) +
|
||||
" bytes, ignoring it.",
|
||||
"electron");
|
||||
EmitWarning(
|
||||
env,
|
||||
base::StringPrintf("The crash key name, \"%s\", is longer than %" PRIu32
|
||||
" bytes, ignoring it.",
|
||||
key.c_str(), kMaxCrashKeyNameLength),
|
||||
"electron");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue