Commit Graph
95 Commits
Author SHA1 Message Date
Pavel Beloborodov 2a65407a03 Fixed crash. (#28003) 2025-03-07 12:26:40 +07:00
Pavel Beloborodov 32c4ca7523 Do not removed shields settings with empty primary pattern. (#27819) 2025-02-28 17:33:22 +07:00
AlexeyBarabash a0e1f1ef17 [cr134] [Android] ClearBrowsingDataFragmentAdvanced was removed
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
2025-02-18 12:46:55 +00:00
Claudio DeSouza 878c9b1ce0 [cr134] GaiaId a strong type
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
2025-02-18 12:46:52 +00:00
Brian Johnson afd4e0239d fix overly permissive DEPS (#27193)
Fix overly permissive deps
2025-01-12 21:43:04 -07:00
Serg 9f3121e4b2 Adds preferences and methods to delete Leo conversations on Android (#27074)
* Adds preferences and methods to delete Leo conversations on Android

* Adds time period for Leo conversation delete functionality on Android
2024-12-20 18:52:16 -05:00
Aleksei Khoroshilov d8a85158df Add per-site farbling token support (#25674)
* 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).
2024-11-20 18:22:05 +07:00
cdesouza-chromium 0c6e03012a [CodeHealth] Mark global constants as constexpr (#26588)
This PR tags various global constants as `constexpr`. This is a better
approach to constant values, as it can result in better codegen overall.
2024-11-18 12:41:05 +00:00
Pete MillerandTaher 9110a55b1b AIChat conversation data storage (#25876)
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>
2024-11-15 13:46:05 -08:00
Jocelyn Liu 6914188ad5 Remove NOTREACHED_IN_MIGRATION usage in decentralized_dns
And some random places in the code base.
2024-11-11 22:00:02 -08:00
Jocelyn Liu efcb1df7c6 Remove enable_ai_chat buildflag 2024-10-31 20:15:18 -07:00
cdesouza-chromium 1a3eb65e92 [DanglingPtr][linux] Dangling violations as untriaged (#26244)
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
2024-10-28 16:02:49 +00:00
cdesouza-chromium 5b23c55b1f [ubsan] Fix BraveNewsController* null deref (#25940)
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
2024-10-11 03:18:43 +01:00
AlexeyBarabash 06300c37cf Fixed erasing Sync Client ID when cleaning cookies. (#25147)
* Fixed erasing `Sync Client ID` when cleaning cookies.

Fixes brave/brave-browser#40130
2024-08-24 14:10:51 +03:00
Jay Harris 7a7da2bb04 [Brave News]: Cleanup BraveNewsControllerFactory (#24718) 2024-07-18 04:19:18 +02: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 23f55ef509 Add needed //chrome/browser/search_engines dep 2024-06-25 13:13:14 +01: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
Claudio DeSouza 42ada08142 QuitCurrentWhenIdleClosureDeprecated deleted upstream
These functions have been deleted upstream in favour of using `RunLoop`
closures.

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

commit cf64328f5a321cdf68eed8bac9d4bd13f57ce581
Author: Helmut Januschka <helmut@januschka.com>
Date:   Thu Jan 25 12:46:33 2024 +0000

    runloop: finalize refactor of Quit*Deprecated() RunLoop usage

    Bug: 922118
2024-03-08 09:17:45 -03:00
Jacob Sikorski ab332ff65c Cleanup brave_shields component 2024-02-12 15:47:01 -07:00
Anthony Tseng 7743aa0bfd Replace ai_chat::features::IsAIChatEnabled() with ai_chat::IsAIChatEnabled(...)
which checks both group policy and feature flag
2024-02-07 10:36:06 -08: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
Brandon-T 06bc0b8974 Fix #33451: Refactor ai_chat component for iOS (#20425)
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
2023-11-08 13:02:32 -05:00
vadimsandJay Harris 3cccec9142 implemented history clearing handler + reset leo confirmation (#20179)
* implemented history clearing handler + reset leo confirmation

---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
Co-authored-by: Jay Harris <jay.harris@outlook.co.nz>
2023-09-21 23:57:19 +02:00
Claudio DeSouza 5664b43657 GetSettingsForOneType returning results
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.
2023-09-06 12:38:42 +01:00
Claudio DeSouza a1da2392e9 RuleMetaData changed into a class
`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
2023-07-26 16:50:34 -04:00
Claudio DeSouza e449d80da9 IWYU fixes for gtest_prod_util.h inclusion
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.
2023-06-19 16:00:10 -04:00
Jay Harris 9662cb1fee Remove the kBraveNewsFeature Flag (#18606) 2023-06-12 09:37:24 +12:00
Claudio DeSouza 1277a6d179 kAllowDeletingBrowserHistory moved upstream
Chromium change:
https://chromium.googlesource.com/chromium/src/+/8fd9f689c764e8bb6a95045b7b5148ace9f8bfde

commit 8fd9f689c764e8bb6a95045b7b5148ace9f8bfde
Author: Duong Dac <ddac@chromium.org>
Date:   Thu Mar 23 15:06:44 2023 +0000

    Move prefs::kAllowDeletingBrowserHistory to components/history

    Step to decouple chrome/common from SupervisedUserPrefStore.

    Bug: b/273894068
2023-04-20 23:56:52 -04:00
Claudio DeSouza 1bfee0b41c LSO preferece key removed
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.
2023-03-17 18:51:29 -04:00
Jay Harris 492eb68e49 Rename Brave Today to Brave News (#17265) 2023-02-24 13:22:47 +13:00
Emerick Rogul 7d7bca1cef bind.h, callback{,_forward,_helpers}.h now located in //base/functionality
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
2023-02-22 06:29:17 -05:00
cdesouza-chromium 932606f421 Task posting v3 handle refactor (#16857)
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
2023-01-27 09:49:00 +00:00
Emerick Rogul 972dbe8c02 Access last modified time via metadata field
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
2022-10-13 16:20:08 -04:00
Claudio DeSouza d83f6e851c [CodeHealth] Applying various clang-tidy modernisers
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.
2022-09-02 19:03:49 +01:00
Claudio DeSouza b08b0ba00a [CodeHealth] Clang tidy browser with use-equals-default II
This change corrects the constructors of several classes under
browser/, using clang-tidy's modernize-use-equals-default.
2022-08-16 14:04:01 +01:00
Claudio DeSouza 3289c99f62 BrowsingDataRemover::DataType updated to uint64_t
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
2022-06-10 05:58:20 -04:00
Claudio DeSouza 8b4281abb3 base/task/post_task.h removed
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
2022-06-10 05:58:20 -04:00
bridiver f11ff89656 fix comments 2022-05-31 16:58:20 -07:00
bridiver ea7cd37cbf fix incorrect and missing defaults for content settings 2022-05-31 16:58:20 -07:00
Mario Sanchez Prada 7d7f5e7554 Added missing includes for build/build_config.h 2022-03-22 10:57:30 +01:00
Mario Sanchez Prada f4c7bdda37 Migrate define(OS_*) to using BUILDFLAG(IS_*) instead
See the following PSA in the chromium-dev mailing list for more
information and links to the original discussion, the design
document and the metabug:

https://groups.google.com/a/chromium.org/g/chromium-dev/c/EIuQCy9sVfw/m/Net3FPz6AwAJ

Resolves https://github.com/brave/brave-browser/issues/21608
2022-03-22 10:57:30 +01:00
Emerick Rogul f8630ee799 Remove ALLOW_UNUSED macros
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/44d8af458bb86ca8477493cef5bc9d1ed12a8f40

commit 44d8af458bb86ca8477493cef5bc9d1ed12a8f40
Author: Avi Drissman <avi@chromium.org>
Date:   Tue Jan 25 19:08:20 2022 +0000

    Remove ALLOW_UNUSED macros

    This removes ALLOW_UNUSED_LOCAL, ALLOW_UNUSED_TYPE, and
    ANALYZER_ALLOW_UNUSED.

    Bug: 1286390
2022-03-18 20:03:49 -04:00
Mario Sanchez Prada a5eabffa63 Adapt to new signature of profiles::SwitchToGuestProfile()
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/+/93321f38687b9c80bb6109eef7acecc1d29662be
https://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.
2022-02-17 14:02:53 -05:00
Mario Sanchez Prada 2915bce98e Adapt to new signature of ContentSettingsPrefProvider::SetWebsiteSetting()
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/ca8250e176e4b7ff384da0e00106c6ad3578b999

commit ca8250e176e4b7ff384da0e00106c6ad3578b999
Author: Christian Dullweber <dullweber@chromium.org>
Date:   Fri Jan 7 12:22:15 2022 +0000

    CodeHealth: Convert content_settings_provider to new base::Value API

    Bug: 1281896
2022-02-17 14:02:39 -05:00
Aleksey Khoroshilov 327864d078 Fix brave/content_settings/core issues. 2022-01-25 16:08:51 +07:00
Mario Sanchez Prada 43bee1b088 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
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
2022-01-24 15:38:28 -05:00
Mario Sanchez Prada 06f884ff74 Remove includes to base/macros.h using base/ignore_result.h when needed
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/+/2e6be1400ab678f21d871d0d3a1199912967324f
https://chromium.googlesource.com/chromium/src.git/+/5666ff4f5077a7e2f72902f3a95f5d553ea0d88d
https://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
2022-01-24 15:33:44 -05:00
Mario Sanchez Prada bbf5fd3fe9 Remove deprecated DISALLOW_ macros from Brave-specific code
Macros such as DISALLOW_COPY_AND_ASSIGN() are deprecated since r711900
per style arbitration [1]. This commit replaces the macros with deleted
constructors and methods, which is preferred by the Google C++ Style
Guide [2][3].

Also remove unneeded "base/macros.h" #includes when possible.

This CL is created semi-mechanically with remove_disallow and
remove_base_macros [4].

[1]: https://groups.google.com/a/chromium.org/g/cxx/c/qwH2hxaEjac/m/TUKq6eqfCwAJ
[2]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
[3]: https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types
[4]: https://pkg.go.dev/go.timothygu.me/tools/cr/cmd

Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/d002a3bee7ae75780b604d17df19291a3dd303fb

commit d002a3bee7ae75780b604d17df19291a3dd303fb
Author: Peter Boström <pbos@chromium.org>
Date:   Fri Nov 5 17:17:19 2021 +0000

    Remove DISALLOW_ macros from base/macros.h

    This removes DISALLOW_COPY(), DISALLOW_ASSIGN() and
    DISALLOW_COPY_AND_ASSIGN() from base/macros.h. PRESUBMITs are also
    updated to no longer check for these macros.

    IWYU removal is left as a separate change just in case this needs to be
    reverted.

    Bug: 1010217
2022-01-24 15:33:37 -05:00
mkarolin 50f7d5587b Task-related files moved from base/ to base/task/
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
2021-12-07 14:45:00 -05:00