Commit Graph
99 Commits
Author SHA1 Message Date
Max Karolinskiy d0a0d82584 [cr149] rust_logger was split into smaller modules.
Also, verbose param has been removed from the print_rust_log function
signature.

Chromium changes:
https://chromium.googlesource.com/chromium/src.git/+/fafff21

commit fafff21030e1c11d6bbb1acccd6b28013cfd887f
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Tue Apr 7 17:28:03 2026 -0700

    [rust] Split the `rust_logger` crate into smaller modules.

    This helps to hide some implementation details as private items of
    the new, smaller modules.  In addition to moving the new modules into
    `//base/logging/rust_logger` subdirectory, this CL also moves tests
    into the same directory.  Summary of the changes/moves:

    * `base/logging/logger.rs` has been split into 4 modules:
        - `base/logging/rust_logger/lib.rs` (entry point via C API)
        - `base/logging/rust_logger/log_crate_integration.rs` and
          `base/logging/rust_logger/custom_panic_hook.rs`
        - `base/logging/rust_logger/print_rust_log.rs` (low-level
          implementation for invoking `LOG(...)` from Rust).
    * `base/logging/rust_log_integration.h/.cc` has been moved to
      `base/logging/rust_logger/print_rust_log_ffi.h/.cc`
    * `base/test/logging/test_rust_logger_consumer.rs` has been moved to
      `base/logging/rust_logger/test_support.rs`
    * `base/logging/rust_log_integration_unittest.cc` has been moved to
      `base/logging/rust_logger/unittests.cc`

    Bug: 495537792

https://chromium.googlesource.com/chromium/src.git/+/750f91c315307c59cb4f4b2445642e97187e620f

commit 750f91c315307c59cb4f4b2445642e97187e620f
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Wed Apr 8 16:25:46 2026 -0700

    [rust] Delete unfinished `VLOG(INFO)` <=> Rust integration.

    Bug: 495537792
2026-05-22 16:18:06 -04:00
AlexeyBarabash fc836f3b9b Revert "[Android] Temporarily disable kPartitionAllocFreeWithSize feature (#35329)"
This reverts commit 8333633c07.

Because it is DISABLED at cr148 since

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/23394958348e169660fe01722f985b2f8cdb81c6

commit 23394958348e169660fe01722f985b2f8cdb81c6
Author: Selma Bensaid <bselma@google.com>
Date:   Sun Mar 29 18:33:14 2026 -0700

    Revert "[PA] Roll out FreeWithSize to default-enabled"

    This reverts commit f32e2dd081a35717d7d6b9566df96a63d071c939.

    Reason for revert: b/495493036

    Original change's description:
    > [PA] Roll out FreeWithSize to default-enabled
    >
    > 1. Enable FreeWithSize by default with strict checks enabled, given
    >    100% stable launch for that configuration is approved.
    > 2. In fieldtrial, disable the strict checks for the next phase of
    >    experiment.
    >
    > Bug: 410190984
    > Change-Id: I1717e3d37f52387441cf4dadaa6d6267bd503b56
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7613331
    > Commit-Queue: Mikihito Matsuura <mikt@google.com>
    > Reviewed-by: Takashi Sakamoto <tasak@google.com>
    > Cr-Commit-Position: refs/heads/main@{#1592223}

    Bug: 410190984
    Change-Id: I5ba5e22d14685dc86dde302a2206107e65ed1ca5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7707531
    Commit-Queue: Takashi Sakamoto <tasak@google.com>
    Reviewed-by: Nathan Hebert <nhebert@chromium.org>
    Reviewed-by: Takashi Sakamoto <tasak@google.com>
    Cr-Commit-Position: refs/heads/main@{#1606858}
2026-04-27 12:01:01 +01:00
samartnik 8333633c07 [Android] Temporarily disable kPartitionAllocFreeWithSize feature (#35329)
[Android] Temporarily disable kPartitionAllocFreeWithSize feature
2026-04-08 09:52:19 -04:00
Max Karolinskiy efa79dfdd1 Changes check_chromium_src warning into an error. (#33823)
* Changes check_chromium_src warning into an error.
Changes the warning that catches use of defined symbols in the override,
but not in the original file into an error. All uses of such symbols
should be marked with // CHROMIUM_SRC_INTERNAL_USE comment.

* Removes symbol exclusions section of the config file.
All symbols that don't conform to check_chromium_src rules should be marked with // CHROMIUM_SRC_NOLINT comment.
2026-02-18 16:07:35 -05:00
Kevin Smith 560952392e [News] Add tracing for feed building algorithm (#34016) 2026-02-18 06:00:48 -05:00
cdesouza-chromium cfaf4c8d49 [CodeHealth][cr146] base::Contains() to be deleted (#33668)
[CodeHealth] `base::Contains()` to be deleted

The remaining cases of `base::Contains` in the codebase can be just
`std::ranges::contains`.

This change was done mechanically, with the following script

```bash
files_using_header="$(git grep -l base::Contains | tr '\n' ' ')"
sed -i 's/base::Contains/std::ranges::contains/g' \
  ${files_using_header}
../tools/add_header.py --header '<algorithm>' ${files_using_header}
files_including_header="$(git grep -l base/containers/contains.h | tr '\n' ' ')"
../tools/add_header.py --header '"base/containers/contains.h"' \
  --remove ${files_including_header}
git cl format
```

This CL also cherry-picks the contents of https://crrev.com/c/7380987 to
permit the use of certain range operations.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/4e6249c911b515cc237707ba751290c6dbe9970f

commit 4e6249c911b515cc237707ba751290c6dbe9970f
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date:   Sun Jan 18 11:32:26 2026 -0800

    Reland "Delete unused base::Contains()"

    This is a reland of commit 15af921783afac76cfc7d5beb04e4816ac0ffac7

    Original change's description:
    > Delete unused base::Contains()
    >
    > All callers were migrated.
    >
    > Fixed: 470391351
    > Change-Id: I404da9186a45c2c47669592242fac972ef70dfa3
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7459699
    > Auto-Submit: Victor Vianna <victorvianna@google.com>
    > Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
    > Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
    > Cr-Commit-Position: refs/heads/main@{#1570540}

    Bug: 470391351
    Change-Id: I858f7880bf8cb1857085eb44836dee4a0becf7ae
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7490440
    Owners-Override: Matthew Denton <mpdenton@chromium.org>
    Commit-Queue: Victor Vianna <victorvianna@google.com>
    Reviewed-by: Victor Vianna <victorvianna@google.com>
    Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
    Cr-Commit-Position: refs/heads/main@{#1570926}
2026-02-05 13:09:25 -03:00
cdesouza-chromium f5c6a0136f [CodeHealth] Use base::DictValue/base::ListValue - Part I (#33614)
These classes were hoisted and renamed. This has been replaced in
Chromium as well. This is a mechanical change for Brave, done with the
following script.

```
git grep -lw 'Value::List' | xargs sed -i 's/\bValue::List\b/ListValue/g'
git grep -lw 'Value::Dict' | xargs sed -i 's/\bValue::Dict\b/DictValue/g'
git cl format
```

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/6bc468d481835992696083e99e556516fb7f5f80

```
commit 6bc468d481835992696083e99e556516fb7f5f80
Author: Avi Drissman <avi@chromium.org>
Date:   Thu Jan 29 22:14:50 2026 -0800

    Remove aliases for base::DictValue and base::ListValue

    This removes a few last stragglers as well.

    Fixed: 478100525
    Cq-Include-Trybots: luci.chromium.try:win-official,mac-official,linux-official,android-official,android-desktop-x64-official
    Change-Id: If92142b8ab0562a82c609b71c6b2a7665cea6ec6
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7513889
    Auto-Submit: Avi Drissman <avi@chromium.org>
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Owners-Override: Daniel Cheng <dcheng@chromium.org>
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1577038}
```

Issue: https://github.com/brave/brave-browser/issues/52435
2026-02-04 12:54:52 -03:00
Claudio DeSouza 1ea19807fc [cr144] base::HexEncodeLower cherry-pick dropped
There's no need to continue cherry-picking these functions anymore, as
they are now part of M144.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/0d2478d1df359731d1391637935e49f517e27bfe

commit 0d2478d1df359731d1391637935e49f517e27bfe
Author: David Benjamin <davidben@chromium.org>
Date:   Thu Oct 30 13:39:24 2025 -0700

    Add base::HexEncodeLower and migrate a few callers

    Bug: 456472080
    Change-Id: Ic3faa954edb6aec3f08675a02a55413b8a70e6b9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7100923
    Commit-Queue: David Benjamin <davidben@chromium.org>
    Owners-Override: Daniel Cheng <dcheng@chromium.org>
    Auto-Submit: David Benjamin <davidben@chromium.org>
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1538143}
2025-12-21 17:12:48 -05:00
Claudio DeSouza 17a9c28711 [cr144] MemoryPressureListenerTag::kMax deleted
This change anchors our additions to this enum way down the line, as it
doesn't seem to matter if there are gaps in this enum value, as these
metrics are for histograms that go unreported.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/18b67dedd72300694aa987f92de09fd4e505af29

commit 18b67dedd72300694aa987f92de09fd4e505af29
Author: Patrick Monette <pmonette@chromium.org>
Date:   Fri Nov 7 12:52:49 2025 -0800

    Make a MemoryPressureListener for MemoryReclaimer

    The goal of this change is to separate all the memory pressure
    interventions in RenderThreadImpl::OnMemoryPressure so that they can
    be invoked separately.

    This is a necessary change for migrating all MemoryPressureListeners
    to the base::MemoryConsumer interface, where each intervention is
    tagged with different properties.

    Bug: 436324601
    Change-Id: Ie6c3fe4ae2f6ce36612a913ef181d5d478fef1d5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7127962
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Commit-Queue: Patrick Monette <pmonette@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1541975}
2025-12-20 23:56:18 +00:00
cdesouza-chromium 7f916ce099 [cr144-cherry-pick] Use base::HexEncodeLower (#32384)
This PR cherry-picks the implementation for `base::HexEncodeLower` into
our codebase, and converts all uses of the previous wallet
implementation to use the base one. A follow-up PR will convert other
places in the codebase where this base function will be appropriate.

Bug: https://github.com/brave/brave-browser/issues/50911

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/0d2478d1df359731d1391637935e49f517e27bfe

commit 0d2478d1df359731d1391637935e49f517e27bfe
Author: David Benjamin <davidben@chromium.org>
Date:   Thu Oct 30 13:39:24 2025 -0700

    Add base::HexEncodeLower and migrate a few callers

    Bug: 456472080
    Change-Id: Ic3faa954edb6aec3f08675a02a55413b8a70e6b9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7100923
    Commit-Queue: David Benjamin <davidben@chromium.org>
    Owners-Override: Daniel Cheng <dcheng@chromium.org>
    Auto-Submit: David Benjamin <davidben@chromium.org>
    Reviewed-by: Daniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1538143}
2025-11-18 15:14:07 +00:00
AlexeyBarabash d850fd2785 [cr142][Android] Obsolete kCollectAndroidFrameTimelineMetrics was removed
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/2517b26f8677a7e51f36b3c10ed3acb61e0777b7

	Cleanup Android.FrameTimeLineJank.* histograms and related code.

	The histograms are not being used actively to derive any investigations.
	Histogram emission was guarded behind feature flag which hasn't been
	enabled in any for some time.

	OBSOLETE_HISTOGRAMS: Patterned histograms
	Android.FrameTimelineJank.Duration{JankScenario},
	Android.FrameTimelineJank.FrameJankStatus{JankScenario},
	Android.FrameTimelineJank.{Scenario}.DelayedFramesPercentage.PerScroll{Length},
	Android.FrameTimelineJank.{Scenario}.MissedVsyncs{Operator}.PerScroll{Length}
	haven't been emitted in more than an year.

	Bug: 408388498
	Change-Id: Ice1d88847eef4a8a765d4886a25aba9428961e90
	Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6434049
2025-10-15 20:31:05 -04:00
Claudio DeSouza 952fda84ba [cr141] MemoryPressureListener requires a tag value
This argument has been added to the constructor of
`MemoryPressureListener`, and this change provides an override to insert
values just befor `kMax` for this enum class.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/5cb31fdf68faec8a8edc048929deb98b85de76f5

commit 5cb31fdf68faec8a8edc048929deb98b85de76f5
Author: Anthony Vallee-Dubois <anthonyvd@google.com>
Date:   Fri Aug 29 15:28:15 2025 -0700

    Reland "Add tags to MemoryPressureListeners"

    This reverts commit 1f46c281fcf29e14b87f36e7d4b79d906eea3425.

    Bug: None
    Original change's description:
    > Revert "Add tags to MemoryPressureListeners"
    >
    > This reverts commit 0eeecc8e0409ab00e8fdd4c1f7ebb8211e0e3e4e.
    >
    > Reason for revert: Tree closure
    >
    > Bug: None
    > Original change's description:
    > > Add tags to MemoryPressureListeners
    > >
    > > This will allow experimenting with suppressing ranges of memory pressure
    > > listeners, to measure performance impact.
    > >
    > > Bug: None
    > > Change-Id: I89f036c75599abf07e43e6af94c9129931fab0fb
    > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6898335
    > > Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
    > > Owners-Override: Francois Pierre Doray <fdoray@chromium.org>
    > > Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
    > > Cr-Commit-Position: refs/heads/main@{#1508488}
    >
    > Bug: None
    > No-Presubmit: true
    > No-Tree-Checks: true
    > No-Try: true
    > Change-Id: I2695c4b5cde0a6ca5da1d4ef53afbce22ebf42cb
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6900496
    > Owners-Override: Marlon Facey <mfacey@chromium.org>
    > Commit-Queue: Marlon Facey <mfacey@chromium.org>
    > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
    > Auto-Submit: Marlon Facey <mfacey@chromium.org>
    > Cr-Commit-Position: refs/heads/main@{#1508500}

    Bug: None
    Change-Id: I72f5530e91f8356b5967cad02b6fe23b43791e5d
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6900437
    Commit-Queue: Anthony Vallée-Dubois <anthonyvd@chromium.org>
    Auto-Submit: Anthony Vallée-Dubois <anthonyvd@chromium.org>
    Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
    Owners-Override: Francois Pierre Doray <fdoray@chromium.org>
    Reviewed-by: Anthony Cui <cuianthony@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1508651}
2025-09-22 15:00:05 -04:00
Aleksei Khoroshilov a41bf5350b Replace "src/" includes with <> in chromium_src. (#30096)
This change updates how brave/chromium_src overrides can reference original files: it adds ability to use #include <...> along with #include "src/...". This is enabled by replacing -I../../brave/chromium_src with -iquote../../brave_chromium_src, which adds an include search path only for #include "..." directives.

With this approach, other files in the build tree can reference brave/chromium_src overrides using #include "...", while the overrides themselves can reference original Chromium files using #include <...>. Since Chromium uses #include "..." for all in-tree files, we can leverage this convention and configure our overrides so that we can drop support for #include "src/" later by removing -I../../.. and making rbe_exec_root modification obsolete (the main goal).
2025-07-24 17:37:44 +07:00
Claudio DeSouza 7c78f49a0d [cr139] FeatureList::IsFeatureOverridden taking string_view
This only affects the override for this function.

Chromium changes:
https://chromium.googlesource.com/chromium/src/+/39bfd3b7c12cd34bdfd9e98eb2eae208838712b9

commit 39bfd3b7c12cd34bdfd9e98eb2eae208838712b9
Author: Alexei Svitkine <asvitkine@chromium.org>
Date:   Tue Jun 10 09:09:15 2025 -0700

    Use string_view in some base::FeatureList functions

    These all call functions that take string_view already, so we're not relying on the param being std::string to avoid some conversion.

    Change-Id: Ifb57a973f7857afef0a6677200256dbc6ff5a07a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6634071
    Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
    Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
    Auto-Submit: Alexei Svitkine <asvitkine@chromium.org>
    Reviewed-by: Caitlin Fischer <caitlinfischer@google.com>
    Cr-Commit-Position: refs/heads/main@{#1471837}
2025-07-16 13:38:32 -04:00
cdesouza-chromium 51fb253a7c [json64] Adding hooks to serde_json_lenient's visitor (#29768)
This PR is the first of a couple of changes to allow us to parse, and
carry over JSON content 64bit integer representation. This is currently
not possible, as Chromium's `base::Value` only support a range of
integer values that is valid to be represented JS.

This work aims to store integer values outside the allowed boundaries as
binary data into `base::Value`. This will be done through customisations
to `base::JSONReader`, and `base::JSONWriter`. Additionally, most of the
complexity will hopefully be hidden away by code generators in the
json-schema-compiler.

This first PR adds hooks into the visitor for `serde_json_lenient` that
will allow us to provide the special conversions to binary blob data for
large 64bit values that fall outside of what can be represented as
double without loss.

This PR is also introducing a build flag, namely,
`enable_json_64bit_int_support`, to allow us to have some compile time
control over to switch this feature off. This is necessary, as
`redirect_cc` cannot build `//brave/chromium_src` files the same way a
normal Brave build does, and therefore it is necessary to be able to
switch of these customisations in that mode.

Resolves https://github.com/brave/brave-browser/issues/47119
2025-07-15 16:51:26 +01:00
Aleksei Khoroshilov 6dafba18f8 Update chromium_src include logic to allow <> includes (#29652)
[chromium_src] Allow overrides to reference original files with #include <...>

This change updates the include path handling for brave/chromium_src overrides:
- Adds support for referencing original Chromium files using #include <...> in
overrides.
- Enables this by replacing -I../../brave/chromium_src with 
-iquote../../brave/chromium_src, so the path is only used for #include "..."
directives.

With this, other files in the build tree can reference brave/chromium_src
overrides using #include "...", while the overrides themselves can reference
original Chromium files using #include <...>. Since Chromium uses #include "..."
for all in-tree files, we can leverage this convention and eventually drop
support for #include "src/" by removing -I../../.. and making rbe_exec_root
modification obsolete.
2025-06-27 14:10:21 +07:00
cdesouza-chromium cb09ee9a5f [IWYU] Fixing logging inclusions pt.10 (#29530)
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 12:37:03 +01:00
Claudio DeSouza 460ee68881 [cr137] kExplicitHighResolutionTimerWin deleted
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/7cedd5365d2fc9be01f8f407469a1bacb7d253f2

commit 7cedd5365d2fc9be01f8f407469a1bacb7d253f2
Author: Gabriel Charette <gab@chromium.org>
Date:   Thu Apr 10 12:40:10 2025 -0700

    Cleanup ExplicitHighResolutionTimerWin

    Bug: 40158967
    Fixed: 362247076
    Change-Id: I91aa67db7ccf7ec87db2682593be90142d77a86c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6133860
    Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
    Commit-Queue: Gabriel Charette <gab@chromium.org>
    Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1445437}
2025-05-13 15:52:54 -04:00
Claudio DeSouza fedc01a1a0 [cr136] Remove CHECK from SetTestVendorIsBraveForTesting
That check is not required, and it was also removed from the upstream
version.

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

commit fed5d5a5726a7e2b2501eb49b8bebcb8cc71fdc0
Author: Cliff Smolinsky <cliffsmo@microsoft.com>
Date:   Mon Mar 24 11:03:26 2025 -0700

    Move AllowCheckIsTestForTesting to be before NetworkServiceTestHelper

    In some test libraries (browser_tests, chromeos browser_tests, and
    headless_browsertests, along with anything that inherits from them), the
    NetworkServiceTestHelper is created prior to the call to
    content::LaunchTests(). NetworkServiceTestHelper is test-specific code
    but currently cannot reference anything that uses CHECK_IS_TEST()
    because AllowCheckIsTestForTesting() is not called until LaunchTests().

    This change adds calls to AllowCheckIsTestForTesting() in these three
    locations. It also removes the reentrancy CHECK in
    AllowCheckIsTestForTesting() as it isn't really necessary. There are
    linter checks to prevent production code from reference *ForTesting
    methods.

    Bug: 404286909
2025-04-16 09:30:30 +01:00
Claudio DeSouza 4bd80af36c [cr136] Fix print_rust_log to log with overriden func
This change change the versbose path to use the overriden function for
the logging implementation, as the implementation could change
regardless.

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

commit f0fd42efd9fdb4f04acc6e4d0699a34700b41cbc
Author: Collin Baker <collinbaker@chromium.org>
Date:   Fri Mar 21 09:47:39 2025 -0700

    Format Rust log message body without intermediate allocation

    The Rust log adapter can avoid a heap allocation for each log record:
    instead of turning the provided std::fmt::Arguments into a CString,
    the former can be passed oqauely to C++ code. Then, the C++ side can
    call back with the formatter and an interface to the LogMessage

    The allocation for the filename can be removed once
    crrev.com/c/5765705 is in.

    Bug: 371112531
2025-04-16 09:30:29 +01:00
Claudio DeSouza c3209fb9b3 [cr136] Fix print_rust_log override args using cxx now
This is a simple change to the function signature itself to once again
be matching with the one in the override. The type changes are pretty
much analogous to what was there before.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/7cbc0d17f2eceb8ef0eb928fe8f8dd6d0163d3d0

commit 7cbc0d17f2eceb8ef0eb928fe8f8dd6d0163d3d0
Author: Collin Baker <collinbaker@chromium.org>
Date:   Wed Mar 19 14:02:01 2025 -0700

    Use cxx for FFI between Rust and C++ logging code

    Instead of bindgen, use cxx to generate binding for the C++
    print_rust_log fn called from Rust. This will make it possible to use
    cxx types such as rust::Str.

    Bindgen is still used to generate LogSeverity bindings, since that is
    the only way to have non-opaque bindings while keeping C++ as the
    source of truth.

    Bug: 371112531
2025-04-16 09:30:28 +01:00
Emerick Rogul f30d9f0d65 Remove BASE_EXPORT from print_rust_log function
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/7cbc0d17f2eceb8ef0eb928fe8f8dd6d0163d3d0

commit 7cbc0d17f2eceb8ef0eb928fe8f8dd6d0163d3d0
Author: Collin Baker <collinbaker@chromium.org>
Date:   Wed Mar 19 14:02:01 2025 -0700

    Use cxx for FFI between Rust and C++ logging code

    Instead of bindgen, use cxx to generate binding for the C++
    print_rust_log fn called from Rust. This will make it possible to use
    cxx types such as rust::Str.

    Bindgen is still used to generate LogSeverity bindings, since that is
    the only way to have non-opaque bindings while keeping C++ as the
    source of truth.

    Bug: 371112531
2025-04-16 09:30:28 +01:00
Emerick Rogul 565a26fd34 Map rust warnings to VLOG to avoid "excessive output" errors when running tests
Since the base logger was modified to include full file paths, we now are
bumping up against the "excessive output" error again due to certain Rust
crates' over-reliance on logging warnings. To avoid that, just map warnings to
VLOG as well.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/d2a02a7a2cde885a3e1ddc624f3f17f0b3a63bd8

commit d2a02a7a2cde885a3e1ddc624f3f17f0b3a63bd8
Author: Peter Boström <pbos@chromium.org>
Date:   Wed Mar 5 15:39:22 2025 -0800

    Log path/to/filename:line

    Our codebase is large, finding which `version.h` is being logged from is
    tedious. The format changes from foo.cc(10) to path/to/foo.cc:10 (or
    path\to\foo.cc:10). The non-Windows format can be directly pasted into
    codesearch.

    Bug: None
2025-04-16 09:30:24 +01:00
Claudio DeSouza 9ffec9efd0 [cr134] Override for prefetto categories simplified
This override had to be update as the category declaration has been
updated for all those listed.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/32b001c89dc2f186bfebe1d19a85fc74c61750eb

commit 32b001c89dc2f186bfebe1d19a85fc74c61750eb
Author: Etienne Pierre-doray <etiennep@chromium.org>
Date:   Tue Jan 7 07:44:42 2025 -0800

    [tracing] Update builtin categories to use perfetto API

    This CL simplifies builtin categories definition, and uses
    SetDescription to declare existing category descriptions.
    Drive-by: remove some (non-exhaustive) unused categories.

    Bug: 343404899
2025-02-18 12:46:52 +00:00
cdesouza-chromium b55418f7a3 Deleting all base::ranges uses (#27446)
All range implementations are now deleted in chromium and the std
implementation is to be used in its place.

This is a mechanical change.

```bash
function add_header {
  echo "Adding header $1"
  git diff --name-only \
    | xargs ../tools/add_header.py --header "$1"
  git grep -l "std::ranges" \
    | xargs ../tools/add_header.py --header "$1"
}

function remove_header {
  echo "Removing header $1"
  git diff --name-only \
    | xargs ../tools/add_header.py --header "$1" --remove
  git grep -l "$1" \
    | xargs ../tools/add_header.py --header "$1" --remove
}
```

Chromium change:
https://chromium.googlesource.com/chromium/src/+/3b811ffd3cef9d11cda6812ac4d22dcfdbad7d0f

commit 3b811ffd3cef9d11cda6812ac4d22dcfdbad7d0f
Author: Peter Kasting <pkasting@chromium.org>
Date:   Wed Jan 29 14:20:16 2025 -0800

    Remove base/ranges/.

    Bug: 386918226

Resolves https://github.com/brave/brave-browser/issues/43664
2025-02-01 16:05:11 +00:00
Claudio DeSouza 23aabf0fe1 [cr133] base::make_span deleted
All uses of `base::make_span` can be just `span{}`.

Chromium change:
https://chromium-review.googlesource.com/c/chromium/src/+/6066402

commit b394ea77c33ed427269ad91712467c2da6e12e7e
Author: Peter Kasting <pkasting@chromium.org>
Date:   Tue Dec 3 23:04:42 2024 +0000

    Remove make_span.

    This is no longer used.

    Bug: 341907909
2025-01-27 09:41:08 -05:00
Claudio DeSouza c36351337e [cr133] Drop cherry-picked base::zip
This CL had been cherry-picked into brave to help with the unsafe
buffers fixes, but now it is available in chromium's master.

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

commit e4c7665bcd2e1f8b5f480bfd937beed994633f50
Author: Claudio DeSouza <cdesouza@chromium.org>
Date:   Wed Nov 13 04:28:00 2024 +0000

    Add a for-range loop `zip` adapter

    This CL adds a `zip` helper to base utility types to allows us to do
    basic `zip` operations in lockstep with different ranges.

    ```cxx
    std::vector<int> a = {1, 2, 3};
    std::vector<double> b = {4.5, 5.5, 6.5};
    std::vector<std::string> c = {"x", "y", "z"};
    for (auto [x, y, z] : zip(a, b, c)) {
      LOG(INFO) << x << " " << y << " " << z;
    }
    ```

    Bug: 377940847
2025-01-27 09:36:25 -05:00
Terry Mancey 8ee36f4595 [ads] Add “brave.ads” to the internal trace list 2025-01-13 09:57:54 -05:00
Pavel Beloborodov 1f0e2fcc75 Added Custom Scriptlet section in the settings page. (#25999)
* Added Custom Scriptlet section in the settings page.
* Added security warning message.
* Added adblock `Developer mode` protected pref.
* Make custom filters readonly if dev-mode is disabled.
2024-12-13 12:22:43 +07:00
Claudio DeSouza 2f84473f88 [cr132][rust] Log serverity/verbose passed in
Upstream has moved the logic to determine log serverity/verbosity into
rust code. This change corrects our own overrides for `TRACE`/`DEBUG`
logs accordingly.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/191a4d32cef75f93eef5637ddce77263c9c87f36

commit 191a4d32cef75f93eef5637ddce77263c9c87f36
Author: Lukasz Anforowicz <lukasza@chromium.org>
Date:   Tue Nov 12 01:48:08 2024 +0000

    Reland2 "Use logging::LogSeverity directly in Rust log crate plumbing"

    This reverts commit ac4d0fcfec323209945a283d9b64d5688adb8517 and makes a
    few extra tweaks to ensure all the dependencies are represented in the
    build graph.  Original CL description follows below.

    Instead of making a new macro that duplicates the LogSeverity, move the
    LogSeverity into its own header, generate bindgen from it, and use it
    directly from the Rust logger implementation.

    We add the `verbose` flag which is true for `trace!` macros, as we
    intend to only include those logs when verbose logging is enabled. For
    now, they are logged equally as `debug!`.

    R=pbos@chromium.org

    Fixed: 372907698
2024-12-01 08:43:55 -05:00
Claudio DeSouza e64e932277 [cr132] JSONReader using rust's implementation by default
There were some overrides in place to enforce the use of the rust parser
for `APIRequestHelper` and similar APIs. However, the rust parser is now
switched by default in upstream. This change does away with the
overrides that were added, and uses the regular `JSONReader` interface.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/9ddc1624637c8cfa8ef50a95abd779e0ba4d67f6

commit 9ddc1624637c8cfa8ef50a95abd779e0ba4d67f6
Author: danakj <danakj@chromium.org>
Date:   Thu Nov 7 22:14:14 2024 +0000

    Make rust toolchain non-optional in chromium and move flags out of build

    The //build dir should contain things that apply to all projects using
    the directly. Moving the gn args for specific chromium projects out of
    //build/config/rust.gni into the Chromium tree next to the features they
    are flags for.

    Removed the flags that now default to on. They were gated on enable_rust
    but enable_rust is always true in Chromium, so in Chromium code we can
    just assume it's true. Thus the features are always enabled. Removed
    buildflags etc for these removed GN args.

    Gating Rust in //base on IS_NACL rather than rust-specific toolchain
    flags, as Rust is always available in Chromium in all of our build
    configurations except NaCl (and it will be going away in under a year
    now).
2024-12-01 08:43:53 -05:00
Claudio DeSouza 1911f3341f [cr132][rust] Convert spammy debug logs into VLOGs
This change has been necessary as `html5ever` was spamming the logger
with every single tokenised character, which was causing error failures
in the CI.

An issue[1] was opened with the authors, however it is better to have
these logs guarded as `VLOG`s.

[1] https://github.com/servo/html5ever/issues/561

Chromium change:
https://chromium.googlesource.com/chromium/src/+/7ea0a5e831dd5f98f24b4403e9eb238e061c5808

commit 7ea0a5e831dd5f98f24b4403e9eb238e061c5808
Author: Thirumurugan <thiruak1024@gmail.com>
Date:   Wed Oct 16 15:44:03 2024 +0000

    Connect the Rust log crate to the //base logging implementation

    Bug: 339678662, 40278279
2024-12-01 08:43:46 -05:00
Aleksei Khoroshilov c726422513 Alias settings_client internals to see it in a memory dump. (#26654)
* Alias settings_client internals to see in a memory dump.

* Prevent few optimizations to keep the object on stack.

* Keep ExecutionContext type in the dump.
2024-11-22 08:17:17 +01:00
cdesouza-chromium a0fcd1ca4b [unsafe-buffers] Improve ephemeral storage browser tests (#26529)
This change removes all uses of unsafe buffers in ephemeral storage
browser tests. It also cherry picks the recently introduced `base::zip`
into brave.

Resolves https://github.com/brave/brave-browser/issues/42269
Resolves https://github.com/brave/brave-browser/issues/42271
2024-11-13 22:31:47 +00:00
cdesouza-chromium d0becfcd17 [CodeHealth] Apply modernize-concat-nested-namespaces (#26498)
This change modernises several namespace declarations, to be shorter, as
this notation has been available since cxx17.

https://clang.llvm.org/extra/clang-tidy/checks/modernize/concat-nested-namespaces.html
2024-11-12 17:00:09 +00:00
cdesouza-chromium 4e7fcd376f [CodeHealth] Use std::string::[starts|ends]_with (#26306)
For cases where the comparison is case sensitive, we should use the
methods provided by the common std string types provided since cxx20.
2024-10-31 13:44:30 +00:00
Brian Johnson 3313ad628b remove include rules that no longer apply (#25911)
remove include rules that no longer apply and fix existing include rules
2024-10-10 16:19:48 -07:00
Claudio DeSouza 7fd7b83e2b No more UmaHistogramEnumeration override variants
This function used to have two variants, one taking a string value, and
another taking a pointer. The two variants are now a single one using a
string view arg. This dispenses of two overrides for each variant, and
this change corrects that.

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

commit bb5cb56e8987de4ee255ae9f67ed83009e24ed04
Author: Alex Turner <alexmt@chromium.org>
Date:   Mon Aug 12 17:12:42 2024 +0000

    Add std::string_view versions of base::UmaHistogram* functions

    Defines an additional overload of these functions that uses
    std::string_view. We keep the existing const char* and const
    std::string& versions to avoid code bloat, but move some to a separate
    header. Introduces linting to keep those two versions synchronized.
    Also makes consequential changes to histogram classes to permit these
    new overloads. (Note that these changes cannot be easily moved to a
    separate header so are kept in the main class declarations.)

    Bug: 358538894
2024-09-10 14:42:40 -04:00
goodov b47f8ca377 Enable important Chromium browser lifetime tests (#24671)
Enable "Variations" and "Shutdown" upstream tests.
2024-07-23 11:51:14 +07:00
goodov 85172e8e87 CHECK on feature overrides reserve limit in non-component builds (#24565)
Check on feature overrides reserve limit in non-component build.
2024-07-09 22:00:55 +07:00
vadimsandNuo Xu 43735ef5b2 Deprecate local node support and ipfs scheme (#23808)
deprecated IPFS local node support and IPFS scheme
https://github.com/brave/brave-browser/issues/37735
---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
Co-authored-by: Nuo Xu <nuoxu.nx@gmail.com>
2024-07-09 12:34:31 +02:00
Emerick Rogul 1a1cce175e Avoid static assertion with our negative PageActionIconType values
The UmaHistogramEnumeration functions perform static assertion checks on their
types using uintmax_t, but we've added to the types using negative numbers so we
need to allow for those.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/1be087741feee0d0558405ffb0ac12bec48059ec

commit 1be087741feee0d0558405ffb0ac12bec48059ec
Author: Brian White <bcwhite@chromium.org>
Date:   Tue May 28 18:51:44 2019 +0000

    Have histogram-functions take native char* names.

    Without this, the compiler emits ctor/dtor code to convert constant
    strings to std::string making the call about 100x larger in size and
    almost 2x the size of a caching macro instantiation.

    According to the Android binary-size try-bot, saves about 4K...

    Specifics:
    -4,096 bytes main lib size
    -4,738 bytes normalized apk size
    InstallSize:
    -4,122 bytes APK size
    -4,122 bytes Estimated installed size (Android Go)
    -4,122 bytes Estimated installed size
    InstallBreakdown (-4,066 bytes):
    +28 bytes unwind_cfi (dev and canary only) size
    -4,096 bytes Native code size
    +2 bytes Package metadata size

    Bug: 94484
2024-06-25 13:13:09 +01:00
Mikhail f6c50a76ce Moves IsMemoryAllocatorDumpNameInAllowlist to BraveProcessMemoryDumpTest (#23754)
Make BraveProcessMemoryDumpTest
2024-05-22 22:51:10 +01:00
Aleksey Khoroshilov bacbcbc78a Do not report flaky failures in upstream tests. 2024-05-13 18:30:33 +07:00
Aleksey Khoroshilov d4c5403e00 Fix few nits. 2024-05-13 18:30:33 +07:00
Aleksey Khoroshilov 91ac3888f9 Review fixes. 2024-05-13 18:30:33 +07:00
Aleksey Khoroshilov 7c6c5fbd29 Cleanup base:: references in namespace base {}. 2024-05-13 18:30:33 +07:00
Aleksey Khoroshilov 9bc746b291 Add teamcity test reporting to browser/unit tests. 2024-05-13 18:30:32 +07:00
Michael Herrmann fb192a5adc Remove Widevine ARM64 DLL fix (#23415)
Upstream now offers the DLL from its public component update server.
2024-05-07 10:02:08 +09:00
Aleksey Khoroshilov 6f79bda149 Fix base::Feature override propagation to blink.
Chromium change:commit bd5c53cee33440161338f84028160597d4c35a90
Author: François Doray <fdoray@chromium.org>
Date:   Tue Mar 19 19:32:44 2024 +0000

    Reland "Enable ReduceCookieIPCs by default."

    This is a reland of commit 1446ec926e7198e6cd7ca271b000916bd694d47c

    The change was reverted because it broke GetCookiesString() calls
    on WebView. The bug was identified and fixed with https://crrev.com/c/5368234.

    Original change's description:
    > Enable ReduceCookieIPCs by default.
    >
    > The feature has a positive impact on performance on Windows, Mac
    > and ChromeOS and Android Browser:
    >   go/catan2023h2-individual-optimizations
    >
    > On Android Webview, no shared memory is returned to the renderer
    > due to [1], so the IPC is never bypassed [2].
    >
    > [1] https://source.chromium.org/chromium/chromium/src/+/main:android_webview/browser/network_service/aw_proxying_restricted_cookie_manager.cc;l=188;drc=4dbc034a20d71ba93b61d60d1d26526d6d8cc1c1
    > [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/loader/cookie_jar.cc;l=188;drc=7dc3003765c74daa4bb49e4463e3a7963d8c7ea1
    >
    > Bug: 1393050
    > Change-Id: I29ec122a7830f1b342d8af9ee3c11e3e308b7e4e
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5273404
    > Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
    > Reviewed-by: Olivier Li <olivierli@chromium.org>
    > Auto-Submit: Francois Pierre Doray <fdoray@chromium.org>
    > Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
    > Cr-Commit-Position: refs/heads/main@{#1257024}

    Bug: 1393050
    Change-Id: I94daa51828d3f77c64f901d55877bfe0096b20d9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5380980
    Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
    Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
    Commit-Queue: Francois Pierre Doray <fdoray@chromium.org>
    Commit-Queue: Olivier Li <olivierli@chromium.org>
    Reviewed-by: Maks Orlovich <morlovich@chromium.org>
    Auto-Submit: Olivier Li <olivierli@chromium.org>
2024-05-03 16:54:28 -04:00