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

Unified Diff: sync/internal_api/public/sync_manager.h

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More review fixes Created 7 years, 7 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: sync/internal_api/public/sync_manager.h
diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h
index d754bf01a35a72bef55b82eeeff573c07c98054e..767484620f906564128f812c59915ec51b3019de 100644
--- a/sync/internal_api/public/sync_manager.h
+++ b/sync/internal_api/public/sync_manager.h
@@ -23,7 +23,7 @@
#include "sync/internal_api/public/sync_encryption_handler.h"
#include "sync/internal_api/public/util/report_unrecoverable_error_function.h"
#include "sync/internal_api/public/util/weak_handle.h"
-#include "sync/notifier/invalidation_util.h"
+#include "sync/notifier/invalidation_handler.h"
#include "sync/protocol/sync_protocol_error.h"
namespace sync_pb {
@@ -39,8 +39,6 @@ struct Experiments;
class ExtensionsActivityMonitor;
class HttpPostProviderFactory;
class InternalComponentsFactory;
-class InvalidationHandler;
-class Invalidator;
class JsBackend;
class JsEventHandler;
class SyncEncryptionHandler;
@@ -77,7 +75,7 @@ struct SyncCredentials {
//
// Unless stated otherwise, all methods of SyncManager should be called on the
// same thread.
-class SYNC_EXPORT SyncManager {
+class SYNC_EXPORT SyncManager : public syncer::InvalidationHandler {
public:
// An interface the embedding application implements to be notified
// on change events. Note that these methods may be called on *any*
@@ -317,7 +315,6 @@ class SYNC_EXPORT SyncManager {
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,
@@ -345,27 +342,6 @@ class SYNC_EXPORT SyncManager {
// Update tokens that we're using in Sync. Email must stay the same.
virtual void UpdateCredentials(const SyncCredentials& credentials) = 0;
- // Called when the user disables or enables a sync type.
- virtual void UpdateEnabledTypes(ModelTypeSet enabled_types) = 0;
-
- // Forwards to the underlying invalidator (see comments in invalidator.h).
- virtual void RegisterInvalidationHandler(
- InvalidationHandler* handler) = 0;
-
- // Forwards to the underlying notifier (see comments in invalidator.h).
- virtual void UpdateRegisteredInvalidationIds(
- InvalidationHandler* handler,
- const ObjectIdSet& ids) = 0;
-
- // Forwards to the underlying notifier (see comments in invalidator.h).
- virtual void UnregisterInvalidationHandler(
- InvalidationHandler* handler) = 0;
-
- // Forwards to the underlying notifier (see comments in invalidator.h).
- virtual void AcknowledgeInvalidation(
- const invalidation::ObjectId& id,
- const syncer::AckHandle& ack_handle) = 0;
-
// Put the syncer in normal mode ready to perform nudges and polls.
virtual void StartSyncingNormally(
const ModelSafeRoutingInfo& routing_info) = 0;
@@ -389,6 +365,13 @@ class SYNC_EXPORT SyncManager {
const base::Closure& ready_task,
const base::Closure& retry_task) = 0;
+ // Inform the syncer of a change in the invalidator's state.
+ virtual void OnInvalidatorStateChange(InvalidatorState state) = 0;
+
+ // Inform the syncer that its cached information about a type is obsolete.
+ virtual void OnIncomingInvalidation(
+ const ObjectIdInvalidationMap& invalidation_map) = 0;
+
// Adds a listener to be notified of sync events.
// NOTE: It is OK (in fact, it's probably a good idea) to call this before
// having received OnInitializationCompleted.

Powered by Google App Engine
This is Rietveld 408576698