Skip to content

Commit

Permalink
Uplift of #6363 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-browser-releases authored and darkdh committed Aug 7, 2020
1 parent 8cd54f3 commit d9894b2
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/config/brave_build.gni
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import("//brave/brave_repack_locales.gni")
import("//brave/build/config/compiler.gni")
import("//brave/build/features.gni")
import("//brave/components/sync/sources.gni")
import("//brave/components/sync/driver/sources.gni")
import("//brave/net/sources.gni")
import("//brave/third_party/blink/renderer/includes.gni")
10 changes: 10 additions & 0 deletions chromium_src/components/sync/engine/sync_manager_factory.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* Copyright (c) 2020 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/components/sync/engine_impl/brave_sync_manager_impl.h"

#define SyncManagerImpl BraveSyncManagerImpl
#include "../../../../../components/sync/engine/sync_manager_factory.cc"
#undef SyncManagerImpl
24 changes: 24 additions & 0 deletions components/sync/engine_impl/brave_sync_manager_impl.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright (c) 2020 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/components/sync/engine_impl/brave_sync_manager_impl.h"

namespace syncer {

BraveSyncManagerImpl::BraveSyncManagerImpl(
const std::string& name,
network::NetworkConnectionTracker* network_connection_tracker)
: SyncManagerImpl(name, network_connection_tracker) {}

BraveSyncManagerImpl::~BraveSyncManagerImpl() {}

void BraveSyncManagerImpl::StartSyncingNormally(base::Time last_poll_time) {
SyncManagerImpl::StartSyncingNormally(last_poll_time);
// Remove this hack when we have FCM invalidation integrated.
// We only enable BOOKMARKS by default so only force refresh it
RefreshTypes(ModelTypeSet(BOOKMARKS));
}

} // namespace syncer
30 changes: 30 additions & 0 deletions components/sync/engine_impl/brave_sync_manager_impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Copyright (c) 2020 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/. */

#ifndef BRAVE_COMPONENTS_SYNC_ENGINE_IMPL_BRAVE_SYNC_MANAGER_IMPL_H_
#define BRAVE_COMPONENTS_SYNC_ENGINE_IMPL_BRAVE_SYNC_MANAGER_IMPL_H_

#include <string>

#include "components/sync/engine_impl/sync_manager_impl.h"

namespace syncer {

class BraveSyncManagerImpl : public SyncManagerImpl {
public:
BraveSyncManagerImpl(
const std::string& name,
network::NetworkConnectionTracker* network_connection_tracker);
~BraveSyncManagerImpl() override;

void StartSyncingNormally(base::Time last_poll_time) override;

private:
DISALLOW_COPY_AND_ASSIGN(BraveSyncManagerImpl);
};

} // namespace syncer

#endif // BRAVE_COMPONENTS_SYNC_ENGINE_IMPL_BRAVE_SYNC_MANAGER_IMPL_H_
9 changes: 9 additions & 0 deletions components/sync/sources.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2020 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/.

brave_components_sync_sources = [
"//brave/components/sync/engine_impl/brave_sync_manager_impl.cc",
"//brave/components/sync/engine_impl/brave_sync_manager_impl.h",
]
12 changes: 12 additions & 0 deletions patches/components-sync-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/components/sync/BUILD.gn b/components/sync/BUILD.gn
index db5a9d0154d0c1e1390e4af6272d7d6cebe24b57..3cde948c91c4aa13297de70dafa86ee33db32906 100644
--- a/components/sync/BUILD.gn
+++ b/components/sync/BUILD.gn
@@ -413,6 +413,7 @@ jumbo_static_library("rest_of_sync") {
"syncable/write_transaction_info.cc",
"syncable/write_transaction_info.h",
]
+ sources += brave_components_sync_sources

configs += [ "//build/config:precompiled_headers" ]

0 comments on commit d9894b2

Please sign in to comment.