From e802ff8574b1a750f5dbf0fe50d03e22f7a1a91b Mon Sep 17 00:00:00 2001 From: Anastasiia N Date: Wed, 12 May 2021 15:42:48 +0000 Subject: [PATCH] CodeHealth: Remove use of ListValue::AppendStrings This change removes the use of `ListValue::AppendStrings()` and replaces with `Value::Append()`. This CL was uploaded by git cl split. R=johnchen@chromium.org Bug: 1187103 Change-Id: Ie903c4ca2b2d09f3d1112be7a0578bbd33e58e42 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2891479 Auto-Submit: Anastasiia N Commit-Queue: Anastasiia N Commit-Queue: John Chen Reviewed-by: John Chen Cr-Commit-Position: refs/heads/master@{#882077} --- performance_logger.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/performance_logger.cc b/performance_logger.cc index 923806bd..8a2d6e0d 100644 --- a/performance_logger.cc +++ b/performance_logger.cc @@ -260,10 +260,12 @@ Status PerformanceLogger::StartTrace() { return Status(kOk); } std::unique_ptr categories(new base::ListValue()); - categories->AppendStrings(base::SplitString(prefs_.trace_categories, - ",", - base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY)); + const std::vector str_list = + base::SplitString(prefs_.trace_categories, ",", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY); + for (const std::string& str : str_list) { + categories->Append(str); + } base::DictionaryValue params; params.Set("traceConfig.includedCategories", std::move(categories)); params.SetString("traceConfig.recordingMode", "recordAsMuchAsPossible");