Commit 6b811fec authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

Remove some unused enums from components/sync

No behavior is changed.

Bug: None
Change-Id: Ide3e55a5c72a2c25e9a9921b7bee3eb9032e4022
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523209
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825275}
parent 11a2ea0b
...@@ -165,7 +165,6 @@ static_library("rest_of_sync") { ...@@ -165,7 +165,6 @@ static_library("rest_of_sync") {
"engine_impl/net/url_translator.cc", "engine_impl/net/url_translator.cc",
"engine_impl/net/url_translator.h", "engine_impl/net/url_translator.h",
"engine_impl/nudge_handler.h", "engine_impl/nudge_handler.h",
"engine_impl/nudge_source.h",
"engine_impl/sync_cycle_event.cc", "engine_impl/sync_cycle_event.cc",
"engine_impl/sync_cycle_event.h", "engine_impl/sync_cycle_event.h",
"engine_impl/sync_engine_event_listener.h", "engine_impl/sync_engine_event_listener.h",
......
...@@ -112,7 +112,6 @@ void RecordSyncInitialState(SyncService::DisableReasonSet disable_reasons, ...@@ -112,7 +112,6 @@ void RecordSyncInitialState(SyncService::DisableReasonSet disable_reasons,
EngineComponentsFactory::Switches EngineSwitchesFromCommandLine() { EngineComponentsFactory::Switches EngineSwitchesFromCommandLine() {
EngineComponentsFactory::Switches factory_switches = { EngineComponentsFactory::Switches factory_switches = {
EngineComponentsFactory::ENCRYPTION_KEYSTORE,
EngineComponentsFactory::BACKOFF_NORMAL}; EngineComponentsFactory::BACKOFF_NORMAL};
base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
...@@ -230,7 +229,6 @@ ProfileSyncService::ProfileSyncService(InitParams init_params) ...@@ -230,7 +229,6 @@ ProfileSyncService::ProfileSyncService(InitParams init_params)
network_connection_tracker_(init_params.network_connection_tracker), network_connection_tracker_(init_params.network_connection_tracker),
is_first_time_sync_configure_(false), is_first_time_sync_configure_(false),
sync_disabled_by_admin_(false), sync_disabled_by_admin_(false),
unrecoverable_error_reason_(ERROR_REASON_UNSET),
expect_sync_configuration_aborted_(false), expect_sync_configuration_aborted_(false),
invalidations_identity_provider_( invalidations_identity_provider_(
init_params.invalidations_identity_provider), init_params.invalidations_identity_provider),
...@@ -730,7 +728,7 @@ SyncService::DisableReasonSet ProfileSyncService::GetDisableReasons() const { ...@@ -730,7 +728,7 @@ SyncService::DisableReasonSet ProfileSyncService::GetDisableReasons() const {
if (!user_settings_->IsSyncRequested() && !IsLocalSyncEnabled()) { if (!user_settings_->IsSyncRequested() && !IsLocalSyncEnabled()) {
result.Put(DISABLE_REASON_USER_CHOICE); result.Put(DISABLE_REASON_USER_CHOICE);
} }
if (unrecoverable_error_reason_ != ERROR_REASON_UNSET) { if (unrecoverable_error_reason_) {
result.Put(DISABLE_REASON_UNRECOVERABLE_ERROR); result.Put(DISABLE_REASON_UNRECOVERABLE_ERROR);
} }
return result; return result;
...@@ -811,7 +809,7 @@ void ProfileSyncService::NotifyShutdown() { ...@@ -811,7 +809,7 @@ void ProfileSyncService::NotifyShutdown() {
} }
void ProfileSyncService::ClearUnrecoverableError() { void ProfileSyncService::ClearUnrecoverableError() {
unrecoverable_error_reason_ = ERROR_REASON_UNSET; unrecoverable_error_reason_ = base::nullopt;
unrecoverable_error_message_.clear(); unrecoverable_error_message_.clear();
unrecoverable_error_location_ = base::Location(); unrecoverable_error_location_ = base::Location();
} }
...@@ -821,7 +819,6 @@ void ProfileSyncService::OnUnrecoverableErrorImpl( ...@@ -821,7 +819,6 @@ void ProfileSyncService::OnUnrecoverableErrorImpl(
const std::string& message, const std::string& message,
UnrecoverableErrorReason reason) { UnrecoverableErrorReason reason) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_NE(reason, ERROR_REASON_UNSET);
unrecoverable_error_reason_ = reason; unrecoverable_error_reason_ = reason;
unrecoverable_error_message_ = message; unrecoverable_error_message_ = message;
unrecoverable_error_location_ = from_here; unrecoverable_error_location_ = from_here;
......
...@@ -257,12 +257,8 @@ class ProfileSyncService : public SyncService, ...@@ -257,12 +257,8 @@ class ProfileSyncService : public SyncService,
}; };
enum UnrecoverableErrorReason { enum UnrecoverableErrorReason {
ERROR_REASON_UNSET,
ERROR_REASON_SYNCER,
ERROR_REASON_ENGINE_INIT_FAILURE, ERROR_REASON_ENGINE_INIT_FAILURE,
ERROR_REASON_CONFIGURATION_RETRY,
ERROR_REASON_ACTIONABLE_ERROR, ERROR_REASON_ACTIONABLE_ERROR,
ERROR_REASON_LIMIT
}; };
// Virtual for testing. // Virtual for testing.
...@@ -433,7 +429,8 @@ class ProfileSyncService : public SyncService, ...@@ -433,7 +429,8 @@ class ProfileSyncService : public SyncService,
bool sync_disabled_by_admin_; bool sync_disabled_by_admin_;
// Information describing an unrecoverable error. // Information describing an unrecoverable error.
UnrecoverableErrorReason unrecoverable_error_reason_; base::Optional<UnrecoverableErrorReason> unrecoverable_error_reason_ =
base::nullopt;
std::string unrecoverable_error_message_; std::string unrecoverable_error_message_;
base::Location unrecoverable_error_location_; base::Location unrecoverable_error_location_;
......
...@@ -27,12 +27,6 @@ class SyncScheduler; ...@@ -27,12 +27,6 @@ class SyncScheduler;
// components used by the SyncManager and other things inside engine/. // components used by the SyncManager and other things inside engine/.
class EngineComponentsFactory { class EngineComponentsFactory {
public: public:
enum EncryptionMethod {
ENCRYPTION_LEGACY,
// Option to enable support for keystore key based encryption.
ENCRYPTION_KEYSTORE
};
enum BackoffOverride { enum BackoffOverride {
BACKOFF_NORMAL, BACKOFF_NORMAL,
// Use this value for integration testing to avoid long delays / // Use this value for integration testing to avoid long delays /
...@@ -47,7 +41,6 @@ class EngineComponentsFactory { ...@@ -47,7 +41,6 @@ class EngineComponentsFactory {
// EngineComponentsFactory can use this information to build components // EngineComponentsFactory can use this information to build components
// with appropriate bells and whistles. // with appropriate bells and whistles.
struct Switches { struct Switches {
EncryptionMethod encryption_method;
BackoffOverride backoff_override; BackoffOverride backoff_override;
bool force_short_nudge_delay_for_test; bool force_short_nudge_delay_for_test;
}; };
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "components/sync/base/model_type.h" #include "components/sync/base/model_type.h"
#include "components/sync/engine/sync_status.h" #include "components/sync/engine/sync_status.h"
#include "components/sync/engine_impl/nudge_source.h"
#include "components/sync/engine_impl/sync_engine_event_listener.h" #include "components/sync/engine_impl/sync_engine_event_listener.h"
namespace syncer { namespace syncer {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/check.h" #include "base/check.h"
#include "base/notreached.h" #include "base/notreached.h"
#include "components/sync/engine_impl/cycle/nudge_tracker.h"
namespace syncer { namespace syncer {
...@@ -42,10 +41,10 @@ const char* WaitInterval::GetModeString(BlockingMode mode) { ...@@ -42,10 +41,10 @@ const char* WaitInterval::GetModeString(BlockingMode mode) {
#undef ENUM_CASE #undef ENUM_CASE
DataTypeTracker::DataTypeTracker() DataTypeTracker::DataTypeTracker(size_t initial_payload_buffer_size)
: local_nudge_count_(0), : local_nudge_count_(0),
local_refresh_request_count_(0), local_refresh_request_count_(0),
payload_buffer_size_(NudgeTracker::kDefaultMaxPayloadsPerType), payload_buffer_size_(initial_payload_buffer_size),
initial_sync_required_(false), initial_sync_required_(false),
sync_required_to_resolve_conflict_(false) {} sync_required_to_resolve_conflict_(false) {}
......
...@@ -47,7 +47,7 @@ struct WaitInterval { ...@@ -47,7 +47,7 @@ struct WaitInterval {
// A class to track the per-type scheduling data. // A class to track the per-type scheduling data.
class DataTypeTracker { class DataTypeTracker {
public: public:
DataTypeTracker(); explicit DataTypeTracker(size_t initial_payload_buffer_size);
~DataTypeTracker(); ~DataTypeTracker();
// For STL compatibility, we do not forbid the creation of a default copy // For STL compatibility, we do not forbid the creation of a default copy
......
...@@ -64,7 +64,8 @@ NudgeTracker::NudgeTracker() ...@@ -64,7 +64,8 @@ NudgeTracker::NudgeTracker()
base::TimeDelta::FromMilliseconds(kSyncSchedulerDelayMilliseconds)) { base::TimeDelta::FromMilliseconds(kSyncSchedulerDelayMilliseconds)) {
// Default initialize all the type trackers. // Default initialize all the type trackers.
for (ModelType type : ProtocolTypes()) { for (ModelType type : ProtocolTypes()) {
type_trackers_.emplace(type, std::make_unique<DataTypeTracker>()); type_trackers_.emplace(
type, std::make_unique<DataTypeTracker>(kDefaultMaxPayloadsPerType));
} }
} }
......
...@@ -25,8 +25,6 @@ namespace syncer { ...@@ -25,8 +25,6 @@ namespace syncer {
// sync with the server. // sync with the server.
class NudgeTracker { class NudgeTracker {
public: public:
enum : size_t { kDefaultMaxPayloadsPerType = 10 };
NudgeTracker(); NudgeTracker();
~NudgeTracker(); ~NudgeTracker();
...@@ -160,11 +158,17 @@ class NudgeTracker { ...@@ -160,11 +158,17 @@ class NudgeTracker {
// Update the default nudge delay. // Update the default nudge delay.
void SetDefaultNudgeDelay(base::TimeDelta nudge_delay); void SetDefaultNudgeDelay(base::TimeDelta nudge_delay);
size_t GetDefaultMaxPayloadsPerTypeForTesting() {
return kDefaultMaxPayloadsPerType;
}
private: private:
using TypeTrackerMap = std::map<ModelType, std::unique_ptr<DataTypeTracker>>; using TypeTrackerMap = std::map<ModelType, std::unique_ptr<DataTypeTracker>>;
friend class SyncSchedulerImplTest; friend class SyncSchedulerImplTest;
const size_t kDefaultMaxPayloadsPerType = 10;
TypeTrackerMap type_trackers_; TypeTrackerMap type_trackers_;
// Tracks whether or not invalidations are currently enabled. // Tracks whether or not invalidations are currently enabled.
......
...@@ -37,9 +37,9 @@ class NudgeTrackerTest : public ::testing::Test { ...@@ -37,9 +37,9 @@ class NudgeTrackerTest : public ::testing::Test {
public: public:
NudgeTrackerTest() { SetInvalidationsInSync(); } NudgeTrackerTest() { SetInvalidationsInSync(); }
static size_t GetHintBufferSize() { size_t GetHintBufferSize() {
// Assumes that no test has adjusted this size. // Assumes that no test has adjusted this size.
return NudgeTracker::kDefaultMaxPayloadsPerType; return nudge_tracker_.GetDefaultMaxPayloadsPerTypeForTesting();
} }
bool InvalidationsOutOfSync() const { bool InvalidationsOutOfSync() const {
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SYNC_ENGINE_IMPL_NUDGE_SOURCE_H_
#define COMPONENTS_SYNC_ENGINE_IMPL_NUDGE_SOURCE_H_
namespace syncer {
enum NudgeSource {
NUDGE_SOURCE_UNKNOWN = 0,
// We received an invalidation message and are nudging to check for updates.
NUDGE_SOURCE_NOTIFICATION,
// A local change occurred (e.g. bookmark moved).
NUDGE_SOURCE_LOCAL,
// A local event is triggering an optimistic datatype refresh.
NUDGE_SOURCE_LOCAL_REFRESH,
};
} // namespace syncer
#endif // COMPONENTS_SYNC_ENGINE_IMPL_NUDGE_SOURCE_H_
...@@ -157,10 +157,6 @@ class SyncEncryptionHandlerObserverMock ...@@ -157,10 +157,6 @@ class SyncEncryptionHandlerObserverMock
class SyncManagerTest : public testing::Test { class SyncManagerTest : public testing::Test {
protected: protected:
enum NigoriStatus { DONT_WRITE_NIGORI, WRITE_TO_NIGORI };
enum EncryptionStatus { UNINITIALIZED, DEFAULT_ENCRYPTION, FULL_ENCRYPTION };
SyncManagerTest() SyncManagerTest()
: sync_manager_("Test sync manager", : sync_manager_("Test sync manager",
network::TestNetworkConnectionTracker::GetInstance()) { network::TestNetworkConnectionTracker::GetInstance()) {
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "components/sync/base/invalidation_interface.h" #include "components/sync/base/invalidation_interface.h"
#include "components/sync/engine_impl/cycle/sync_cycle.h" #include "components/sync/engine_impl/cycle/sync_cycle.h"
#include "components/sync/engine_impl/nudge_source.h"
#include "services/network/public/mojom/network_change_manager.mojom.h" #include "services/network/public/mojom/network_change_manager.mojom.h"
namespace base { namespace base {
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "components/sync/engine_impl/cycle/sync_cycle.h" #include "components/sync/engine_impl/cycle/sync_cycle.h"
#include "components/sync/engine_impl/cycle/sync_cycle_context.h" #include "components/sync/engine_impl/cycle/sync_cycle_context.h"
#include "components/sync/engine_impl/net/server_connection_manager.h" #include "components/sync/engine_impl/net/server_connection_manager.h"
#include "components/sync/engine_impl/nudge_source.h"
#include "components/sync/engine_impl/sync_scheduler.h" #include "components/sync/engine_impl/sync_scheduler.h"
#include "components/sync/engine_impl/syncer.h" #include "components/sync/engine_impl/syncer.h"
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_TYPES_H_
#define COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_TYPES_H_
// The intent of this is to keep all shared data types and enums for the syncer
// in a single place without having dependencies between other files.
namespace syncer {
// Different results from the verify phase will yield different methods of
// processing in the ProcessUpdates phase. The SKIP result means the entry
// doesn't go to the ProcessUpdates phase.
enum VerifyResult {
VERIFY_FAIL,
VERIFY_SUCCESS,
VERIFY_UNDELETE,
VERIFY_SKIP,
VERIFY_UNDECIDED
};
enum VerifyCommitResult {
VERIFY_UNSYNCABLE,
VERIFY_OK,
};
} // namespace syncer
#endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_TYPES_H_
...@@ -23,9 +23,6 @@ namespace syncer { ...@@ -23,9 +23,6 @@ namespace syncer {
// An interface for services that handle receiving SyncChanges. // An interface for services that handle receiving SyncChanges.
class SyncChangeProcessor { class SyncChangeProcessor {
public: public:
// Whether a context change should force a datatype refresh or not.
enum ContextRefreshStatus { NO_REFRESH, REFRESH_NEEDED };
SyncChangeProcessor() = default; SyncChangeProcessor() = default;
virtual ~SyncChangeProcessor() = default; virtual ~SyncChangeProcessor() = default;
......
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