Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brave syncer #2010

Merged
merged 73 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
c423779
Make browser_sync::ProfileSyncService a brave_sync::SyncMessageHandler
darkdh Feb 26, 2019
5d9fd40
Fixed build on Linux
AlexeyBarabash Apr 12, 2019
d08cd5e
Upgrade to 74.0.3729.75
darkdh Apr 11, 2019
5371a9b
Pass icon data
AlexeyBarabash Apr 18, 2019
e7155d4
Migrate from legacy sync
darkdh Apr 18, 2019
2b431d6
Introduce IsFirstLoadedFavicon to avoid favicon loading trigged sendi…
darkdh Apr 20, 2019
22e770b
Remove unused code
darkdh Apr 22, 2019
be43397
Fix Reset bug and prevent shutdown sync thread hanging
darkdh Apr 23, 2019
78e0d85
Implement OnSaveBookmarkOrder from #2326
darkdh Apr 25, 2019
372552b
Redefine order calculation to be simply parent_order + index_in_parent
darkdh Apr 26, 2019
8896428
Fix wrong sync code crash
darkdh Apr 30, 2019
8ca0675
Subclass browser_sync::ProfileSyncService
darkdh May 6, 2019
4972a86
Fix DCHECK failure because of lacking permanent nodes order when
darkdh May 7, 2019
6463250
Handle same index from different devices by order
darkdh May 7, 2019
05731ec
Set user-chosen sync type only when first time sync setup or migrated
darkdh May 9, 2019
4f6ed56
Using MigratedBookmarksVersion >= 2 to check legacy sync migration st…
darkdh May 9, 2019
73627bb
Stub out Control Types
darkdh May 10, 2019
2d4662f
Fix index calculation when applying remote records
darkdh May 13, 2019
5d4d8c2
Migrate BraveSyncServiceTest
darkdh May 16, 2019
57cf686
Add test for SyncerHelper
darkdh May 17, 2019
a766cdd
C75.0.3770.38 Upgrade
darkdh May 21, 2019
ed60929
Dont send bookmarks until chain is created. Re-do of brave-core pr#2016
AlexeyBarabash May 20, 2019
6e31e37
Force DEVICE_INFO to have nudge cycles
AlexeyBarabash May 24, 2019
1db950a
Register brave_sync pref with chromium sync
darkdh May 24, 2019
bd689d0
Consolidate BraveSyncServiceTest
darkdh May 24, 2019
c5fbe1f
Remove manually disable field trail feature
darkdh May 28, 2019
5b0f830
lint fix
darkdh May 28, 2019
a524251
Move BraveSyncClient to BraveProfileSyncService
darkdh May 29, 2019
1e55ab6
Android build fix
darkdh May 29, 2019
e2617dc
Replace brave_sync::BraveSyncService::is_enabled() with switches::IsB…
darkdh May 29, 2019
bf1becb
Window release build deps fix
darkdh May 31, 2019
902017f
single dep encapsulation
darkdh Jun 12, 2019
2b2e2e5
IsSyncAllowedByFlag chromium_src override
darkdh Jun 12, 2019
baf9003
remove GetAsBraveProfileSyncServiceForProfile and use ENABLE_BRAVE_SY…
darkdh Jun 12, 2019
5591700
friend BraveProfileSyncService
darkdh Jun 12, 2019
23fdeed
Using SyncEngineHost to avoid storing poll/nudge delegates
darkdh Jun 13, 2019
0ff789f
Move brave_sync::RegisterProfilePrefs to brave::RegisterProfilePrefs
darkdh Jun 13, 2019
d970cad
Chromium override SyncerProtoUtil
darkdh Jun 16, 2019
38b42cf
Update 75.0.3770.90 patch
darkdh Jun 18, 2019
48d6aaf
clean up patches
darkdh Jun 19, 2019
f3f381c
add guards for ENABLE_BRAVE_SYNC
bridiver Jun 19, 2019
f4a013b
Fixed Linux build
AlexeyBarabash Jun 20, 2019
60d93e0
BraveProfileSyncService => BraveProfileSyncServiceImpl; BraveProfileS…
AlexeyBarabash Jun 25, 2019
3fbacc7
Ignore records from ourselves
AlexeyBarabash Jun 25, 2019
2176464
Send records after at least 30 sec after chain creation
AlexeyBarabash Jun 25, 2019
b0c8c49
Fix tests for send records after at least 30 sec after chain creation
AlexeyBarabash Jun 25, 2019
ee2fbf5
Patches for attach/detach behaviour for WriteTransaction
AlexeyBarabash Jun 25, 2019
0aad976
Sort bookmarks in BookmarkChangeProcessor::ApplyChangesFromSyncModel …
AlexeyBarabash Jun 25, 2019
eb2dd0b
Update DEPS to contain "Ignore records from SQS which where seen in S3"
AlexeyBarabash Jun 25, 2019
5eecbd2
Use title or customeTitle, non empty value
AlexeyBarabash Jul 1, 2019
a04cb32
Fix for crash with bookmark position from older sync client (android)
AlexeyBarabash Jul 9, 2019
0f79073
Update 76.0.3809.62 patches
darkdh Jul 15, 2019
1338103
Remove BRAVE_SHOULD_SHOW_SIGNIN_PROMO_SHORT_CIRCUIT_TO_FALSE and lint…
darkdh Jul 16, 2019
7fcee9d
Fix enable_brave_sync=false
darkdh Jul 17, 2019
c3fc745
Check DISABLE_REASON_ENTERPRISE_POLICY in ShouldShowSignInPromo and f…
darkdh Jul 17, 2019
97d0eca
Passive resend unconfirmed records
darkdh Jul 23, 2019
91e5d05
Sync reset reenable (#3038)
darkdh Jul 31, 2019
9677876
Exponentials resend periods (#2986)
darkdh Aug 8, 2019
4b2b835
Native code for bookmark order calculations
AlexeyBarabash Jul 24, 2019
1c2ba0a
Testcases for native bookmark order calculations
AlexeyBarabash Jul 24, 2019
412e408
Bookmarks positioning by order strings
AlexeyBarabash Jul 24, 2019
e1104e2
Updated testcases for positioning by orders
AlexeyBarabash Jul 24, 2019
5cab8ba
In case of equal orders use object_id
AlexeyBarabash Aug 6, 2019
4969766
Test case for use object_id when orders are equal
AlexeyBarabash Aug 6, 2019
6eef9c2
Ignore move events during extensive changes
AlexeyBarabash Aug 6, 2019
6636c1d
Network changes and Reset handling
darkdh Aug 13, 2019
b376e3f
Using UniquePosition for bookmark order by position_in_parent
darkdh Aug 14, 2019
ce62ff9
Maintain SyncEntityInfo in bookmark node's meta info for legacy sync
darkdh Aug 15, 2019
99b97f5
Review Feedback (1)
darkdh Aug 16, 2019
220d604
Review Feedback (2)
darkdh Aug 16, 2019
99f29b6
Use WaitableEvent::TimedWait as fail-safe
darkdh Aug 16, 2019
8b24310
Review feedback (3)
darkdh Aug 17, 2019
42c5c31
Do not send meta info until all platforms support necessary chromium
darkdh Aug 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ deps = {
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@13bb40a215248cfbdd87d0a6b425c8397402e9e6",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@e3742ba3e8942eea9e4755d91532491871bd3116",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@1b4362968c8f22720bfb75af6f506d4ecc0f3116",
"components/brave_sync/extension/brave-sync": "https://github.com/brave/sync.git@e97e9e912552cd789cb2c1b1f327c77b32175317",
"components/brave_sync/extension/brave-sync": "https://github.com/brave/sync.git@91a68fdebc8962ca409045177438671f06a3c26a",
"components/brave_sync/extension/brave-crypto": "https://github.com/brave/crypto@0231e65ba211b152d742278319c545a83cb13fc0",
"vendor/bat-native-usermodel": "https://github.com/brave-intl/bat-native-usermodel.git@a82acda22d8cb255d86ee28734efb8ad886e9a49",
"vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@f88d942ddfaf61a4a6703355a77c4ef71bc95c35",
Expand Down
2 changes: 0 additions & 2 deletions browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ source_set("browser_process") {
"autocomplete/brave_autocomplete_provider_client.h",
"autocomplete/brave_autocomplete_scheme_classifier.cc",
"autocomplete/brave_autocomplete_scheme_classifier.h",
"bookmarks/brave_bookmark_client.cc",
"bookmarks/brave_bookmark_client.h",
"brave_shields/ad_block_pref_service_factory.cc",
"brave_shields/ad_block_pref_service_factory.h",
"brave_shields/cookie_pref_service_factory.cc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "brave/browser/autocomplete/brave_autocomplete_provider_client.h"

#include <memory>
#include <utility>
#include <vector>

#include "base/strings/utf_string_conversions.h"
#include "brave/common/webui_url_constants.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/testing_profile.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/fake_service_worker_context.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"

class BraveAutocompleteProviderClientUnitTest : public testing::Test {
public:
void SetUp() override {
profile_ = std::make_unique<TestingProfile>();
profile_ = CreateProfile();
client_ =
std::make_unique<BraveAutocompleteProviderClient>(profile_.get());
}
Expand All @@ -26,14 +33,24 @@ class BraveAutocompleteProviderClientUnitTest : public testing::Test {
return it != v.end();
}

protected:
private:
std::unique_ptr<TestingProfile> CreateProfile() {
TestingProfile::Builder builder;
auto prefs =
std::make_unique<sync_preferences::TestingPrefServiceSyncable>();
RegisterUserProfilePrefs(prefs->registry());
builder.SetPrefService(std::move(prefs));
return builder.Build();
}

content::TestBrowserThreadBundle test_browser_thread_bundle_;
std::unique_ptr<TestingProfile> profile_;
std::unique_ptr<BraveAutocompleteProviderClient> client_;
};

TEST_F(BraveAutocompleteProviderClientUnitTest,
SyncURLSuggestedNotSyncInternal) {
ASSERT_FALSE(BuiltinExists(base::ASCIIToUTF16(chrome::kChromeUISyncInternalsHost)));
ASSERT_FALSE(
BuiltinExists(base::ASCIIToUTF16(chrome::kChromeUISyncInternalsHost)));
ASSERT_TRUE(BuiltinExists(base::ASCIIToUTF16(kBraveUISyncHost)));
}
1 change: 0 additions & 1 deletion browser/autoplay/autoplay_permission_context_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "base/bind.h"
#include "base/macros.h"
#include "brave/common/pref_names.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/permissions/permission_request_id.h"
#include "chrome/browser/permissions/permission_request_manager.h"
Expand Down
40 changes: 0 additions & 40 deletions browser/bookmarks/brave_bookmark_client.cc

This file was deleted.

25 changes: 0 additions & 25 deletions browser/bookmarks/brave_bookmark_client.h

This file was deleted.

9 changes: 7 additions & 2 deletions browser/brave_content_browser_client_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "brave/common/pref_names.h"
#include "brave/components/brave_rewards/browser/buildflags/buildflags.h"
#include "brave/components/brave_shields/common/brave_shield_constants.h"
#include "brave/components/brave_sync/buildflags/buildflags.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/extension_service.h"
Expand Down Expand Up @@ -151,9 +152,11 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadCustomBravePages) {
std::vector<std::string> pages {
"adblock",
#if BUILDFLAG(BRAVE_REWARDS_ENABLED)
"rewards",
"rewards",
#endif
#if BUILDFLAG(ENABLE_BRAVE_SYNC)
chrome::kChromeUISyncHost,
#endif
chrome::kChromeUISyncHost,
};

std::vector<std::string> schemes {
Expand Down Expand Up @@ -205,6 +208,7 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadAboutHost) {
}
}

#if BUILDFLAG(ENABLE_BRAVE_SYNC)
IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest,
RewriteChromeSyncInternals) {
std::vector<std::string> schemes {
Expand All @@ -230,6 +234,7 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest,
"chrome://sync/");
}
}
#endif

IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest,
RewriteWelcomeWin10Host) {
Expand Down
3 changes: 3 additions & 0 deletions browser/brave_profile_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "brave/common/pref_names.h"
#include "brave/components/brave_shields/browser/brave_shields_web_contents_observer.h"
#include "brave/components/brave_sync/brave_sync_prefs.h"
#include "brave/components/brave_webtorrent/browser/buildflags/buildflags.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/prefs/session_startup_pref.h"
Expand Down Expand Up @@ -44,6 +45,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(kLocationBarIsWide, false);
registry->RegisterBooleanPref(kHideBraveRewardsButton, false);

brave_sync::prefs::Prefs::RegisterProfilePrefs(registry);

registry->RegisterBooleanPref(kWidevineOptedIn, false);
registry->RegisterBooleanPref(kAskWidevineInstall, true);
#if BUILDFLAG(BUNDLE_WIDEVINE_CDM)
Expand Down
2 changes: 0 additions & 2 deletions browser/browser_context_keyed_service_factories.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "brave/browser/tor/tor_profile_service_factory.h"
#include "brave/components/brave_ads/browser/ads_service_factory.h"
#include "brave/components/brave_rewards/browser/rewards_service_factory.h"
#include "brave/components/brave_sync/brave_sync_service_factory.h"

namespace brave {

Expand All @@ -21,7 +20,6 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
brave_rewards::RewardsServiceFactory::GetInstance();
brave_shields::AdBlockPrefServiceFactory::GetInstance();
brave_shields::CookiePrefServiceFactory::GetInstance();
brave_sync::BraveSyncServiceFactory::GetInstance();
greaselion::GreaselionServiceFactory::GetInstance();
TorProfileServiceFactory::GetInstance();
SearchEngineProviderServiceFactory::GetInstance();
Expand Down
38 changes: 22 additions & 16 deletions browser/extensions/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import("//brave/components/brave_rewards/browser/buildflags/buildflags.gni")
import("//brave/components/brave_sync/buildflags/buildflags.gni")
import("//brave/components/brave_wallet/browser/buildflags/buildflags.gni")
import("//brave/components/brave_webtorrent/browser/buildflags/buildflags.gni")
import("//build/config/features.gni")
Expand All @@ -9,28 +10,22 @@ declare_args() {

source_set("extensions") {
sources = [
"api/rewards_notifications_api.cc",
"api/rewards_notifications_api.h",
"api/brave_extensions_api_client.cc",
"api/brave_extensions_api_client.h",
"api/brave_rewards_api.cc",
"api/brave_rewards_api.h",
"api/brave_shields_api.cc",
"api/brave_shields_api.h",
"api/brave_sync_api.cc",
"api/brave_sync_api.h",
"api/brave_sync_event_router.cc",
"api/brave_sync_event_router.h",
"api/brave_theme_api.cc",
"api/brave_theme_api.h",
"api/rewards_notifications_api.cc",
"api/rewards_notifications_api.h",
"api/settings_private/brave_prefs_util.cc",
"api/settings_private/brave_prefs_util.h",
"brave_component_extension_resource_manager.cc",
"brave_component_extension_resource_manager.h",
"brave_component_loader.cc",
"brave_component_loader.h",
"brave_extensions_browser_api_provider.cc",
"brave_extensions_browser_api_provider.h",
"brave_extension_install_prompt.cc",
"brave_extension_install_prompt.h",
"brave_extension_management.cc",
Expand All @@ -39,12 +34,14 @@ source_set("extensions") {
"brave_extension_provider.h",
"brave_extension_service.cc",
"brave_extension_service.h",
"brave_extensions_browser_api_provider.cc",
"brave_extensions_browser_api_provider.h",
"brave_theme_event_router.cc",
"brave_theme_event_router.h",
"brave_tor_client_updater.cc",
"brave_tor_client_updater.h",
"updater/brave_update_client_config.cc",
"updater/brave_update_client_config.h"
"updater/brave_update_client_config.h",
]

if (brave_wallet_enabled) {
Expand All @@ -63,11 +60,8 @@ source_set("extensions") {
"//brave/common:pref_names",
"//brave/common/extensions/api",
"//brave/components/brave_component_updater/browser",
"//brave/components/brave_extension:static_resources",
"//brave/components/brave_extension:generated_resources",
"//brave/components/brave_sync",
"//brave/components/brave_sync:generated_resources",
"//brave/components/brave_sync:static_resources",
"//brave/components/brave_extension:static_resources",
"//components/prefs",
"//components/update_client:patch_impl",
"//components/update_client:unzip_impl",
Expand All @@ -83,6 +77,20 @@ source_set("extensions") {
"//brave/components/brave_rewards/resources/extension:static_resources",
]
}
if (enable_brave_sync) {
sources += [
"api/brave_sync_api.cc",
"api/brave_sync_api.h",
"api/brave_sync_event_router.cc",
"api/brave_sync_event_router.h",
]

deps += [
"//brave/components/brave_sync",
"//brave/components/brave_sync:generated_resources",
"//brave/components/brave_sync:static_resources",
]
}
if (enable_brave_webtorrent) {
deps += [
"//brave/components/brave_webtorrent:generated_resources",
Expand All @@ -92,7 +100,5 @@ source_set("extensions") {
}

config("infura_config") {
defines = [
"BRAVE_INFURA_PROJECT_ID=\"$brave_infura_project_id\""
]
defines = [ "BRAVE_INFURA_PROJECT_ID=\"$brave_infura_project_id\"" ]
}
Loading