summaryrefslogtreecommitdiffstats
path: root/sync/internal_api
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-18 21:10:55 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-18 21:10:55 +0000
commitef1c5448ab2464dc6357151631a7977d7a6c8006 (patch)
tree60b6eab26a9c7e1cc23c82a60b24d7f2e5f08020 /sync/internal_api
parentbbee25fbd6c95c37b729a05a9c464345861195ec (diff)
downloadchromium_src-ef1c5448ab2464dc6357151631a7977d7a6c8006.zip
chromium_src-ef1c5448ab2464dc6357151631a7977d7a6c8006.tar.gz
chromium_src-ef1c5448ab2464dc6357151631a7977d7a6c8006.tar.bz2
[Sync] Move debug info events into enums proto
This also removes an old and obsolete enum that was being confused with the singleton events in some cases. BUG=none Review URL: https://codereview.chromium.org/202883003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api')
-rw-r--r--sync/internal_api/debug_info_event_listener.cc22
-rw-r--r--sync/internal_api/debug_info_event_listener.h2
-rw-r--r--sync/internal_api/debug_info_event_listener_unittest.cc12
3 files changed, 18 insertions, 18 deletions
diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc
index a80d803..6319a03 100644
--- a/sync/internal_api/debug_info_event_listener.cc
+++ b/sync/internal_api/debug_info_event_listener.cc
@@ -52,48 +52,48 @@ void DebugInfoEventListener::OnInitializationComplete(
const WeakHandle<DataTypeDebugInfoListener>& debug_listener,
bool success, ModelTypeSet restored_types) {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::INITIALIZATION_COMPLETE);
+ CreateAndAddEvent(sync_pb::SyncEnums::INITIALIZATION_COMPLETE);
}
void DebugInfoEventListener::OnConnectionStatusChange(
ConnectionStatus status) {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::CONNECTION_STATUS_CHANGE);
+ CreateAndAddEvent(sync_pb::SyncEnums::CONNECTION_STATUS_CHANGE);
}
void DebugInfoEventListener::OnPassphraseRequired(
PassphraseRequiredReason reason,
const sync_pb::EncryptedData& pending_keys) {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::PASSPHRASE_REQUIRED);
+ CreateAndAddEvent(sync_pb::SyncEnums::PASSPHRASE_REQUIRED);
}
void DebugInfoEventListener::OnPassphraseAccepted() {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::PASSPHRASE_ACCEPTED);
+ CreateAndAddEvent(sync_pb::SyncEnums::PASSPHRASE_ACCEPTED);
}
void DebugInfoEventListener::OnBootstrapTokenUpdated(
const std::string& bootstrap_token, BootstrapTokenType type) {
DCHECK(thread_checker_.CalledOnValidThread());
if (type == PASSPHRASE_BOOTSTRAP_TOKEN) {
- CreateAndAddEvent(sync_pb::DebugEventInfo::BOOTSTRAP_TOKEN_UPDATED);
+ CreateAndAddEvent(sync_pb::SyncEnums::BOOTSTRAP_TOKEN_UPDATED);
return;
}
DCHECK_EQ(type, KEYSTORE_BOOTSTRAP_TOKEN);
- CreateAndAddEvent(sync_pb::DebugEventInfo::KEYSTORE_TOKEN_UPDATED);
+ CreateAndAddEvent(sync_pb::SyncEnums::KEYSTORE_TOKEN_UPDATED);
}
void DebugInfoEventListener::OnEncryptedTypesChanged(
ModelTypeSet encrypted_types,
bool encrypt_everything) {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::ENCRYPTED_TYPES_CHANGED);
+ CreateAndAddEvent(sync_pb::SyncEnums::ENCRYPTED_TYPES_CHANGED);
}
void DebugInfoEventListener::OnEncryptionComplete() {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE);
+ CreateAndAddEvent(sync_pb::SyncEnums::ENCRYPTION_COMPLETE);
}
void DebugInfoEventListener::OnCryptographerStateChanged(
@@ -107,13 +107,13 @@ void DebugInfoEventListener::OnPassphraseTypeChanged(
PassphraseType type,
base::Time explicit_passphrase_time) {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::PASSPHRASE_TYPE_CHANGED);
+ CreateAndAddEvent(sync_pb::SyncEnums::PASSPHRASE_TYPE_CHANGED);
}
void DebugInfoEventListener::OnActionableError(
const SyncProtocolError& sync_error) {
DCHECK(thread_checker_.CalledOnValidThread());
- CreateAndAddEvent(sync_pb::DebugEventInfo::ACTIONABLE_ERROR);
+ CreateAndAddEvent(sync_pb::SyncEnums::ACTIONABLE_ERROR);
}
void DebugInfoEventListener::OnMigrationRequested(ModelTypeSet types) {}
@@ -244,7 +244,7 @@ void DebugInfoEventListener::OnDataTypeConfigureComplete(
}
void DebugInfoEventListener::CreateAndAddEvent(
- sync_pb::DebugEventInfo::SingletonEventType type) {
+ sync_pb::SyncEnums::SingletonDebugEventType type) {
DCHECK(thread_checker_.CalledOnValidThread());
sync_pb::DebugEventInfo event_info;
event_info.set_singleton_event(type);
diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h
index d88923a..d9a77c7 100644
--- a/sync/internal_api/debug_info_event_listener.h
+++ b/sync/internal_api/debug_info_event_listener.h
@@ -95,7 +95,7 @@ class SYNC_EXPORT_PRIVATE DebugInfoEventListener
FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyClearEvents);
void AddEventToQueue(const sync_pb::DebugEventInfo& event_info);
- void CreateAndAddEvent(sync_pb::DebugEventInfo::SingletonEventType type);
+ void CreateAndAddEvent(sync_pb::SyncEnums::SingletonDebugEventType type);
typedef std::deque<sync_pb::DebugEventInfo> DebugEventInfoQueue;
DebugEventInfoQueue events_;
diff --git a/sync/internal_api/debug_info_event_listener_unittest.cc b/sync/internal_api/debug_info_event_listener_unittest.cc
index 31f16f8..b02db98 100644
--- a/sync/internal_api/debug_info_event_listener_unittest.cc
+++ b/sync/internal_api/debug_info_event_listener_unittest.cc
@@ -13,20 +13,20 @@ typedef testing::Test DebugInfoEventListenerTest;
TEST_F(DebugInfoEventListenerTest, VerifyEventsAdded) {
DebugInfoEventListener debug_info_event_listener;
debug_info_event_listener.CreateAndAddEvent(
- sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE);
+ sync_pb::SyncEnums::ENCRYPTION_COMPLETE);
ASSERT_EQ(debug_info_event_listener.events_.size(), 1U);
const sync_pb::DebugEventInfo& debug_info =
debug_info_event_listener.events_.back();
ASSERT_TRUE(debug_info.has_singleton_event());
ASSERT_EQ(debug_info.singleton_event(),
- sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE);
+ sync_pb::SyncEnums::ENCRYPTION_COMPLETE);
}
TEST_F(DebugInfoEventListenerTest, VerifyQueueSize) {
DebugInfoEventListener debug_info_event_listener;
for (unsigned int i = 0; i < 2*kMaxEntries; ++i) {
debug_info_event_listener.CreateAndAddEvent(
- sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE);
+ sync_pb::SyncEnums::ENCRYPTION_COMPLETE);
}
sync_pb::DebugInfo debug_info;
debug_info_event_listener.GetDebugInfo(&debug_info);
@@ -38,7 +38,7 @@ TEST_F(DebugInfoEventListenerTest, VerifyQueueSize) {
TEST_F(DebugInfoEventListenerTest, VerifyGetEvents) {
DebugInfoEventListener debug_info_event_listener;
debug_info_event_listener.CreateAndAddEvent(
- sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE);
+ sync_pb::SyncEnums::ENCRYPTION_COMPLETE);
ASSERT_EQ(debug_info_event_listener.events_.size(), 1U);
sync_pb::DebugInfo debug_info;
debug_info_event_listener.GetDebugInfo(&debug_info);
@@ -46,13 +46,13 @@ TEST_F(DebugInfoEventListenerTest, VerifyGetEvents) {
ASSERT_EQ(debug_info.events_size(), 1);
ASSERT_TRUE(debug_info.events(0).has_singleton_event());
ASSERT_EQ(debug_info.events(0).singleton_event(),
- sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE);
+ sync_pb::SyncEnums::ENCRYPTION_COMPLETE);
}
TEST_F(DebugInfoEventListenerTest, VerifyClearEvents) {
DebugInfoEventListener debug_info_event_listener;
debug_info_event_listener.CreateAndAddEvent(
- sync_pb::DebugEventInfo::ENCRYPTION_COMPLETE);
+ sync_pb::SyncEnums::ENCRYPTION_COMPLETE);
ASSERT_EQ(debug_info_event_listener.events_.size(), 1U);
debug_info_event_listener.ClearDebugInfo();
ASSERT_EQ(debug_info_event_listener.events_.size(), 0U);