Skip to content

Commit 58e39d4

Browse files
tsepezchromeos-ci-prod
authored andcommitted
Remove stray const when passing std::string_view arguments.
These may be remnants from a time before string_view when a const char* would have made sense. Now the const doesn't matter. Fully automated change. Change-Id: I2dfc7ce30a54701639535a4f137dc18e71575fe2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5906184 Reviewed-by: Daniel Cheng <[email protected]> Owners-Override: Daniel Cheng <[email protected]> Commit-Queue: Tom Sepez <[email protected]> Cr-Commit-Position: refs/heads/main@{#1363323} CrOS-Libchrome-Original-Commit: b55f2f1f5e65a3f2da4ded9337553c7b37169e39
1 parent 46e7d7f commit 58e39d4

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

base/allocator/dispatcher/tls.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ PThreadTLSSystem& PThreadTLSSystem::operator=(PThreadTLSSystem&& other) {
9696

9797
bool PThreadTLSSystem::Setup(
9898
OnThreadTerminationFunction thread_termination_function,
99-
const std::string_view instance_id) {
99+
std::string_view instance_id) {
100100
#if DCHECK_IS_ON()
101101
// Initialize must happen outside of the allocation path. Therefore, it is
102102
// secure to verify with DCHECK.

base/allocator/dispatcher/tls.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class BASE_EXPORT PThreadTLSSystem {
111111
// @param thread_termination_function An optional function which will be
112112
// invoked upon termination of a thread.
113113
bool Setup(OnThreadTerminationFunction thread_termination_function,
114-
const std::string_view instance_id);
114+
std::string_view instance_id);
115115
// Tear down the TLS system. After completing tear down, the thread
116116
// termination function passed to Setup will not be invoked anymore.
117117
bool TearDownForTesting();
@@ -199,15 +199,15 @@ template <typename PayloadType,
199199
size_t AllocationChunkSize,
200200
bool IsDestructibleForTesting>
201201
struct ThreadLocalStorage {
202-
explicit ThreadLocalStorage(const std::string_view instance_id)
202+
explicit ThreadLocalStorage(std::string_view instance_id)
203203
: root_(AllocateAndInitializeChunk()) {
204204
Initialize(instance_id);
205205
}
206206

207207
// Create a new instance of |ThreadLocalStorage| using the passed allocator
208208
// and TLS system. This initializes the underlying TLS system and creates the
209209
// first chunk of data.
210-
ThreadLocalStorage(const std::string_view instance_id,
210+
ThreadLocalStorage(std::string_view instance_id,
211211
AllocatorType allocator,
212212
TLSSystemType tls_system)
213213
: allocator_(std::move(allocator)),
@@ -360,7 +360,7 @@ struct ThreadLocalStorage {
360360
}
361361

362362
// Perform common initialization during construction of an instance.
363-
void Initialize(const std::string_view instance_id) {
363+
void Initialize(std::string_view instance_id) {
364364
// The constructor must be called outside of the allocation path. Therefore,
365365
// it is secure to verify with CHECK.
366366

base/allocator/dispatcher/tls_unittest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct TLSSystemMockBase {
6969
bool,
7070
Setup,
7171
(internal::OnThreadTerminationFunction thread_termination_function,
72-
const std::string_view instance_id),
72+
std::string_view instance_id),
7373
());
7474
MOCK_METHOD(bool, TearDownForTesting, (), ());
7575
MOCK_METHOD(void*, GetThreadSpecificData, (), ());

base/hash/sha1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ BASE_EXPORT std::string SHA1HashString(std::string_view str);
3737

3838
// These functions allow streaming SHA-1 operations.
3939
BASE_EXPORT void SHA1Init(SHA1Context& context);
40-
BASE_EXPORT void SHA1Update(const std::string_view data, SHA1Context& context);
40+
BASE_EXPORT void SHA1Update(std::string_view data, SHA1Context& context);
4141
BASE_EXPORT void SHA1Final(SHA1Context& context, SHA1Digest& digest);
4242
} // namespace base
4343

base/hash/sha1_nacl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void SHA1Init(SHA1Context& context) {
168168
context.Init();
169169
}
170170

171-
void SHA1Update(const std::string_view data, SHA1Context& context) {
171+
void SHA1Update(std::string_view data, SHA1Context& context) {
172172
context.Update(data.data(), data.size());
173173
}
174174

base/test/test_suite.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ void TestSuite::DisableCheckForLeakedGlobals() {
443443

444444
void TestSuite::UnitTestAssertHandler(const char* file,
445445
int line,
446-
const std::string_view summary,
447-
const std::string_view stack_trace) {
446+
std::string_view summary,
447+
std::string_view stack_trace) {
448448
#if BUILDFLAG(IS_ANDROID)
449449
// Correlating test stdio with logcat can be difficult, so we emit this
450450
// helpful little hint about what was running. Only do this for Android

base/test/test_suite.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class TestSuite {
7272
// terminates the process.
7373
void UnitTestAssertHandler(const char* file,
7474
int line,
75-
const std::string_view summary,
76-
const std::string_view stack_trace);
75+
std::string_view summary,
76+
std::string_view stack_trace);
7777

7878
// Disable crash dialogs so that it doesn't gum up the buildbot
7979
virtual void SuppressErrorDialogs();

components/policy/core/common/policy_logger.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool IsLogExpired(PolicyLogger::Log& log) {
100100
PolicyLogger::Log::Log(const Severity log_severity,
101101
const Source log_source,
102102
const std::string& message,
103-
const std::string_view file,
103+
std::string_view file,
104104
const int line)
105105
: log_severity_(log_severity),
106106
log_source_(log_source),
@@ -118,7 +118,7 @@ PolicyLogger::LogHelper::LogHelper(
118118
const PolicyLogger::Log::Severity log_severity,
119119
const int log_verbosity,
120120
const PolicyLogger::Log::Source log_source,
121-
const std::string_view file,
121+
std::string_view file,
122122
const int line)
123123
: log_type_(log_type),
124124
log_severity_(log_severity),

components/policy/core/common/policy_logger.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class POLICY_EXPORT PolicyLogger {
8686
Log(const Severity log_severity,
8787
const Source log_source,
8888
const std::string& message,
89-
const std::string_view file,
89+
std::string_view file,
9090
const int line);
9191
Log(const Log&) = delete;
9292
Log& operator=(const Log&) = delete;
@@ -126,7 +126,7 @@ class POLICY_EXPORT PolicyLogger {
126126
const PolicyLogger::Log::Severity log_severity,
127127
const int log_verbosity,
128128
const PolicyLogger::Log::Source log_source,
129-
const std::string_view file,
129+
std::string_view file,
130130
const int line);
131131
LogHelper(const LogHelper&) = delete;
132132
LogHelper& operator=(const LogHelper&) = delete;

0 commit comments

Comments
 (0)