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).
* Cleanup NOTREACHED_IN_MIGRATION.
* Use CookieSettingWithMetadata as it now has all required info.
* IsCookieAccessAllowedImpl no longer exists upstream.
* Remove now unused replacement.
* Remove CookieSettingOverrides from ShouldUseEphemeralStorage().
The use of weakly typed `render_frame_id` is being replaced by a
specific type called LocalFrameToken, to be passed from the renderer.
This change corrects our overrides of `ContentSettingsManager`, as well
as our own injected extension to it, to use this type.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/f8178e69f288c5d68072c9c985cbf82904cac212
commit f8178e69f288c5d68072c9c985cbf82904cac212
Author: Dave Tapuska <dtapuska@chromium.org>
Date: Tue Nov 14 18:50:13 2023 +0000
[content_settings] Pass frame tokens from the renderer
Change the mojo call to pass a strongly typed frame token instead
of a routing ID.
Bug: 993189
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/_QN8adIJBQAJhttps://docs.google.com/document/d/1AW7q9HCLOk738OCj8Z2U_AKVUC0YIFZWuyRvv09XTHk/edit
Binary-Size: See discussion above.
Fuchsia-Binary-Size: See discussion above.
Bug: 1373619
Chromium change:
https://chromium.googlesource.com/chromium/src/+/bfaa7208ef6e0a2255af3f66ce86a969ec6d5192
commit bfaa7208ef6e0a2255af3f66ce86a969ec6d5192
Author: Chris Fredrickson <cfredric@chromium.org>
Date: Tue Jan 31 17:13:24 2023 +0000
Remove unused kNone variant
This variant is never used explicitly, and there are no
default-initialized CookieSettingOverride variables, so it is never
used implicitly either.
Thus far, the only use of the CookieSettingOverride enum is in an
EnumSet, and in that use case, it's unnecessary to have an explicit
variant for "no override", since the set could just be empty instead.
(If, in the future, we need a way to represent "a single override or
maybe nothing", we should use a absl::optional<CookieSettingOverride>
for that.)
Change-Id: If0c6b37812818c581ccdcf5a1e2271e03a9ac57a
* Add presubmit check for IWYU export in chromium_src headers.
* Add // IWYU pragma: export to "src/" and "../gen/" includes.
* Export brave grit headers.
* Allow multiple includes for net_log_event_type_list.h.
* Std is not used in search_engines_handler.h.
* Fix recently added headers.