Commit 988ad379 authored by Rushan Suleymanov's avatar Rushan Suleymanov Committed by Commit Bot

[Sync] Move sync_util.* from sync/driver to sync/base

This change is needed to resolve possible cyclic dependency between
sync/driver and gcm_driver components (for the new sync invalidations
component).

Most of changes are trivial and just rename included folders.

Bug: 1102305
Change-Id: I05301274e06aa896fcb5646c58e11dabbc2101a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2312416Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Rushan Suleymanov <rushans@google.com>
Cr-Commit-Position: refs/heads/master@{#791659}
parent 06034242
......@@ -125,6 +125,7 @@
#include "components/site_isolation/features.h"
#include "components/spellcheck/common/spellcheck_features.h"
#include "components/spellcheck/spellcheck_buildflags.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/engine/sync_engine_switches.h"
#include "components/tracing/common/tracing_switches.h"
......
......@@ -70,10 +70,10 @@
#include "components/sync/base/pref_names.h"
#include "components/sync/base/report_unrecoverable_error.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/driver/model_type_controller.h"
#include "components/sync/driver/sync_api_component_factory.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/driver/syncable_service_based_model_type_controller.h"
#include "components/sync/engine/passive_model_worker.h"
#include "components/sync/model/model_type_store.h"
......
......@@ -59,7 +59,7 @@ static_library("gcm_driver") {
"//components/pref_registry",
"//components/prefs",
"//components/signin/public/identity_manager",
"//components/sync",
"//components/sync/base",
"//components/version_info",
"//google_apis",
"//google_apis/gcm",
......
......@@ -5,9 +5,7 @@ include_rules = [
"+components/pref_registry",
"+components/prefs",
"+components/signin/public",
"+components/sync/driver",
"+components/sync/protocol",
"+components/sync_preferences",
"+components/sync/base",
"+components/timers", # Only used for Chrome OS builds.
"+components/version_info",
"+content/public/browser/browser_context.h",
......
......@@ -12,7 +12,7 @@
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/gcm_driver.h"
#include "components/gcm_driver/gcm_driver_desktop.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/base/sync_util.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "url/gurl.h"
......
......@@ -23,7 +23,7 @@
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h"
#include "components/signin/public/identity_manager/scope_set.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/protocol/history_status.pb.h"
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/google_service_auth_error.h"
......
......@@ -445,6 +445,7 @@ source_set("unit_tests") {
"base/ordinal_unittest.cc",
"base/protobuf_unittest.cc",
"base/sync_prefs_unittest.cc",
"base/sync_util_unittest.cc",
"base/system_encryptor_unittest.cc",
"base/unique_position_unittest.cc",
"base/user_demographics_unittest.cc",
......@@ -465,7 +466,6 @@ source_set("unit_tests") {
"driver/sync_session_durations_metrics_recorder_unittest.cc",
"driver/sync_stopped_reporter_unittest.cc",
"driver/sync_user_settings_unittest.cc",
"driver/sync_util_unittest.cc",
"engine/cycle/sync_cycle_snapshot_unittest.cc",
"engine/model_safe_worker_unittest.cc",
"engine/net/http_bridge_unittest.cc",
......
......@@ -5,6 +5,11 @@
import("//build/config/features.gni")
import("//build/config/jumbo.gni")
declare_args() {
# Controls the product part of the user agent calculated in sync_util.cc.
sync_user_agent_product = "Chrome"
}
jumbo_static_library("base") {
sources = [
"bind_to_task_runner.h",
......@@ -53,6 +58,8 @@ jumbo_static_library("base") {
"sync_prefs.cc",
"sync_prefs.h",
"sync_stop_metadata_fate.h",
"sync_util.cc",
"sync_util.h",
"syncer_error.cc",
"syncer_error.h",
"system_encryptor.cc",
......@@ -85,14 +92,18 @@ jumbo_static_library("base") {
"//components/pref_registry",
"//components/prefs",
"//components/version_info",
"//components/version_info:generate_version_info",
"//crypto",
"//net",
"//third_party/zlib",
"//ui/base",
]
if (is_chromeos) {
deps += [ "//chromeos/constants" ]
}
defines = [ "SYNC_USER_AGENT_PRODUCT=$sync_user_agent_product" ]
}
static_library("test_support") {
......
......@@ -10,4 +10,5 @@ include_rules = [
"+third_party/metrics_proto",
"+third_party/zlib", # For UniquePosition compression
"+net",
"+ui/base",
]
......@@ -6,6 +6,9 @@
namespace switches {
// Overrides the default server used for profile sync.
const char kSyncServiceURL[] = "sync-url";
const base::Feature kSyncNigoriRemoveMetadataOnCacheGuidMismatch{
"SyncNigoriRemoveMetadataOnCacheGuidMismatch",
base::FEATURE_ENABLED_BY_DEFAULT};
......
......@@ -10,6 +10,8 @@
namespace switches {
extern const char kSyncServiceURL[];
extern const base::Feature kSyncNigoriRemoveMetadataOnCacheGuidMismatch;
extern const base::Feature kSyncForceDisableScryptForCustomPassphrase;
extern const base::Feature kSyncE2ELatencyMeasurement;
......
......@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/sync/driver/sync_util.h"
#include "components/sync/base/sync_util.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/stringize_macros.h"
#include "build/build_config.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/base/sync_base_switches.h"
#include "ui/base/device_form_factor.h"
#include "url/gurl.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_
#define COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_
#ifndef COMPONENTS_SYNC_BASE_SYNC_UTIL_H_
#define COMPONENTS_SYNC_BASE_SYNC_UTIL_H_
#include <string>
......@@ -41,4 +41,4 @@ std::string MakeUserAgentForSync(version_info::Channel channel);
} // namespace syncer
#endif // COMPONENTS_SYNC_DRIVER_SYNC_UTIL_H_
#endif // COMPONENTS_SYNC_BASE_SYNC_UTIL_H_
......@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/sync/driver/sync_util.h"
#include "components/sync/base/sync_util.h"
#include "base/command_line.h"
#include "base/strings/string_util.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/base/sync_base_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
......
......@@ -6,11 +6,6 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//tools/grit/grit_rule.gni")
declare_args() {
# Controls the product part of the user agent calculated in sync_util.cc.
sync_user_agent_product = "Chrome"
}
jumbo_static_library("driver") {
sources = [
"about_sync_util.cc",
......@@ -72,8 +67,6 @@ jumbo_static_library("driver") {
"sync_user_settings.h",
"sync_user_settings_impl.cc",
"sync_user_settings_impl.h",
"sync_util.cc",
"sync_util.h",
"syncable_service_based_model_type_controller.cc",
"syncable_service_based_model_type_controller.h",
"trusted_vault_client.h",
......@@ -105,7 +98,6 @@ jumbo_static_library("driver") {
"//components/version_info",
"//components/version_info:generate_version_info",
"//services/network/public/cpp",
"//ui/base",
]
if (!is_ios) {
......@@ -123,8 +115,6 @@ jumbo_static_library("driver") {
deps += [ "//chromeos/constants" ]
}
defines = [ "SYNC_USER_AGENT_PRODUCT=$sync_user_agent_product" ]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
}
......
......@@ -32,13 +32,13 @@
#include "components/sync/base/model_type.h"
#include "components/sync/base/stop_source.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/driver/backend_migrator.h"
#include "components/sync/driver/configure_context.h"
#include "components/sync/driver/sync_api_component_factory.h"
#include "components/sync/driver/sync_auth_manager.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/driver/sync_type_preference_provider.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/engine/cycle/type_debug_info_observer.h"
#include "components/sync/engine/engine_components_factory_impl.h"
#include "components/sync/engine/net/http_bridge.h"
......
......@@ -23,6 +23,7 @@
#include "components/signin/public/identity_manager/primary_account_mutator.h"
#include "components/sync/base/model_type.h"
#include "components/sync/base/pref_names.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/base/user_demographics.h"
#include "components/sync/base/user_selectable_type.h"
#include "components/sync/driver/configure_context.h"
......@@ -33,7 +34,6 @@
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/driver/sync_service_observer.h"
#include "components/sync/driver/sync_token_status.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/engine/fake_sync_engine.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/version_info/version_info_values.h"
......
......@@ -29,9 +29,6 @@ const char kSyncDisableDeferredStartup[] = "sync-disable-deferred-startup";
// chrome://sync-internals is enabled.
const char kSyncIncludeSpecificsInProtocolLog[] = "sync-include-specifics";
// Overrides the default server used for profile sync.
const char kSyncServiceURL[] = "sync-url";
// This flag causes sync to retry very quickly (see polling_constants.h) the
// when it encounters an error, as the first step towards exponential backoff.
const char kSyncShortInitialRetryOverride[] =
......
......@@ -22,7 +22,6 @@ extern const char kDisableSync[];
extern const char kSyncDeferredStartupTimeoutSeconds[];
extern const char kSyncDisableDeferredStartup[];
extern const char kSyncIncludeSpecificsInProtocolLog[];
extern const char kSyncServiceURL[];
extern const char kSyncShortInitialRetryOverride[];
extern const char kSyncShortNudgeDelayForTest[];
......
......@@ -4,7 +4,6 @@ include_rules = [
"+components/metrics",
"+components/prefs",
"+components/sync/base",
"+components/sync/driver",
"+components/sync/model",
"+components/sync/model_impl",
"+components/sync/protocol",
......
......@@ -6,7 +6,7 @@
#include "base/bind.h"
#include "components/sync/base/sync_prefs.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/base/sync_util.h"
#include "components/sync_device_info/device_info_sync_client.h"
#include "components/sync_device_info/device_info_util.h"
#include "components/sync_device_info/local_device_info_util.h"
......
......@@ -5,7 +5,7 @@
#include "components/sync_device_info/local_device_info_provider_impl.h"
#include "base/memory/ptr_util.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/base/sync_util.h"
#include "components/sync_device_info/device_info_sync_client.h"
#include "components/version_info/version_string.h"
#include "testing/gmock/include/gmock/gmock.h"
......
......@@ -49,6 +49,7 @@
#include "components/signin/ios/browser/features.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/strings/grit/components_strings.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/engine/sync_engine_switches.h"
#include "components/translate/core/browser/translate_prefs.h"
......
......@@ -31,9 +31,9 @@
#include "components/reading_list/core/reading_list_model.h"
#include "components/sync/base/report_unrecoverable_error.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/driver/sync_api_component_factory.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/engine/passive_model_worker.h"
#include "components/sync_preferences/pref_service_syncable.h"
#include "components/sync_sessions/session_sync_service.h"
......
......@@ -17,11 +17,11 @@
#include "components/invalidation/impl/profile_invalidation_provider.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/network_time/network_time_tracker.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/driver/profile_sync_service.h"
#include "components/sync/driver/startup_controller.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_util.h"
#include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
......
......@@ -22,6 +22,7 @@
#include "components/flags_ui/flags_ui_switches.h"
#include "components/flags_ui/pref_service_flags_storage.h"
#include "components/prefs/pref_service.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/sync/driver/sync_driver_switches.h"
#include "ios/web_view/internal/app/application_context.h"
......
......@@ -17,10 +17,10 @@
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/sync/base/model_type.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/driver/profile_sync_service.h"
#include "components/sync/driver/startup_controller.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_util.h"
#include "ios/web/public/thread/web_thread.h"
#include "ios/web_view/internal/app/application_context.h"
#include "ios/web_view/internal/autofill/web_view_personal_data_manager_factory.h"
......
......@@ -16,9 +16,9 @@
#include "components/history/core/common/pref_names.h"
#include "components/invalidation/impl/profile_invalidation_provider.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/sync/base/sync_util.h"
#include "components/sync/driver/data_type_controller.h"
#include "components/sync/driver/sync_api_component_factory.h"
#include "components/sync/driver/sync_util.h"
#include "components/sync/engine/passive_model_worker.h"
#include "components/version_info/version_info.h"
#include "components/version_info/version_string.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment