Commit Graph
6 Commits
Author SHA1 Message Date
cdesouza-chromium 821274796b [IWYU] Fixing logging inclusions pt.11 (#29531)
This change is one of many fixing inclusion for the following files:

    - `base/notimplemented.h`
    - `base/notreached.h`
    - `base/check.h`
    - `base/dcheck_is_on.h`
    - `base/check_deref.h`
    - `base/check_op.h`
    - `base/logging/log_severity.h`
    - `base/logging.h`

This change is a mechanical change done with the following script:
https://github.com/brave/brave-browser/issues/46707#issuecomment-2960116515

Resolves https://github.com/brave/brave-browser/issues/46707
2025-06-12 13:48:07 +01:00
cdesouza-chromium 13a2432bc2 [spanify] Use safe buffers pt.1 (#26486)
This change touches in a few places where safe buffers usage can be
improved, by making use of `base::span`, and `std::array`.
2024-11-12 03:52:42 +00:00
cypt4 491750914c Remove NOTREACHED_IN_MIGRATION in base/process/ and browser/ui/webui/… (#26415)
Remove NOTREACHED_IN_MIGRATION in base/process/ and browser/ui/webui/settings/
2024-11-07 13:22:17 +04:00
Claudio DeSouza a19c44fed1 Use NOTREACHED_IN_MIGRATION()
`NOTREACHED()` has been marked as `[[noreturn]]`, and therefore will
break in many cases when building the code. The migration variant of the
macro is being used upstream to allow for a gradual migration of each
callsite.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/61831cb39155842c781f63214a7862bfd23e3390

commit 61831cb39155842c781f63214a7862bfd23e3390
Author: Peter Boström <pbos@chromium.org>
Date:   Wed May 22 21:32:53 2024 +0000

    Reland "Make NOTREACHED() without parameters [[noreturn]]"

    This is a reland of commit fdeac78ccd92e2cc578d8cfa04219599520138b4

    Original change's description:
    > Make NOTREACHED() without parameters [[noreturn]]
    >
    > Previous callers have been migrated to NOTREACHED_IN_MIGRATION(). This
    > also renames the few NOTREACHED_NORETURN() callers in base/ to
    > NOTREACHED() to verify that it's still working (no missing-return).
    >
    > Let's see how many times this needs to be reverted and relanded. :)
    >
    > Bug: 40580068
    > Change-Id: Ib8155e461ea9d0853c9508e28fc45389114da48c
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5548908
    > Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
    > Commit-Queue: Lei Zhang <thestig@chromium.org>
    > Owners-Override: Lei Zhang <thestig@chromium.org>
    > Auto-Submit: Peter Boström <pbos@chromium.org>
    > Commit-Queue: Peter Boström <pbos@chromium.org>
    > Reviewed-by: Lei Zhang <thestig@chromium.org>
    > Cr-Commit-Position: refs/heads/main@{#1303439}

    Bug: 40580068
2024-06-25 13:13:09 +01:00
cdesouza-chromium d1384a7872 [CodeHealth] Replace absl::optional with std::* (#21156)
This change replaces all uses of `absl::optional` with `std::*` variants
for optional. This is in line with upstream recent changes making
`absl::optional` a `typedef` to the `std` type.

This change has been done using an automated script:

    #!/bin/bash

    function replace {
      echo "Replacing $1 by $2"
      git grep -l "$1" \
        | cut -f1 -d: \
        | sort \
        | uniq \
        | grep \
          -e "\.h" \
          -e "\.cc" \
          -e "\.mm" \
          -e "\.py" \
        | xargs sed -i "s/$1/$2/g"
    }

    function delete_line_with {
      echo "Deleting lines with $1"
      git grep -l "$1" \
        | cut -f1 -d: \
        | sort \
        | uniq \
        | grep \
          -e "\.h" \
          -e "\.cc" \
          -e "\.mm" \
          -e "\.py" \
        | xargs sed -i "/$1/d"
    }

    function add_header {
      echo "Adding header $1"
      git diff --name-only HEAD \
        | xargs ../tools/add_header.py --header "$1"
    }

    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"
    add_header "<optional>"
    delete_line_with "\"third_party\/abseil-cpp\/absl\/types\/optional.h\""
    git cl format

Chromium change:
https://chromium.googlesource.com/chromium/src/+/d9d21aa16829a7d471a4f3b3a493a31170ed8271

commit d9d21aa16829a7d471a4f3b3a493a31170ed8271
Author: David Benjamin <davidben@chromium.org>
Date:   Mon Oct 2 23:29:57 2023 +0000

    Make absl::optional a typedef for std::optional

    This only changes the types around. It doesn't rewrite existing uses
    to std::optional, which we can do incrementally.

    absl::optional to std::optional seems to have two visible impacts.
    First, the field order is different (bool first vs bool last).
    std::optional's order (bool last) seems to be better overall, decreasing
    binary size. Second, absl::optional's assertions crash with
    __builtin_trap, while std::optional calls __libcpp_verbose_abort which
    calls base::ImmediateCrash. __builtin_trap permits the compiler to
    combine crash sites within a function but leads to worse crash
    debugging. In base::ImmediateCrash, we'd made a conscious decision to
    prefer debuggability and pay some binary size for it. The net size
    increase brings our optional type in line with that preference.

    For more details see the discussion and document below:
    https://groups.google.com/a/chromium.org/g/cxx/c/XG3G85_ZF1k/m/_QN8adIJBQAJ
    https://docs.google.com/document/d/1AW7q9HCLOk738OCj8Z2U_AKVUC0YIFZWuyRvv09XTHk/edit

    Binary-Size: See discussion above.
    Fuchsia-Binary-Size: See discussion above.
    Bug: 1373619
2023-12-01 10:16:12 +00:00
cypt4 c53e01ed88 Add cleanup pinned NFTs button (#17288)
* Add cleanup pinned NFTs button
Resolves https://github.com/brave/brave-browser/issues/28408
2023-03-19 21:25:23 +07:00