diff options
Diffstat (limited to 'sync/internal_api')
-rw-r--r-- | sync/internal_api/DEPS | 1 | ||||
-rw-r--r-- | sync/internal_api/debug_info_event_listener.cc | 16 | ||||
-rw-r--r-- | sync/internal_api/debug_info_event_listener.h | 1 | ||||
-rw-r--r-- | sync/internal_api/public/base/model_type_test_util.cc | 19 | ||||
-rw-r--r-- | sync/internal_api/public/base/model_type_test_util.h | 16 | ||||
-rw-r--r-- | sync/internal_api/public/sync_manager.h | 3 | ||||
-rw-r--r-- | sync/internal_api/public/test/fake_sync_manager.h | 2 | ||||
-rw-r--r-- | sync/internal_api/sync_manager_impl.cc | 16 | ||||
-rw-r--r-- | sync/internal_api/sync_manager_impl.h | 7 | ||||
-rw-r--r-- | sync/internal_api/sync_manager_impl_unittest.cc | 4 | ||||
-rw-r--r-- | sync/internal_api/sync_rollback_manager_base.cc | 2 | ||||
-rw-r--r-- | sync/internal_api/sync_rollback_manager_base.h | 2 | ||||
-rw-r--r-- | sync/internal_api/test/fake_sync_manager.cc | 4 |
13 files changed, 11 insertions, 82 deletions
diff --git a/sync/internal_api/DEPS b/sync/internal_api/DEPS index dec66bc..13e6b8a 100644 --- a/sync/internal_api/DEPS +++ b/sync/internal_api/DEPS @@ -7,7 +7,6 @@ include_rules = [ "+sync/base", "+sync/engine", "+sync/js", - "+sync/notifier", "+sync/protocol", "+sync/sessions", "+sync/syncable", diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc index b3d5505..3e7780c 100644 --- a/sync/internal_api/debug_info_event_listener.cc +++ b/sync/internal_api/debug_info_event_listener.cc @@ -4,7 +4,6 @@ #include "sync/internal_api/debug_info_event_listener.h" -#include "sync/notifier/object_id_invalidation_map.h" #include "sync/util/cryptographer.h" namespace syncer { @@ -128,21 +127,6 @@ void DebugInfoEventListener::OnNudgeFromDatatype(ModelType datatype) { AddEventToQueue(event_info); } -void DebugInfoEventListener::OnIncomingNotification( - const ObjectIdInvalidationMap& invalidation_map) { - DCHECK(thread_checker_.CalledOnValidThread()); - sync_pb::DebugEventInfo event_info; - ModelTypeSet types = - ObjectIdSetToModelTypeSet(invalidation_map.GetObjectIds()); - - for (ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) { - event_info.add_datatypes_notified_from_server( - GetSpecificsFieldNumberFromModelType(it.Get())); - } - - AddEventToQueue(event_info); -} - void DebugInfoEventListener::GetDebugInfo(sync_pb::DebugInfo* debug_info) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK_LE(events_.size(), kMaxEntries); diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h index 1f71682..64fd830 100644 --- a/sync/internal_api/debug_info_event_listener.h +++ b/sync/internal_api/debug_info_event_listener.h @@ -73,7 +73,6 @@ class SYNC_EXPORT_PRIVATE DebugInfoEventListener // Sync manager events. void OnNudgeFromDatatype(ModelType datatype); - void OnIncomingNotification(const ObjectIdInvalidationMap& invalidations); // DebugInfoGetter implementation. virtual void GetDebugInfo(sync_pb::DebugInfo* debug_info) OVERRIDE; diff --git a/sync/internal_api/public/base/model_type_test_util.cc b/sync/internal_api/public/base/model_type_test_util.cc index 5893922..8c1164b 100644 --- a/sync/internal_api/public/base/model_type_test_util.cc +++ b/sync/internal_api/public/base/model_type_test_util.cc @@ -6,25 +6,6 @@ namespace syncer { -syncer::Invalidation BuildInvalidation( - ModelType type, - int version, - const std::string& payload) { - invalidation::ObjectId id; - bool result = RealModelTypeToObjectId(type, &id); - DCHECK(result); - return Invalidation::Init(id, version, payload); -} - -ObjectIdInvalidationMap BuildInvalidationMap( - ModelType type, - int version, - const std::string& payload) { - ObjectIdInvalidationMap map; - map.Insert(BuildInvalidation(type, version, payload)); - return map; -} - void PrintTo(ModelTypeSet model_types, ::std::ostream* os) { *os << ModelTypeSetToString(model_types); } diff --git a/sync/internal_api/public/base/model_type_test_util.h b/sync/internal_api/public/base/model_type_test_util.h index 1412f66..cd347cb 100644 --- a/sync/internal_api/public/base/model_type_test_util.h +++ b/sync/internal_api/public/base/model_type_test_util.h @@ -8,26 +8,10 @@ #include <ostream> #include "sync/internal_api/public/base/model_type.h" -#include "sync/notifier/object_id_invalidation_map.h" #include "testing/gmock/include/gmock/gmock.h" namespace syncer { -// Builds an invaliation map that contains a single invalidation with specified -// type, version, and payload. The type will be converted from a ModelType to -// and ObjectId. -ObjectIdInvalidationMap BuildInvalidationMap( - ModelType type, - int version, - const std::string& payload); - -// Builds an invalidation. Similar to Invalidation::Init, but its first -// parameter is a ModelType rather than an ObjectId. -syncer::Invalidation BuildInvalidation( - ModelType type, - int version, - const std::string& payload); - // Defined for googletest. Forwards to ModelTypeSetToString(). void PrintTo(ModelTypeSet model_types, ::std::ostream* os); diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h index b8cc50d..ee03ba4 100644 --- a/sync/internal_api/public/sync_manager.h +++ b/sync/internal_api/public/sync_manager.h @@ -30,7 +30,6 @@ #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" #include "sync/internal_api/public/util/unrecoverable_error_handler.h" #include "sync/internal_api/public/util/weak_handle.h" -#include "sync/notifier/invalidation_handler.h" #include "sync/protocol/sync_protocol_error.h" namespace sync_pb { @@ -312,7 +311,7 @@ class SYNC_EXPORT SyncManager { const base::Closure& retry_task) = 0; // Inform the syncer of a change in the invalidator's state. - virtual void OnInvalidatorStateChange(InvalidatorState state) = 0; + virtual void SetInvalidatorEnabled(bool invalidator_enabled) = 0; // Inform the syncer that its cached information about a type is obsolete. virtual void OnIncomingInvalidation( diff --git a/sync/internal_api/public/test/fake_sync_manager.h b/sync/internal_api/public/test/fake_sync_manager.h index f4ea19a..24dd9c5 100644 --- a/sync/internal_api/public/test/fake_sync_manager.h +++ b/sync/internal_api/public/test/fake_sync_manager.h @@ -67,7 +67,7 @@ class FakeSyncManager : public SyncManager { scoped_ptr<InvalidationInterface> interface) OVERRIDE; // Posts a method to update the invalidator state on the sync thread. - virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; + virtual void SetInvalidatorEnabled(bool invalidator_enabled) OVERRIDE; // Block until the sync thread has finished processing any pending messages. void WaitForSyncThread(); diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc index 168c19f..256a5c9 100644 --- a/sync/internal_api/sync_manager_impl.cc +++ b/sync/internal_api/sync_manager_impl.cc @@ -39,9 +39,6 @@ #include "sync/internal_api/sync_context_proxy_impl.h" #include "sync/internal_api/syncapi_internal.h" #include "sync/internal_api/syncapi_server_connection_manager.h" -#include "sync/notifier/invalidation_util.h" -#include "sync/notifier/invalidator.h" -#include "sync/notifier/object_id_invalidation_map.h" #include "sync/protocol/proto_value_conversions.h" #include "sync/protocol/sync.pb.h" #include "sync/sessions/directory_type_debug_info_emitter.h" @@ -170,7 +167,6 @@ SyncManagerImpl::SyncManagerImpl(const std::string& name) change_delegate_(NULL), initialized_(false), observing_network_connectivity_changes_(false), - invalidator_state_(DEFAULT_INVALIDATION_ERROR), report_unrecoverable_error_function_(NULL), weak_ptr_factory_(this) { // Pre-fill |notification_info_map_|. @@ -984,16 +980,12 @@ scoped_ptr<base::ListValue> SyncManagerImpl::GetAllNodesForType( return it->second->GetAllNodes(); } -void SyncManagerImpl::OnInvalidatorStateChange(InvalidatorState state) { +void SyncManagerImpl::SetInvalidatorEnabled(bool invalidator_enabled) { DCHECK(thread_checker_.CalledOnValidThread()); - const std::string& state_str = InvalidatorStateToString(state); - invalidator_state_ = state; - DVLOG(1) << "Invalidator state changed to: " << state_str; - const bool notifications_enabled = - (invalidator_state_ == INVALIDATIONS_ENABLED); - allstatus_.SetNotificationsEnabled(notifications_enabled); - scheduler_->SetNotificationsEnabled(notifications_enabled); + DVLOG(1) << "Invalidator enabled state is now: " << invalidator_enabled; + allstatus_.SetNotificationsEnabled(invalidator_enabled); + scheduler_->SetNotificationsEnabled(invalidator_enabled); } void SyncManagerImpl::OnIncomingInvalidation( diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h index c447aa1..3037535 100644 --- a/sync/internal_api/sync_manager_impl.h +++ b/sync/internal_api/sync_manager_impl.h @@ -26,7 +26,6 @@ #include "sync/internal_api/public/user_share.h" #include "sync/internal_api/sync_encryption_handler_impl.h" #include "sync/js/js_backend.h" -#include "sync/notifier/invalidation_handler.h" #include "sync/syncable/directory_change_delegate.h" #include "sync/util/cryptographer.h" #include "sync/util/time.h" @@ -104,7 +103,7 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl const ModelSafeRoutingInfo& new_routing_info, const base::Closure& ready_task, const base::Closure& retry_task) OVERRIDE; - virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; + virtual void SetInvalidatorEnabled(bool invalidator_enabled) OVERRIDE; virtual void OnIncomingInvalidation( syncer::ModelType type, scoped_ptr<InvalidationInterface> invalidation) OVERRIDE; @@ -213,8 +212,6 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl private: friend class SyncManagerTest; FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, NudgeDelayTest); - FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, OnNotificationStateChange); - FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, OnIncomingNotification); FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, PurgeDisabledTypes); FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, PurgeUnappliedTypes); @@ -346,8 +343,6 @@ class SYNC_EXPORT_PRIVATE SyncManagerImpl bool observing_network_connectivity_changes_; - InvalidatorState invalidator_state_; - // Map used to store the notification info to be displayed in // about:sync page. NotificationInfoMap notification_info_map_; diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index 1436e9a..d2b1dec 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -45,8 +45,6 @@ #include "sync/js/js_backend.h" #include "sync/js/js_event_handler.h" #include "sync/js/js_test_util.h" -#include "sync/notifier/invalidation_handler.h" -#include "sync/notifier/invalidator.h" #include "sync/protocol/bookmark_specifics.pb.h" #include "sync/protocol/encryption.pb.h" #include "sync/protocol/extension_specifics.pb.h" @@ -979,7 +977,7 @@ class SyncManagerTest : public testing::Test, void SimulateInvalidatorStateChangeForTest(InvalidatorState state) { DCHECK(sync_manager_.thread_checker_.CalledOnValidThread()); - sync_manager_.OnInvalidatorStateChange(state); + sync_manager_.SetInvalidatorEnabled(state == INVALIDATIONS_ENABLED); } void SetProgressMarkerForType(ModelType type, bool set) { diff --git a/sync/internal_api/sync_rollback_manager_base.cc b/sync/internal_api/sync_rollback_manager_base.cc index ec1099e..6f864a3 100644 --- a/sync/internal_api/sync_rollback_manager_base.cc +++ b/sync/internal_api/sync_rollback_manager_base.cc @@ -128,7 +128,7 @@ void SyncRollbackManagerBase::ConfigureSyncer( ready_task.Run(); } -void SyncRollbackManagerBase::OnInvalidatorStateChange(InvalidatorState state) { +void SyncRollbackManagerBase::SetInvalidatorEnabled(bool invalidator_enabled) { } void SyncRollbackManagerBase::OnIncomingInvalidation( diff --git a/sync/internal_api/sync_rollback_manager_base.h b/sync/internal_api/sync_rollback_manager_base.h index e18535f..9aaf02b 100644 --- a/sync/internal_api/sync_rollback_manager_base.h +++ b/sync/internal_api/sync_rollback_manager_base.h @@ -71,7 +71,7 @@ class SYNC_EXPORT_PRIVATE SyncRollbackManagerBase : const ModelSafeRoutingInfo& new_routing_info, const base::Closure& ready_task, const base::Closure& retry_task) OVERRIDE; - virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; + virtual void SetInvalidatorEnabled(bool invalidator_enabled) OVERRIDE; virtual void OnIncomingInvalidation( syncer::ModelType type, scoped_ptr<InvalidationInterface> invalidation) OVERRIDE; diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc index 5bb4f10..e01c64a 100644 --- a/sync/internal_api/test/fake_sync_manager.cc +++ b/sync/internal_api/test/fake_sync_manager.cc @@ -18,8 +18,6 @@ #include "sync/internal_api/public/http_post_provider_factory.h" #include "sync/internal_api/public/internal_components_factory.h" #include "sync/internal_api/public/util/weak_handle.h" -#include "sync/notifier/invalidator.h" -#include "sync/notifier/object_id_invalidation_map.h" #include "sync/syncable/directory.h" #include "sync/test/fake_sync_encryption_handler.h" @@ -272,7 +270,7 @@ ModelTypeSet FakeSyncManager::GetLastRefreshRequestTypes() { return last_refresh_request_types_; } -void FakeSyncManager::OnInvalidatorStateChange(InvalidatorState state) { +void FakeSyncManager::SetInvalidatorEnabled(bool invalidator_enabled) { // Do nothing. } |