The changes of this CL are made using the following script.
```
target_directory="content/browser"
replace_string_in_files() {
old_string="$1"
new_string="$2"
find "$target_directory" -type f \( -name "*.cc" -o -name "*.h" \) \
-exec sed -i '' "s/$old_string/$new_string/g" {} +
}
delete_include() {
find "$target_directory" \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
grep -v '#include "base/strings/string_piece.h"' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
done
}
add_include() {
find "$target_directory" \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
local include_added=false
local tempfile=$(mktemp)
if grep -qE 'std::(string|u16string)_view' "$file"; then
while IFS= read -r line; do
echo "$line" >> "$tempfile"
if [[ $line =~ ^\s*#include ]]; then
if ! $include_added; then
echo "#include <string_view>" >> "$tempfile"
include_added=true
fi
fi
done < "$file"
mv "$tempfile" "$file"
if $include_added; then
echo "Added #include <string_view> after the first include line in $file"
else
echo "No include line found in $file"
fi
else
echo "std::string_view not found in $file"
fi
done
}
replace_string_in_files "base::StringPiece16" "std::u16string_view"
replace_string_in_files "base::StringPiece" "std::string_view"
delete_include
add_include
```
Replaced base::StringPiece16 with std::u16string_view
Replaced base::StringPiece with std::string_view
Removed header "base/strings/string_piece.h"
Added header "<string_view>" where applicable
Bug: 40506050
Change-Id: I2bc22c79dd9a0c839745afe065123f7a53c4a5ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5401117
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1281746}
All the callers are now on the UI thread, so remove all the locking and
complicated threading requirements. Do the same for PluginService.
Bug: 990013
Change-Id: Ie4dac75b4829825978d5873fd28f4ce75c14510b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866812
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058235}
Files that only use base::Contains() and no other base/stl_util.h helper
can replace base/stl_util.h with base/containers/contains.h.
Use grep to find all the files that include base/stl_util.h. Then filter
out the ones that need base/stl_util.h by running "grep -L base::func"
where "func" is a function that base/stl_util.h provides. For the
remaining files, grep for ones that use base::Contains(), and do search
and replace for stl_util.h. Take the resulting CL and run clang format.
Bug: 970209
Change-Id: I2fb47d7c91d910a2d431ab178b398f9bfa0eb8c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2853072
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#877398}
CHECK, CHECK_EQ etc., and NOTREACHED/NOTIMPLEMENTED have moved
to the much smaller headers check.h, check_op.h, and notreached.h,
respectively.
This CL updates .cc files to use those headers instead when
possible, with the purpose of saving compile time.
(Split out from https://crrev.com/c/2164525 which also has
notes on how the change was generated.)
Bug: 1031540
Change-Id: I643818242b92e19a1048fac89dd8aae323e8b1ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164510
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763511}
This change replaces usages of base::ContainsKey() and base::ContainsValue()
with base::Contains() in //content.
Reproduction:
- sed -i 's/\bbase::ContainsKey\b/base::Contains/g'
- sed -i 's/\bbase::ContainsValue\b/base::Contains/g'
- git cl format
This CL was uploaded by git cl split.
R=falken@chromium.org
Bug: 970209
Change-Id: Icbe57df713f3b326c5729cad76348c425d59fb7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648187
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667069}
In r630011, a LoadPlugins() call should have been removed, since it was
guarded by a conditional that was always false. Instead, it is always
being called.
Change-Id: I4dfb2294f0ee66aed9ed94a046176eb6b57b38dd
Reviewed-on: https://chromium-review.googlesource.com/c/1464927
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631420}
It only has one non-test caller, and that caller always passes in a
valid |use_stale| parameter. Update the unit tests to pass in the
parameter as well. After that, change it from an out parameter to the
return value.
Change-Id: Ia7862d74363b052c18ed9f37d4253c5f515f1d5f
Reviewed-on: https://chromium-review.googlesource.com/c/1456987
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630011}