The upstream Chromium test BrowserContextDestructionVsCookieRemoval
flakes because document.cookie (set via JavaScript in the renderer)
uses a different Mojo pipe than GetAllCookies (queried from the browser
via CookieManager), with no ordering guarantee between the two.
Brave amplifies this from the upstream ~0.6 % rate because Ephemeral
Storage forces every cookie operation through IPC (disabling Chromium's
cookie cache optimization in CookieJar::IPCNeeded).
Add a chromium_src override for browsing_data_test_util.cc that calls
HasDataForType after SetDataForType. For cookies this forces a
round-trip through RestrictedCookieManager → CookieStore, serialising
with the prior SetCanonicalCookieAsync on the same CookieMonster task
runner and guaranteeing the cookie is committed before any subsequent
GetAllCookies query.
The BrowserContextDestructionVsCookieRemoval test has a separate issue:
BlockUntilCompletion() never returns after the incognito profile is
destroyed during data removal. CookieIncognitoDeletion also hangs in
incognito mode. Both remain disabled in the filter file.
Resolvesbrave/brave-browser#54537
Resolvesbrave/brave-browser#52296
Implements Brave's customized version of Chromium's v2 clear browsing
data dialog with the following enhancements:
* Add two-tab layout ("Clear data" and "On exit") for better UX
* Customize time picker with Leo design tokens and chip styling
* Add cr-chip customization via chromium_src override
* Remove feature flag to enable v2 dialog by default
* Some patch is added to reuse upstream's method by exporting
We don't want to take on the Delete Browser Data dialog redesign at the moment,
per product. When disabling this feature, I fixed up the alphabetical ordering
of the include_rules in the BUILD.gn file.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/fd52f33cff1c7c1d24b2c6851f881cf415b7c61f
commit fd52f33cff1c7c1d24b2c6851f881cf415b7c61f
Author: Mohamad Arab <arabm@google.com>
Date: Thu Oct 30 07:43:24 2025 -0700
DBDRevamp: Enable `kDbdRevampDesktop` by default.
This change enables the revamped browsing data deletion UI on desktop platforms by default.
launch/4402795
Change-Id: I73964f2882762b122bb9af0ea69f2969cba7babe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7100958
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Mohamad Arab <arabm@google.com>
Cr-Commit-Position: refs/heads/main@{#1537916}
* Add AI Chat build flag to components/ai_chat
* Add AI Chat build flag to browser/ui
* Add AI Chat build flag to browser/resources
* Add AI Chat build flag to chromium overrides
* Add AI Chat build flag to other components
* Add AI Chat build flag to core browser files
* Add AI Chat build flag to app and renderer
* Add AI Chat build flag to remaining files
* Set enable_ai_chat to !is_brave_origin_branded
* Review comments
Including gn_check errors in chromium_src
* Exclude ai_chat Jest tests when not enabled
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).
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/30974a8a2b9b0ecdea5c944ae4c85053e5d6cbcd
commit 30974a8a2b9b0ecdea5c944ae4c85053e5d6cbcd
Author: Zaina Al-Mashni <zalmashni@google.com>
Date: Tue May 6 11:21:04 2025 -0700
[Settings] Convert the DataType checkboxes to an expandable list in DBD
This change does the following:
- Converts the checkboxes in the DBD settings page from a static list
to an expandable one.
- Default (History, cache and site data) and selected datatypes are
always visible in the expandedOptions list.
- Others datatypes are hidden until the user clicks on show more in the moreOptions list.
- The two lists do not change after the page is created and maintain the same order.
Demo (WAI - checkboxes unchanged):
NO_IFTTT=This is the initial addition for the LINT.IfChange/ThenChange.
Demo: https://drive.google.com/file/d/19A2L4DO3EXRYBx24WOBVdwnSPQySRbUR/
https: //drive.google.com/file/d/1eKPy9agH47D4Yxrv6BgBQuzRoA9VtY0s/
Bug: 397187800
Change-Id: Ib8ae012d4c536ec004d535ffb3217797462850f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6490751
Reviewed-by: Rainhard Findling <rainhard@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Zaina Al-Mashni <zalmashni@google.com>
Reviewed-by: John Lee <johntlee@chromium.org>
Auto-Submit: Zaina Al-Mashni <zalmashni@google.com>
Commit-Queue: John Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1456473}
The cookies tree model is being deprecated but we still rely on this feature to
show site-specific cookie data, so keep this feature flag enabled.
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/94db528d01463917123009ea2a2ed8110a38121f
commit 94db528d01463917123009ea2a2ed8110a38121f
Author: Mariam Ali <alimariam@google.com>
Date: Fri Feb 9 13:59:50 2024 +0000
[Deprecate CookiesTreeModel] Enable feature by default
Bug: b:40205603, b:277057109
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
These change are being done to make use of `absl::StrFormat` in the
future, and also to get some better codegen with these constants.
There's also some harderning on upstream code to avoid unnecessary
conversions involving constants, which can only be enforced in a
`constexpr` constext.
Refactor ai_chat_tab_helper to platform generic, so that iOS can use the same core code for its APIs.
With this change, iOS is able to supply a web-page, URL, and all of the things Desktop does.
Fix layering violation.
Fix iOS not compiling due to unit tests that include "content".
Renamed from AIChatDriver to ConversationDriver
Upstream is set to deprecated, and delete all occurrences of
`base::StringPiece`, and replace it with `std::string_view`, and
according correspondent types.
This change removes the use of `base::StringPiece`, and of the headers
as well across the Brave codebase.
* 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.
So far, shields settings are also cleard with "All time" time range.
With "All time" range option, browser nuke whole plugins type data.
With non "All time" range option, browser only clears plugins type for
empty resource ids which is flash type.
This commit makes browser clear shields data also with non "All time" range.
Fixesbrave/brave-browser#492
1. Adds a new "On exit" tab to chrome://settings/clearBrowserData dialog
with the same options as on the "Advanced" tab and a "Save" button. By
default all "On exit" options are turned off. When an option is modified
from the current state the Save button becomes enabled and allows the
user to save the "on exit" options. The options are saved to profile's
preferences: new *OnExit preferences have been added for each option.
2. Clear browsing data on exit functionality is triggered from
BraveBrowserMainParts::PreShutdown override. For each loaded profile
the code checks if user selected any on exit options and if so then a
BrowsingDataRemover is called.
3. Adds BraveClearDataOnExitTest and BraveClearDataOnExitTwoBrowsersTest
browser tests that verify that:
- the removal of the browsing data is triggered only when an "on exit"
preference is set;
- the removal flags are constrcuted correctly;
- the removal is called only when the browser is exiting (tests with
OTR/Guest/multiple profiles).