Commit Graph
40 Commits
Author SHA1 Message Date
Claudio DeSouza b971578422 //components/sync/driver renamed to :service
Chromium change:
https://chromium.googlesource.com/chromium/src/+/91c345cf4eac0adbb428db6449384028dfac7bd3

commit 91c345cf4eac0adbb428db6449384028dfac7bd3
Author: Mikel Astiz <mastiz@chromium.org>
Date:   Tue May 16 14:18:56 2023 +0000

    [sync] Rename components/sync/driver to components/sync/service

    It was agreed within the Sync team that the name 'driver' conveys
    little and is a historic artifact. The new name, 'service', reflects
    what most dependent targets care about: SyncService and adjacent APIs.

    Semi-automated patch generated via:
    git mv components/sync/driver components/sync/service
    ./tools/git/mass-rename.py
    cat /tmp/affected-files.txt | \
      xargs sed -i 's/#include/#import/g'
    git grep -l 'sync/driver' |\
      xargs sed -i 's/components\/sync\/driver/components\/sync\/service/g'
    git grep -l 'sync_driver_sync_internals' |\
      xargs sed -i 's/sync_driver_sync_internals/sync_service_sync_internals/g'
    git grep -l 'components/sync/service:driver' |\
      xargs sed -i 's/sync\/service:driver/sync\/service/g'
    git grep -l 'kSyncDriverSyncInternalsResources' |\
      xargs sed -i\
      's/kSyncDriverSyncInternalsResources/kSyncServiceSyncInternalsResources/g'
    git grep -l 'IDR_SYNC_DRIVER_SYNC' | \
      xargs sed -i 's/IDR_SYNC_DRIVER_SYNC/IDR_SYNC_SERVICE_SYNC/g'
    sed -i 's/driver/service/g' components/sync/service/BUILD.gn\
      components/sync/service/sync_api_component_factory.h
    sed -i 's/_H__/_H_/g' components/sync/service/*.h
    git cl format

    Manual changes include:
    1. Build target rename in components/sync/driver/BUILD.gn.
    2. Header guard issues surfaced by presubmit.
    3. Several header files reintroduced to avoid breaking downstream.

    Disable-Rts: True
    Change-Id: If23629e79e781e55c3d783e3074fb536311928d6
    Bug: 1444709
2023-06-19 16:00:13 -04:00
cdesouza-chromium b94efd40d1 Use base::NoDestructor rather than Singleton (#18846)
This change replaces all uses of `base::Singleton` across the codebase,
in favor of `base::NoDestructor`. This is following the a direction
taken upstream, in getting `base::Singleton` deleted.

LSC doc:
https://docs.google.com/document/d/1x1LqRQyfBOmpMkNQBYs7QBPSxLtuiImvmgcJYI_kaS4/edit?usp=sharing
2023-06-13 03:00:07 +01:00
Claudio DeSouza 631729b452 Using raw_ptr<T> for member fields
Most cases relating to `raw_ptr` fixes have already been merged to
master. This change has straggler cases in it.
2023-05-15 13:10:38 +01: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
AlexeyBarabash 5b0858751b Fix presubmit errors and warnings 2022-12-20 15:09:03 +02:00
AlexeyBarabash 3ecb801405 Give error when trying connect the deleted sync chain on Android 2022-12-20 15:09:02 +02:00
AlexeyBarabash cf4814b9a8 Give error when trying connect the deleted sync chain on desktop 2022-12-20 15:09:02 +02:00
AlexeyBarabash baf5b05ee5 Don't show account deleted informer for Brave Sync setup page 2022-12-20 15:09:02 +02:00
AlexeyBarabash ae3a699f98 Android informer for deleted sync account 2022-12-20 15:09:02 +02:00
AlexeyBarabash 93e3cbff5e BraveSyncAccountDisabledInfoBar and BraveSyncAlertsService classes 2022-12-20 15:09:02 +02:00
Artem Samoilenko 1d6c0fac29 [Android] Changes for BraveSyncDevicesAndroid d-tor
Chromium change:
https://chromium.googlesource.com/chromium/src/+/0cc14ba767331dd13bda825c5451a826e10d73a7

commit 0cc14ba767331dd13bda825c5451a826e10d73a7
Author: Jun Zou <junzou@chromium.org>
Date:   Mon Nov 7 23:51:13 2022 +0000

    Reland: Add sync device info observer for segmentation. Record uma metrics of device count by os types.

    Update segmentation service factory for iOS.

    - Derives OS types from DeviceInfo data from Sync.
    - Adds a segmentation observer to device info tracker.
    - Counts devices by OS types.
    - Records UMA metrics for device count by OS types.
    - Adds a Finch flag for active days threshold.

    Previously reverted change: https://chromium-review.googlesource.com/c/chromium/src/+/3965194

    Bug: b/254338267
2022-12-15 14:18:49 -05:00
samartnik 30830eabc6 [Android] DeviceInfo::ToValue removed upstream
Chromium change:
https://chromium.googlesource.com/chromium/src/+/c50274ffd343122ca33008eba7c8f057bd70d6fc

commit c50274ffd343122ca33008eba7c8f057bd70d6fc
Author: Maksim Moskvitin <mmoskvitin@google.com>
Date:   Wed Aug 24 13:42:41 2022 +0000

    [Cleanup] Remove dead code from DeviceInfo

    DeviceInfo::ToValue() claimed to be used by extensions API, but has no
    actual references. This CL removes it and helper methods used only for
    its implementation.

    Bug: none
2022-10-13 16:20:03 -04:00
Claudio DeSouza 19f81ba383 Sync test code moved to components/sync/test/
Chromium change:
https://chromium.googlesource.com/chromium/src/+/e50090022955b19092d8f7f63d0bf71a8f064428

commit e50090022955b19092d8f7f63d0bf71a8f064428
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date:   Wed Aug 31 13:36:39 2022 +0000

    [sync] Move remaining test code to components/sync/test/

    Exact same considerations as in crrev.com/c/3822919. We leave a
    components/sync/driver/mock_sync_service.h around including the new
    components/sync/test/mock_sync_service.h because downstream code is
    including the former. After migrating downstream, the old header
    can be removed.

    Bug: 948661
2022-10-13 16:20:02 -04:00
AlexeyBarabash 89303faf6d Revert "Merge pull request #14402 from brave/sync_dse_android"
This reverts commit 826c6f8b0d, reversing
changes made to 68ea3e2e85.
2022-09-06 20:02:33 +03:00
Claudio DeSouza f11d31bf93 [CodeHealth] Various brave/browser base::Value modernisations
This change corrects a few scattered places where base::Value
modernisations are being applied, removing the use of all deprecated
methods.
2022-08-31 15:09:21 +01:00
Claudio DeSouza 2987acef1e [CodeHealth] Clang tidy browser with use-equals-default V
This change corrects the constructors of several classes under
browser/, using clang-tidy's modernize-use-equals-default. Additionally,
this commit includes a few additional straggler files.
2022-08-17 15:48:08 +01:00
Claudio DeSouza 232c23bea8 [CodeHealth] clang-tidy modernise to use nullptr
This change applies clang-tidy's modernize-use-nullptr across the repo,
following the upstream chromium model.
2022-08-15 17:05:42 +01:00
AlexeyBarabash d3f8d59522 Test for support DSE sync on Android 2022-08-12 15:35:32 +03: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
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 960e7d6c06 Adapt to using the new form of base::DoNothing()
No need to use the templated syntax anymore.

Chromium change:

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

commit e0fc463ca6d8dedd64bb520779aa367c0831581b
Author: Daniel Cheng <dcheng@chromium.org>
Date:   Fri Oct 1 00:37:41 2021 +0000

    Update base::DoNothing() / base::NullCallback() to use a type tag.

    This allows both helpers to be used in contexts where the original
    helper required templated arguments to be explicitly specified,
    generally leading to more concise code.

    However, since base::DoNothing() only returns a type tag now, it can no
    longer be used as a functor with base::BindOnce/base::BindRepeating.
    In general, this seems to be a net neutral to slight positive change:
    the lambda version is actually shorter—though some might argue less
    readable—and it generates more efficient code since running the callback
    now jumps through one less thunk.

    Bug: 1252980
2021-11-02 12:38:04 -04:00
AlexeyBarabash fd59f40899 P3A metric Brave.Sync.Status.2
fixes brave/brave-browser#17862
2021-09-20 19:44:34 +03:00
mkarolin 8ac1f664cf Adapt to relocation of components/sync/driver/profile_sync_service.* II.
Followup to a prior commit that follows upstream and renames
ProfileSyncService to SyncServiceImpl in various class names.
2021-08-18 11:00:03 -04:00
samartnik fafc54defd [Android] SyncService related changes
Chromium change:
https://chromium.googlesource.com/chromium/src/+/21667acc2a3c5fe6738899fb494248c583bcc230

Rename ProfileSyncService to SyncServiceImpl in Android code

No behavior is changed. Do the following renamings:
- ProfileSyncService.java -> SyncServiceImpl.java
- profile_sync_service_android.h -> sync_service_android_bridge.h
- FakeProfileSyncService.java -> FakeSyncServiceImpl.java (and
  corresponding *WithFakeProfileSyncService test files)

Moreover
- Update the documentation of *sync_service_android_bridge.h

Bug: 1201272
2021-08-18 10:53:08 -04:00
samartnik 29d4b656a9 [Android] Changes for ProfileSyncServiceAndroid
Chromium change:
https://chromium.googlesource.com/chromium/src/+/d8ef96e6b8d1de5c4441c8b7df1dab8ef9142290

Remove ProfileSyncServiceAndroid::Init()

This method is basically a way to check whether the native
ProfileSyncService is null. If so, JNI_ProfileSyncService_Init()
destroys ProfileSyncServiceAndroid immediately.

Instead, let's check first and then construct the object if PSS is
non-null. ProfileSyncServiceAndroid now only has 2 deps (the native and
java services), both set on construction.

The CL also does some minor readability improvements to
profile_sync_service_android.cc.

Bug: None
2021-08-18 10:43:10 -04:00
Mario Sanchez Prada ad63971f19 Adapt to relocation of components/sync/driver/profile_sync_service.*
They are in components/sync/driver/sync_service_impl.{cc,h} now.

Chromium change:

https://chromium.googlesource.com/chromium/src/+/b77854267a62e9208b1ac5ceb4167387ec7c56cc

commit b77854267a62e9208b1ac5ceb4167387ec7c56cc
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date:   Fri Jun 4 09:15:21 2021 +0000

    Reland "Rename ProfileSyncService to SyncServiceImpl"

    Reason for reland: Original CL was reverted to unwind other changes.

    Original change's description:
    > Rename ProfileSyncService to SyncServiceImpl
    >
    > Renaming related classes like ProfileSyncServiceAndroid and
    > ProfileSyncServiceHarness is left for next CLs. We also use this CL as
    > an opportunity to hide the implementation class when possible:
    > - Some includes for sync_service_impl.h are removed if unnecessary, or
    > replaced with sync_service.h.
    > - Even comments referring to SyncServiceImpl are updated to refer to
    > the interface if the layer isn't aware SyncServiceImpl is being used.
    >
    > The CL also adds one missing include for <string> in
    > fake_server_helper_android.cc to address one IWYU presubmit warning.

    Bug: 1201272
2021-08-18 10:43:05 -04:00
Mario Sanchez Prada 600b872461 Adapt patch for chrome/browser/sync/profile_sync_service_factory.cc
It's chrome/browser/sync/sync_service_factory.cc now.

Chromium change:

https://chromium.googlesource.com/chromium/src/+/ff4e5f6e2d335450d95d29be8496d2f65471a3d2

commit ff4e5f6e2d335450d95d29be8496d2f65471a3d2
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date:   Tue Jun 1 20:12:14 2021 +0000

    Rename chrome/'s ProfileSyncServiceFactory to SyncServiceFactory

    The goal of this factory is to return a SyncService. This follows
    the naming convention of other keyed services that have an abstract
    interface.

    Bug: 1201272
2021-08-18 10:39:55 -04:00
Anthony Tseng 618ac477ab Move brave_sync_devices_android.* to brave_chrome_browser_sources 2021-08-17 16:14:31 -07:00
Mario Sanchez Prada 46ba4a605f Adapt to deprecation of base::ScopedObserver
base::ScopedObserver is being deprecated on Chromium 93, so we need
to migrate to either ScopedObservation or ScopedMultiSourceObservation
depending on whether one or multiple sources are being observed.

Chromium change:

https://chromium.googlesource.com/chromium/src/+/3a35c513e236f28ba817b6667c9c973163241ebd

commit 3a35c513e236f28ba817b6667c9c973163241ebd
Author: Sigurdur Asgeirsson <siggi@chromium.org>
Date:   Thu Jun 3 16:34:54 2021 +0000

    Remove redundant base/scoped_observer.h includes.

    ScopedObserver is being deprecated in favor of two new classes:
    - base::ScopedObservation for observers that only ever observe
      a single source.
    - base::ScopedMultiSourceObservation for observers that do or may
      observe more than a single source.

    Bug: 1145565

Resolves https://github.com/brave/brave-browser/issues/16371
2021-06-14 11:40:40 +02:00
wchen342 0724ac82dc Fix deprecated jni calls 2021-03-12 13:58:52 +02:00
bridiver 09e3f08ba8 remove includes that no longer apply 2021-02-04 23:54:26 -05:00
bridiver 33184ea4d8 ```
Component //brave/*
ERROR at //brave/browser/sync/brave_profile_sync_service_delegate.cc:13:11: Include not allowed.
          ^-----------------------------------------------------
It is not in any dependency of
  //brave/browser/sync:sync
The include file is in the target(s):
  //chrome/browser:browser
which should somehow be reachable.
___________________
ERROR at //brave/browser/sync/brave_profile_sync_service_delegate.cc:14:11: Include not allowed.
          ^-------------------------------------------------
It is not in any dependency of
  //brave/browser/sync:sync
The include file is in the target(s):
  //chrome/browser:browser
which should somehow be reachable.
```
inherited from existing file in a target that already had check_includes = false
fix https://github.com/brave/brave-browser/issues/12976
2020-12-01 15:52:35 -07:00
bridiver 7224cd640c make BraveProfileSyncServiceDelegate compatible with ios 2020-11-30 07:34:51 -05:00
AlexeyBarabash a3273cd075 Fixing deps violation causing linker error on Android x86 2020-11-02 22:01:30 +02:00
AlexeyBarabash 826ba06cbc Use is_self_delete_supported field 2020-10-29 10:35:40 +02:00
AlexeyBarabash 22a55c55f3 Removed delete device complete callback usage, it was empty in anyway 2020-10-29 10:30:16 +02:00
AlexeyBarabash 37a87c827f Allow delete other device only if remote device support that (Desktop)
Allow delete other device only if remote device support that (Android)
2020-10-29 10:30:15 +02:00
AlexeyBarabash 7efc2acee8 Android browser can delete other devices in chain 2020-10-29 10:30:15 +02:00
AlexeyBarabash ef4e4a8c4a Classes for work with sync devices 2020-06-29 17:12:57 +03:00