Chromium now doesn't contain `Basic`/`Advanced`.
Class ClearBrowsingDataFragment now represents what used to be ClearBrowsingDataFragmentAdvanced.
Related Chromium change:
https://source.chromium.org/chromium/chromium/src/+/a49153686134a72ff189024392df6aad09e71fb0
[Quick Delete] Clean up kQuickDeleteAndroidFollowup flag
Clean up Quick Delete phase 2 feature checks now that the experiment is
fully launched. This includes removing the obsolete tabbed layout and
basic tab from CBD on Android.
OBSOLETE_HISTOGRAM[History.ClearBrowsingData.UserDeletedFromTab]=No longer logged
Bug: 40255099
Change-Id: I340afa9692f17ad3b472f501522a9e6ff8fb061c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6162502
This used to be passed as a raw string, however it is now wrapped as a
strong typedef.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/5658a5f971a9ab44d4412a11d8c950a111356e57
commit 5658a5f971a9ab44d4412a11d8c950a111356e57
Author: Mikel Astiz <mastiz@chromium.org>
Date: Fri Nov 29 16:25:24 2024 +0000
[signin] Adopt class GaiaId components/signin and related files
SigninPrefs is excuded to reduce the delta, but otherwise most of
the signin-related code is migrated to adopt class GaiaId instead of
passing around std::string values to represent obfuscated gaia IDs.
The class temporarily supports implicit conversion to and from
std::string, which allows splitting this particular patch without
tackling the entire chromium codebase.
Change-Id: I5f8413f3ce6cc5f52e728ebd805118f79326b68b
Bug: 380416867
* Persist farbling token per schemeful site.
* Add tests for persistent farbling token.
* Handle shields metadata cleanup on site data remove.
* Update existing tests to work with the new farbling random.
* Disable farbling in some sensitive Chromium tests.
* Simplify GetShieldsMetadata.
* Use ASSERT instead of CHECK in tests.
* Alias objects memory in dumps to see the actual types.
* Few improvements to harden the object alias helper.
* Remove StackObjectCopy from this PR (better to land it separately).
Persist all conversation and conversation entry data
- Adds AIChatDatabase class which deals with persisting and retrieving conversation and conversation entry items with SQLite.
- Modified AIChatService to manage data going in and out of the database
- Adds relevant uuid fields and modifies relevant constructors and unit tests do deal with them
- Adds preference for storage. Disabling the preference deletes all the data. Enabled by default.
- When browsing history is deleted, relevant page data (title, url, content) is removed from the database
- When "Leo AI" data is deleted, all conversations for the relevant time period are deleted.
- Delete all AI Chat history button from settings page deletes whole database
---------
Co-authored-by: Taher <8665427+nullhook@users.noreply.github.com>
This PR marks all the dangling pointers causing test crahses on linux as
`DanglingUntriaged`. This is the first step to gradually permit us to
switch on the our dangling pointer check in our CI. This change does not
include upstream patches, that may be required depending on how
difficult it becomes to fix those.
Resolves https://github.com/brave/brave-browser/issues/41896
We have been retrieving this pointer through its factory in
`BraveBrowsingDataRemoverDelegate::RemoveEmbedderData`, however we have
not been checking for its validity, when it looks like we should like
the upstream version
Resolve https://github.com/brave/brave-browser/issues/41566
`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
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
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
This function used to use an out param to communicate its result.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/86d098d0210c5fad5e10ae8eab563fd49b349354
commit 86d098d0210c5fad5e10ae8eab563fd49b349354
Author: Chris Fredrickson <cfredric@chromium.org>
Date: Tue Jun 27 15:52:05 2023 +0000
Reland "Refactor GetSettingsForOneType API to avoid out-param"
This is a reland of commit fe104a2598dbe5b3b276b65883a6141f3cc414ab
Patchset 2 has the difference between this CL and the original (fixes
a build failure with another CL that crossed mid-submit).
Original change's description:
> Refactor GetSettingsForOneType API to avoid out-param
>
> The style guide says to prefer returning by value, since it is clearer
> and often performs the same or better than an out-param.
>
> Out-params can be useful to allow reusing a single allocation, but
> none of the callers of GetSettingsForOneType took advantage of that,
> so there is no reason to prefer the out-param.
`RuleMetaData` used to be a struct, which could be instantiated in
place, but it is now a class with private members. This change
instantiates the instances separately now, rather than in the function
calls these instances were being passed to.
Chromium changes:
https://chromium.googlesource.com/chromium/src/+/6d7b2071215ecab988dadb734e1ea78b8e9b263b
commit 6d7b2071215ecab988dadb734e1ea78b8e9b263b
Author: Chris Fredrickson <cfredric@chromium.org>
Date: Thu Jun 15 15:44:56 2023 +0000
Convert RuleMetaData from a struct to a class
Converting to a class and hiding data members by default gives better
encapsulation, and allows the introduction of invariants on or
between members.
Providing a setter that accepts a ContentSettingConstraints
guides callers toward doing the "right thing" by default. For callers
that don't have a ContentSettingConstraints instance, individual setters
are provided.
Bug: 1450356
This header was not being included in every place where the macros for
for the friending of test fixture were occurring. This didn't use to be
a problem because base/memory/ref_counted.h used to include this header,
so it would normally be pulled in transiently.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/4b5e28be48f7b6d85f6b05d7e53bcd5591ac7665
commit 4b5e28be48f7b6d85f6b05d7e53bcd5591ac7665
Author: Daniel Cheng <dcheng@chromium.org>
Date: Thu May 11 22:25:22 2023 +0000
Remove gtest_prod_util.h from //base/memory/ref_counted.h.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/5e1ffd63a88e3321ac4c56b5fb38a388f781947d
commit 5e1ffd63a88e3321ac4c56b5fb38a388f781947d
Author: Lei Zhang <thestig@chromium.org>
Date: Thu Feb 23 17:52:44 2023 +0000
Remove unused Flash prefs
The browser.clear_lso_data_enabled pref became effectively useless as of
https://crrev.com/671914, and the same CL stopped using
browser.pepper_flash_settings_enabled. Delete references to these 2
prefs from production code and clear them in
MigrateObsoleteProfilePrefs(). Also remove the useless
chrome_browsing_data_remover::DATA_TYPE_PLUGIN_DATA type.
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/cd23b8b9d212daf06dde638488dbaa355d6651fa
commit cd23b8b9d212daf06dde638488dbaa355d6651fa
Author: Daniel Cheng <dcheng@chromium.org>
Date: Fri Sep 16 17:16:24 2022 +0000
Move bind.h, callback{,_forward,_helpers}.h into //base/functional
Forwarding headers remain in the old locations to ease migration.
Include paths for files in //base/functional/ are also fixed up to the
new canonical path; remaining fixups are deferred until followups to
minimize the risk of conflicts.
Bug: 1364441
Task posting v3 handle refactor - II
This change is following upstream refactor for task runner provisioning.
This primarily involves changing how we are fetching the default current
sequence/thread runners.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/edb604e09fa4ac6eb56f447b643085afda6150a9
commit edb604e09fa4ac6eb56f447b643085afda6150a9
Author: Sean Maher <spvw@chromium.org>
Date: Thu Jan 12 15:18:20 2023 +0000
task posting v3: Remove task runner handles from codebase entirely
As the last CL of the task runner handle refactor, this CL removes
Single and Thread task runner handles from the codebase entirely. The
new API for this functionality can be found under
(SingleThread|Sequenced)TaskRunner::CurrentDefaultHandle,
::GetCurrentDefault(), ::HasCurrentDefault(), and
::CurrentHandleOverride(ForTesting).
Bug: 1026641
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/a38d738a45b24108df94c2dead0da7633357e4a6
commit a38d738a45b24108df94c2dead0da7633357e4a6
Author: Christian Dullweber <dullweber@chromium.org>
Date: Tue Sep 13 17:21:13 2022 +0000
Safety check: Remove LastModified special handling
Remove LastModified accessors from content_settings code. This field
can now be accessed through the metadata fields in SettingsInfo and
ContentSettingsPatternSource.
Bug: 1345920
This change applies the following modernisers that should be of no
consequence functionally.
google-explicit-constructor
modernize-use-default-member-init
modernize-use-emplace
These modernisers are in line with the style guide.
Chromium change:
https://chromium.googlesource.com/chromium/src/+/1706d8e3c831f5e9e309a02a0b2d602deea53c86
commit 1706d8e3c831f5e9e309a02a0b2d602deea53c86
Author: cammie <cammie@chromium.org>
Date: Mon Apr 25 23:28:59 2022 +0000
Shared Storage: Integrate with BrowsingDataRemover.
We hook up with `BrowsingDataRemoverImpl` so that Shared Storage, as
well as other Privacy Sandbox API persistent storage, will be cleared
when the clear-site-data header is sent for storage.
Also, we must update to using uint64_t instead of int in a couple of
places because we add the 21st value (1 << 20) to
`BrowsingDataRemover::DataType`.
Moreover, we add a new
`BrowsingDataRemover::DataType::DATA_TYPE_PRIVACY_SANDBOX` collection
and hook this up to be cleared by the Clear-Site-Data header so that
origin-associated storage from Privacy Sandbox APIs (including
Shared Storage) will be cleared when "storage" is sent as a value.
Bug: 1218540
Chromium change:
https://chromium.googlesource.com/chromium/src/+/bb4382b7d2f921014b5d06d8887a37536787f5e0
commit bb4382b7d2f921014b5d06d8887a37536787f5e0
Author: Gabriel Charette <gab@chromium.org>
Date: Mon May 2 13:54:40 2022 +0000
[base] Remove base/android dependency on post_task.h
and officially remove post_task.h!
task_runner_android.cc now holds the bulk of the logic to interface
directly with TaskExecutors via TaskTraitsExtensions.
post_task_android.cc just forwards to a BASE TaskRunner.
This is vastly overkill for what this is doing at this point.
Follow-up cleanups will:
- cleanup TaskExtensionsStorage (which is mostly just carrying a
TaskType byte, the extension id being unused at this point)
- cleanup TaskExecutor (don't need to allow multiple registrations)
- and ultimately ideally have an Android equivalent to directly
call content::GetUIThreadTaskRunner() and rid of this indirection
altogether.
Bug: 1026641
It expects a base::OnceCallback<void(Profile*)> now, and does
no longer expect a Profile::CreateStatus now.
Chromium changes:
https://source.chromium.org/chromium/chromium/src/+/93321f38687b9c80bb6109eef7acecc1d29662behttps://source.chromium.org/chromium/chromium/src/+/0812921f476f6cfc97715d27162c1e4f607b5230
commit 93321f38687b9c80bb6109eef7acecc1d29662be
Author: David Roger <droger@chromium.org>
Date: Mon Jan 10 20:23:40 2022 +0000
[profiles] Convert SwitchToProfile to OnceCallback
This CL is a simple cleanup with no behavior changes.
It converts from RepeatingCallback to OnceCallback and removes the
CreateStatus argument which was not useful.
The main changes are in profile_window.[h/cc]
The other files are only updated with the new API.
commit 0812921f476f6cfc97715d27162c1e4f607b5230
Author: David Roger <droger@chromium.org>
Date: Wed Jan 12 16:13:44 2022 +0000
[profiles] Convert LoadProfileAsync to OnceCallback
This CL is a code cleanup with no behavior change.
Follow the lead of upstream and rewrite most raw pointers to using
raw_ptr<T> instead, making also sure that they are initialized.
This rewrite affected all *.h and *.cc files in this repository
except those from the ios/, third_party/ and vendor/ directories,
and it didn't touch any *.mm file either.
Regular expression used for the search & replace process:
Find regexp: "^\s*?(\S*?)\* (\S*?[a-zA-Z0-9]_?);"
Replace with: "raw_ptr<$1> $2 = nullptr;"
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/0e45c020c43b1a9f6d2870ff7f92b30a2f03a458
commit 0e45c020c43b1a9f6d2870ff7f92b30a2f03a458
Author: Keishi Hattori <keishi@chromium.org>
Date: Sat Nov 27 09:25:52 2021 +0000
Rewrite most `Foo* field_` pointer fields to `raw_ptr<Foo> field_`.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA /sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.
This commit was generated automatically, by running the following script: tools/clang/rewrite_ra _ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e5b7e92d13a328362fcb6df15d8847e
For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_pt documentation in //base/memory/raw_ptr.md.
FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.
[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sha ing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ
Bug: 1272324, 1073933
Only a couple of files really need to include this header now to use
ignore_result(), and we can just drop the include from everywhere else.
Chromium changes:
https://chromium.googlesource.com/chromium/src.git/+/2e6be1400ab678f21d871d0d3a1199912967324fhttps://chromium.googlesource.com/chromium/src.git/+/5666ff4f5077a7e2f72902f3a95f5d553ea0d88dhttps://chromium.googlesource.com/chromium/src.git/+/3a3f9436142e712d4a7e2a962d85154876fa395f
commit 2e6be1400ab678f21d871d0d3a1199912967324f
Author: Peter Boström <pbos@chromium.org>
Date: Sat Nov 13 01:28:25 2021 +0000
Rename "base/macros.h" => "base/ignore_result.h"
This file only contains ignore_result() and is no longer a collection of
macros.
This change fixes a couple of missing IWYU removals as well.
Bug: 1010217
commit 5666ff4f5077a7e2f72902f3a95f5d553ea0d88d
Author: Peter Boström <pbos@chromium.org>
Date: Fri Nov 12 03:40:24 2021 +0000
Remove most remaining unused "base/macros.h"
Removes `#include "base/macros.h"` from remaining .cc, .h and .mm files
that do not contain `ignore_result(` and do not trigger pre-commit or
pre-upload errors.
Bug: 1010217
commit 3a3f9436142e712d4a7e2a962d85154876fa395f
Author: Peter Boström <pbos@chromium.org>
Date: Mon Nov 8 21:04:37 2021 +0000
Add #include "base/macros.h" for ignore_result()
This fixes IWYU for existing instances of ignore_result() to make
removal of #include "base/macros.h" from files using it for DISALLOW_*
macros easier.
Bug: 1010217
Chromium change:
https://chromium.googlesource.com/chromium/src/+/39810e70da06baca176c0cdbc93164be1f980f59
commit 39810e70da06baca176c0cdbc93164be1f980f59
Author: Patrick Monette <pmonette@chromium.org>
Date: Thu Oct 14 18:06:59 2021 +0000
Reland "Move task-related files from base/ to base/task/"
This is a reland of 092c30c5fd4def5a0c63d6f3a8953bd07768dd44
The 2 problematic subrepos have been migrated and a couple late
addition of the old headers were migrated.
Original change's description:
> Move task-related files from base/ to base/task/
>
> The forward headers are updated to point to the new location, and the
> header guards were fixed.
>
> Bug: 1255932