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") {
"engine_impl/net/url_translator.cc",
"engine_impl/net/url_translator.h",
"engine_impl/nudge_handler.h",
"engine_impl/nudge_source.h",
"engine_impl/sync_cycle_event.cc",
"engine_impl/sync_cycle_event.h",
"engine_impl/sync_engine_event_listener.h",
......
......@@ -112,7 +112,6 @@ void RecordSyncInitialState(SyncService::DisableReasonSet disable_reasons,
EngineComponentsFactory::Switches EngineSwitchesFromCommandLine() {
EngineComponentsFactory::Switches factory_switches = {
EngineComponentsFactory::ENCRYPTION_KEYSTORE,
EngineComponentsFactory::BACKOFF_NORMAL};
base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
......@@ -230,7 +229,6 @@ ProfileSyncService::ProfileSyncService(InitParams init_params)
network_connection_tracker_(init_params.network_connection_tracker),
is_first_time_sync_configure_(false),
sync_disabled_by_admin_(false),
unrecoverable_error_reason_(ERROR_REASON_UNSET),
expect_sync_configuration_aborted_(false),
invalidations_identity_provider_(
init_params.invalidations_identity_provider),
......@@ -730,7 +728,7 @@ SyncService::DisableReasonSet ProfileSyncService::GetDisableReasons() const {
if (!user_settings_->IsSyncRequested() && !IsLocalSyncEnabled()) {
result.Put(DISABLE_REASON_USER_CHOICE);
}
if (unrecoverable_error_reason_ != ERROR_REASON_UNSET) {
if (unrecoverable_error_reason_) {
result.Put(DISABLE_REASON_UNRECOVERABLE_ERROR);
}
return result;
......@@ -811,7 +809,7 @@ void ProfileSyncService::NotifyShutdown() {
}
void ProfileSyncService::ClearUnrecoverableError() {
unrecoverable_error_reason_ = ERROR_REASON_UNSET;
unrecoverable_error_reason_ = base::nullopt;
unrecoverable_error_message_.clear();
unrecoverable_error_location_ = base::Location();
}
......@@ -821,7 +819,6 @@ void ProfileSyncService::OnUnrecoverableErrorImpl(
const std::string& message,
UnrecoverableErrorReason reason) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_NE(reason, ERROR_REASON_UNSET);
unrecoverable_error_reason_ = reason;
unrecoverable_error_message_ = message;
unrecoverable_error_location_ = from_here;
......
......@@ -257,12 +257,8 @@ class ProfileSyncService : public SyncService,
};
enum UnrecoverableErrorReason {
ERROR_REASON_UNSET,
ERROR_REASON_SYNCER,
ERROR_REASON_ENGINE_INIT_FAILURE,
ERROR_REASON_CONFIGURATION_RETRY,
ERROR_REASON_ACTIONABLE_ERROR,
ERROR_REASON_LIMIT
};
// Virtual for testing.
......@@ -433,7 +429,8 @@ class ProfileSyncService : public SyncService,
bool sync_disabled_by_admin_;
// Information describing an unrecoverable error.
UnrecoverableErrorReason unrecoverable_error_reason_;
base::Optional<UnrecoverableErrorReason> unrecoverable_error_reason_ =
base::nullopt;
std::string unrecoverable_error_message_;
base::Location unrecoverable_error_location_;
......
......@@ -27,12 +27,6 @@ class SyncScheduler;
// components used by the SyncManager and other things inside engine/.
class EngineComponentsFactory {
public:
enum EncryptionMethod {
ENCRYPTION_LEGACY,
// Option to enable support for keystore key based encryption.
ENCRYPTION_KEYSTORE
};
enum BackoffOverride {
BACKOFF_NORMAL,
// Use this value for integration testing to avoid long delays /
......@@ -47,7 +41,6 @@ class EngineComponentsFactory {
// EngineComponentsFactory can use this information to build components
// with appropriate bells and whistles.
struct Switches {
EncryptionMethod encryption_method;
BackoffOverride backoff_override;
bool force_short_nudge_delay_for_test;
};
......
......@@ -14,7 +14,6 @@
#include "base/sequence_checker.h"
#include "components/sync/base/model_type.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"
namespace syncer {
......
......@@ -9,7 +9,6 @@
#include "base/check.h"
#include "base/notreached.h"
#include "components/sync/engine_impl/cycle/nudge_tracker.h"
namespace syncer {
......@@ -42,10 +41,10 @@ const char* WaitInterval::GetModeString(BlockingMode mode) {
#undef ENUM_CASE
DataTypeTracker::DataTypeTracker()
DataTypeTracker::DataTypeTracker(size_t initial_payload_buffer_size)
: local_nudge_count_(0),
local_refresh_request_count_(0),
payload_buffer_size_(NudgeTracker::kDefaultMaxPayloadsPerType),
payload_buffer_size_(initial_payload_buffer_size),
initial_sync_required_(false),
sync_required_to_resolve_conflict_(false) {}
......
......@@ -47,7 +47,7 @@ struct WaitInterval {
// A class to track the per-type scheduling data.
class DataTypeTracker {
public:
DataTypeTracker();
explicit DataTypeTracker(size_t initial_payload_buffer_size);
~DataTypeTracker();
// For STL compatibility, we do not forbid the creation of a default copy
......
......@@ -64,7 +64,8 @@ NudgeTracker::NudgeTracker()
base::TimeDelta::FromMilliseconds(kSyncSchedulerDelayMilliseconds)) {
// Default initialize all the type trackers.
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 {
// sync with the server.
class NudgeTracker {
public:
enum : size_t { kDefaultMaxPayloadsPerType = 10 };
NudgeTracker();
~NudgeTracker();
......@@ -160,11 +158,17 @@ class NudgeTracker {
// Update the default nudge delay.
void SetDefaultNudgeDelay(base::TimeDelta nudge_delay);
size_t GetDefaultMaxPayloadsPerTypeForTesting() {
return kDefaultMaxPayloadsPerType;
}
private:
using TypeTrackerMap = std::map<ModelType, std::unique_ptr<DataTypeTracker>>;
friend class SyncSchedulerImplTest;
const size_t kDefaultMaxPayloadsPerType = 10;
TypeTrackerMap type_trackers_;
// Tracks whether or not invalidations are currently enabled.
......
......@@ -37,9 +37,9 @@ class NudgeTrackerTest : public ::testing::Test {
public:
NudgeTrackerTest() { SetInvalidationsInSync(); }
static size_t GetHintBufferSize() {
size_t GetHintBufferSize() {
// Assumes that no test has adjusted this size.
return NudgeTracker::kDefaultMaxPayloadsPerType;
return nudge_tracker_.GetDefaultMaxPayloadsPerTypeForTesting();
}
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
class SyncManagerTest : public testing::Test {
protected:
enum NigoriStatus { DONT_WRITE_NIGORI, WRITE_TO_NIGORI };
enum EncryptionStatus { UNINITIALIZED, DEFAULT_ENCRYPTION, FULL_ENCRYPTION };
SyncManagerTest()
: sync_manager_("Test sync manager",
network::TestNetworkConnectionTracker::GetInstance()) {
......
......@@ -13,7 +13,6 @@
#include "base/time/time.h"
#include "components/sync/base/invalidation_interface.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"
namespace base {
......
......@@ -23,7 +23,6 @@
#include "components/sync/engine_impl/cycle/sync_cycle.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/nudge_source.h"
#include "components/sync/engine_impl/sync_scheduler.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 {
// An interface for services that handle receiving SyncChanges.
class SyncChangeProcessor {
public:
// Whether a context change should force a datatype refresh or not.
enum ContextRefreshStatus { NO_REFRESH, REFRESH_NEEDED };
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