Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: trunk/src/sync/internal_api/test/fake_sync_manager.cc

Issue 17610004: Revert 208315 "Make use of InvalidationService" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/sync/internal_api/test/fake_sync_manager.cc
===================================================================
--- trunk/src/sync/internal_api/test/fake_sync_manager.cc (revision 208346)
+++ trunk/src/sync/internal_api/test/fake_sync_manager.cc (working copy)
@@ -61,6 +61,25 @@
return reason;
}
+void FakeSyncManager::Invalidate(
+ const ObjectIdInvalidationMap& invalidation_map) {
+ if (!sync_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&FakeSyncManager::InvalidateOnSyncThread,
+ base::Unretained(this), invalidation_map))) {
+ NOTREACHED();
+ }
+}
+
+void FakeSyncManager::UpdateInvalidatorState(InvalidatorState state) {
+ if (!sync_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&FakeSyncManager::UpdateInvalidatorStateOnSyncThread,
+ base::Unretained(this), state))) {
+ NOTREACHED();
+ }
+}
+
void FakeSyncManager::WaitForSyncThread() {
// Post a task to |sync_task_runner_| and block until it runs.
base::RunLoop run_loop;
@@ -84,6 +103,7 @@
ExtensionsActivityMonitor* extensions_activity_monitor,
ChangeDelegate* change_delegate,
const SyncCredentials& credentials,
+ scoped_ptr<Invalidator> invalidator,
const std::string& invalidator_client_id,
const std::string& restored_key_for_bootstrapping,
const std::string& restored_keystore_key_for_bootstrapping,
@@ -141,6 +161,31 @@
NOTIMPLEMENTED();
}
+void FakeSyncManager::UpdateEnabledTypes(ModelTypeSet types) {
+ enabled_types_ = types;
+}
+
+void FakeSyncManager::RegisterInvalidationHandler(
+ InvalidationHandler* handler) {
+ registrar_.RegisterHandler(handler);
+}
+
+void FakeSyncManager::UpdateRegisteredInvalidationIds(
+ InvalidationHandler* handler,
+ const ObjectIdSet& ids) {
+ registrar_.UpdateRegisteredIds(handler, ids);
+}
+
+void FakeSyncManager::UnregisterInvalidationHandler(
+ InvalidationHandler* handler) {
+ registrar_.UnregisterHandler(handler);
+}
+
+void FakeSyncManager::AcknowledgeInvalidation(const invalidation::ObjectId& id,
+ const AckHandle& ack_handle) {
+ // Do nothing.
+}
+
void FakeSyncManager::StartSyncingNormally(
const ModelSafeRoutingInfo& routing_info) {
// Do nothing.
@@ -156,7 +201,7 @@
const base::Closure& ready_task,
const base::Closure& retry_task) {
last_configure_reason_ = reason;
- enabled_types_ = GetRoutingInfoTypes(new_routing_info);
+ ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info);
ModelTypeSet success_types = to_download;
success_types.RemoveAll(configure_fail_types_);
@@ -246,17 +291,20 @@
last_refresh_request_types_ = types;
}
-void FakeSyncManager::OnIncomingInvalidation(
- const ObjectIdInvalidationMap& invalidation_map) {
- // Do nothing.
+void FakeSyncManager::InvalidateOnSyncThread(
+ const ObjectIdInvalidationMap& invalidation_map) {
+ DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
+ registrar_.DispatchInvalidationsToHandlers(invalidation_map);
}
+void FakeSyncManager::UpdateInvalidatorStateOnSyncThread(
+ InvalidatorState state) {
+ DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
+ registrar_.UpdateInvalidatorState(state);
+}
+
ModelTypeSet FakeSyncManager::GetLastRefreshRequestTypes() {
return last_refresh_request_types_;
}
-void FakeSyncManager::OnInvalidatorStateChange(InvalidatorState state) {
- // Do nothing.
-}
-
} // namespace syncer
« no previous file with comments | « trunk/src/sync/internal_api/sync_manager_impl_unittest.cc ('k') | trunk/src/sync/notifier/fake_invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698