0
Commit Graph

9 Commits

Author SHA1 Message Date
Helmut Januschka
fa9871dea2 Convert base::StringPiece to std::string_view in //components 5/5
The changes of this CL are made using the following script.
Script: https://issues.chromium.org/issues/40506050#comment343

Bug: 40506050
Change-Id: I8df4dd9fdd0f44ab37b779ebdfe203e28a2e4bf2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5501956
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Helmut Januschka <helmut@januschka.com>
Cr-Commit-Position: refs/heads/main@{#1299407}
2024-05-10 18:51:47 +00:00
Arthur Sonzogni
c571efbef3 Rename {absl => std}::optional in //components/
#cleanup

Automated patch. This is a no-op. Please avoid, to assign unrelated
bugs to this, as much as possible.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email

As of https://crrev.com/1204351, absl::optional is now a type alias
for std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^components/" \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
    | grep -v \
      -e "components/cast_streaming/browser/public/receiver_config.*" \
      -e "components/power_metrics/*" \
      -e "components/zucchini/patch_reader.*" \
    | sort \
    | uniq \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"

echo "Formatting:"

echo "IncludeBlocks: Regroup" >> ".clang-format"
echo "IncludeIsMainRegex: \"(_(android|apple|chromeos|freebsd|fuchsia|fuzzer|ios|linux|mac|nacl|openbsd|posix|stubs?|win))?(_(unit|browser|perf)?tests?)?$\"" >> ".clang-format"
git cl format
git restore ".clang-format"

git cl format
```

Bug: chromium:1500249
Change-Id: I34b45aba082a627d94fd9d3f9f994a60c64b40b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5200092
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1252820}
2024-01-26 20:26:18 +00:00
Avi Drissman
8ba1bad80d Update copyright headers in components/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: If6a3370b0b2849d889ce797596fe1ccbad2f3fe6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3891619
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1046502}
2022-09-13 19:22:36 +00:00
Peter Boström
b9e2c27ca6 Remove unused "base/macros.h" in components/
Removes `#include "base/macros.h"` from files in components/ that do not
contain `ignore_result(`.

Bug: 1010217
Change-Id: Ic1ea0c59d63652bc896e80638a7ff919c872f1c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3275012
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940666}
2021-11-11 05:31:49 +00:00
Peter Boström
09c0182fae Replace DISALLOW_COPY_AND_ASSIGN in components/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: I917bfbff1357e9e2cfe330d242feff6bb73e1bce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167004
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923103}
2021-09-20 22:43:27 +00:00
Anton Bikineev
1156b5f891 components: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: If697b7bf69b199c1796f873eedca3359cdb48c64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897151
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Owners-Override: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883296}
2021-05-15 22:35:36 +00:00
Hans Wennborg
29c74d3fa1 Remove/replace unnecessary includes of logging.h (components/)
If the file just needs the CHECK/CHECK_OP/NOTREACHED
macros, use the appropriate header for that instead.
Or if logging.h is not needed at all, remove it.

This is both a nice cleanup (logging.h is a big header,
and including it unnecessarily has compile-time costs),
and part of the final step towards making logging.h no
longer include check.h and the others.

Bug: 1031540
Change-Id: Ibeb7cc26e331161c5a1490b84ef5a59ecd122413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254029
Auto-Submit: Hans Wennborg <hans@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781841}
2020-06-24 13:46:35 +00:00
Peter Beverloo
e5eef71735 More detailed errors for webpush-encryption-08 failures
This splits the INVALID_BINARY_HEADER failure in four separate failures
that explain in greater detail why the header is invalid.

BUG=678347

Change-Id: I868ad7cf44ddf353951e7cfc78d6fecac56f4df0
Reviewed-on: https://chromium-review.googlesource.com/550136
Commit-Queue: Peter Beverloo <peter@chromium.org>
Reviewed-by: Anita Woodruff <awdf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482974}
2017-06-28 14:01:55 +00:00
peter
006f903402 Add a parser for messages with a Web Push Protocol-based payload
This will help to avoid doing manual parsing and verification of the
inbound messages in multiple places.

BUG=679789

Review-Url: https://codereview.chromium.org/2888763006
Cr-Commit-Position: refs/heads/master@{#473889}
2017-05-23 14:37:46 +00:00