Reland "Convert std::stoi() usage to base::StringToInt() in //chrome/browser/rlz."
This is a reland of commit 365c706dd2
. The
original CL didn't compile, but this was not caught by the default CQ
builders (nor by a local build, which was not configured with
is_chrome_branded=true). The reland has been specifically tested by:
- verifying an is_chrome_branded=true build fails with PS1
- verifying an is_chrome_branded=true build succeeds with PS2
Original change's description:
> Convert std::stoi() usage to base::StringToInt() in //chrome/browser/rlz.
>
> This is already banned by the PRESUBMIT.py, but existing uses were not
> fixed at the time.
>
> This CL was uploaded by git cl split.
>
> R=rogerta@chromium.org
>
> Bug: 1361117
> Change-Id: I7099b9288ec956e4d8f4956d265db5c9ae4a0212
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3880967
> Commit-Queue: Roger Tawa <rogerta@chromium.org>
> Auto-Submit: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Roger Tawa <rogerta@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1044699}
Bug: 1361117
Change-Id: Icdffed1f0376d2e75e5378615ea9ccea126a61c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3885336
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1045286}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
6f9605bee3
commit
c861a20165
@@ -8,6 +8,7 @@
|
||||
#include "base/check.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/notreached.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
@@ -61,9 +62,13 @@ void ChromeRLZTrackerDelegate::RegisterProfilePrefs(
|
||||
// possible to manually override the Preferences file on Chrome OS: the file
|
||||
// is already loaded into memory by the time you modify it and any changes
|
||||
// made get overwritten by Chrome.
|
||||
rlz_ping_delay_seconds =
|
||||
std::stoi(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
ash::switches::kRlzPingDelay));
|
||||
int parsed_delay_from_switch = 0;
|
||||
if (base::StringToInt(
|
||||
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
ash::switches::kRlzPingDelay),
|
||||
&parsed_delay_from_switch)) {
|
||||
rlz_ping_delay_seconds = parsed_delay_from_switch;
|
||||
}
|
||||
} else {
|
||||
rlz_ping_delay_seconds = 24 * 3600;
|
||||
}
|
||||
|
Reference in New Issue
Block a user