Index: chrome/browser/sync/glue/sync_backend_host.h |
diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h |
index f32709e1cfa6647cc1f4e54d3da20d38d171ef09..38696843dc38a1ea75cdbecd0c09901d37e0278e 100644 |
--- a/chrome/browser/sync/glue/sync_backend_host.h |
+++ b/chrome/browser/sync/glue/sync_backend_host.h |
@@ -16,6 +16,7 @@ |
#include "base/threading/thread.h" |
#include "chrome/browser/sync/glue/backend_data_type_configurer.h" |
#include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h" |
+#include "chrome/browser/sync/invalidation_frontend.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
#include "google_apis/gaia/google_service_auth_error.h" |
@@ -30,7 +31,6 @@ |
#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/notifier/invalidator_factory.h" |
#include "sync/protocol/encryption.pb.h" |
#include "sync/protocol/sync_protocol_error.h" |
@@ -46,7 +46,6 @@ class SyncManagerFactory; |
namespace browser_sync { |
-class AndroidInvalidatorBridge; |
class ChangeProcessor; |
class InvalidatorStorage; |
class SyncBackendRegistrar; |
@@ -59,7 +58,7 @@ struct Experiments; |
// activity. |
// NOTE: All methods will be invoked by a SyncBackendHost on the same thread |
// used to create that SyncBackendHost. |
-class SyncFrontend : public syncer::InvalidationHandler { |
+class SyncFrontend { |
public: |
SyncFrontend() {} |
@@ -150,7 +149,8 @@ class SyncFrontend : public syncer::InvalidationHandler { |
// that the SyncFrontend is only accessed on the UI loop. |
class SyncBackendHost |
: public BackendDataTypeConfigurer, |
- public content::NotificationObserver { |
+ public content::NotificationObserver, |
+ public syncer::InvalidationHandler { |
public: |
typedef syncer::SyncStatus Status; |
@@ -161,9 +161,7 @@ class SyncBackendHost |
SyncBackendHost( |
const std::string& name, |
Profile* profile, |
- const base::WeakPtr<SyncPrefs>& sync_prefs, |
- // TODO(tim): Temporary, remove when bug 124137 finished. |
- const base::WeakPtr<InvalidatorStorage>& invalidator_storage); |
+ const base::WeakPtr<SyncPrefs>& sync_prefs); |
// For testing. |
// TODO(skrul): Extract an interface so this is not needed. |
@@ -190,14 +188,6 @@ class SyncBackendHost |
// Called on |frontend_loop| to update SyncCredentials. |
virtual void UpdateCredentials(const syncer::SyncCredentials& credentials); |
- // Registers the underlying frontend for the given IDs to the underlying |
- // notifier. This lasts until StopSyncingForShutdown() is called. |
- void UpdateRegisteredInvalidationIds(const syncer::ObjectIdSet& ids); |
- |
- // Forwards an invalidation acknowledgement to the underlying notifier. |
- void AcknowledgeInvalidation(const invalidation::ObjectId& id, |
- const syncer::AckHandle& ack_handle); |
- |
// This starts the SyncerThread running a Syncer object to communicate with |
// sync servers. Until this is called, no changes will leave or enter this |
// browser from the cloud / sync servers. |
@@ -319,8 +309,7 @@ class SyncBackendHost |
const GURL& service_url, |
MakeHttpBridgeFactoryFn make_http_bridge_factory_fn, |
const syncer::SyncCredentials& credentials, |
- AndroidInvalidatorBridge* android_invalidator_bridge, |
- syncer::InvalidatorFactory* invalidator_factory, |
+ const std::string& invalidator_client_id, |
syncer::SyncManagerFactory* sync_manager_factory, |
bool delete_sync_data_folder, |
const std::string& restored_key_for_bootstrapping, |
@@ -341,8 +330,7 @@ class SyncBackendHost |
// Overridden by tests. |
MakeHttpBridgeFactoryFn make_http_bridge_factory_fn; |
syncer::SyncCredentials credentials; |
- AndroidInvalidatorBridge* const android_invalidator_bridge; |
- syncer::InvalidatorFactory* const invalidator_factory; |
+ const std::string invalidator_client_id; |
syncer::SyncManagerFactory* const sync_manager_factory; |
std::string lsid; |
bool delete_sync_data_folder; |
@@ -369,6 +357,7 @@ class SyncBackendHost |
// Called when the syncer has finished performing a configuration. |
void FinishConfigureDataTypesOnFrontendLoop( |
+ const syncer::ModelTypeSet enabled_types, |
const syncer::ModelTypeSet failed_configuration_types, |
const base::Callback<void(syncer::ModelTypeSet)>& ready_task); |
@@ -499,6 +488,12 @@ class SyncBackendHost |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
+ // InvalidationHandler implementation. |
+ virtual void OnInvalidatorStateChange( |
+ syncer::InvalidatorState state) OVERRIDE; |
+ virtual void OnIncomingInvalidation( |
+ const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE; |
+ |
// Handles stopping the core's SyncManager, accounting for whether |
// initialization is done yet. |
void StopSyncManagerForShutdown(const base::Closure& closure); |
@@ -526,10 +521,6 @@ class SyncBackendHost |
const base::WeakPtr<SyncPrefs> sync_prefs_; |
- scoped_ptr<AndroidInvalidatorBridge> android_invalidator_bridge_; |
- |
- syncer::InvalidatorFactory invalidator_factory_; |
- |
ChromeExtensionsActivityMonitor extensions_activity_monitor_; |
scoped_ptr<SyncBackendRegistrar> registrar_; |
@@ -567,6 +558,8 @@ class SyncBackendHost |
syncer::WeakHandle<syncer::JsBackend> js_backend_; |
syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_; |
+ InvalidationFrontend* invalidator_; |
+ |
DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); |
}; |