Replace StringPiece with std::string_view in //codelabs
For a while base::StringPiece has been merely an alias to string_view. This CL removes all the uses of base::StringPiece and its variants from //codelabs Bug: 40506050 Change-Id: I0fb8cce6c16529ad971989a5af1f19b5e1129a9b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5555569 Commit-Queue: Claudio DeSouza <cdesouza@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1305765}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
bdb65de8a4
commit
6e72caacb7
codelabs/threading_and_scheduling
@ -2,11 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/task/sequence_manager/sequence_manager.h"
|
||||
#include "base/task/sequence_manager/task_queue.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
@ -23,7 +24,7 @@ enum class TaskPriority : base::sequence_manager::TaskQueue::QueuePriority {
|
||||
kNumPriorities = 2,
|
||||
};
|
||||
|
||||
void Task(base::StringPiece tq, int task_number) {
|
||||
void Task(std::string_view tq, int task_number) {
|
||||
if (tq == "A") {
|
||||
LOG(INFO) << "TaskQueue(" << tq << "): " << task_number;
|
||||
} else {
|
||||
|
@ -2,11 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/task/sequence_manager/sequence_manager.h"
|
||||
#include "base/task/sequence_manager/task_queue.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
@ -15,7 +16,7 @@ enum class TaskType : unsigned char {
|
||||
kSource1 = 1,
|
||||
};
|
||||
|
||||
void Task(base::StringPiece tq, int task_number) {
|
||||
void Task(std::string_view tq, int task_number) {
|
||||
if (tq == "A") {
|
||||
LOG(INFO) << "TaskQueue(" << tq << "): " << task_number;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user