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

Unified Diff: chrome/browser/sync/profile_sync_service.h

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: chrome/browser/sync/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index f09adfc6c03596765947747dc338364700a0d90f..20750f73c5708252cd3f337b6630248e1206f30a 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -20,8 +20,6 @@
#include "base/string16.h"
#include "base/time.h"
#include "base/timer.h"
-#include "chrome/browser/invalidation/invalidation_frontend.h"
-#include "chrome/browser/invalidation/invalidator_storage.h"
#include "chrome/browser/signin/signin_global_error.h"
#include "chrome/browser/sync/backend_unrecoverable_error_handler.h"
#include "chrome/browser/sync/failed_datatypes_handler.h"
@@ -63,7 +61,6 @@ namespace sessions { class SyncSessionSnapshot; }
namespace syncer {
class BaseTransaction;
-class InvalidatorRegistrar;
struct SyncCredentials;
struct UserShare;
}
@@ -161,8 +158,7 @@ class ProfileSyncService : public ProfileSyncServiceBase,
public SigninGlobalError::AuthStatusProvider,
public syncer::UnrecoverableErrorHandler,
public content::NotificationObserver,
- public ProfileKeyedService,
- public invalidation::InvalidationFrontend {
+ public ProfileKeyedService {
public:
typedef browser_sync::SyncBackendHost::Status Status;
@@ -283,12 +279,6 @@ class ProfileSyncService : public ProfileSyncServiceBase,
// Disables sync for user. Use ShowLoginDialog to enable.
virtual void DisableForUser();
- // syncer::InvalidationHandler implementation (via SyncFrontend).
- virtual void OnInvalidatorStateChange(
- syncer::InvalidatorState state) OVERRIDE;
- virtual void OnIncomingInvalidation(
- const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE;
-
// SyncFrontend implementation.
virtual void OnBackendInitialized(
const syncer::WeakHandle<syncer::JsBackend>& js_backend,
@@ -602,30 +592,10 @@ class ProfileSyncService : public ProfileSyncServiceBase,
// The set of currently enabled sync experiments.
const syncer::Experiments& current_experiments() const;
- // InvalidationFrontend implementation. It is an error to have
- // registered handlers when Shutdown() is called.
- virtual void RegisterInvalidationHandler(
- syncer::InvalidationHandler* handler) OVERRIDE;
- virtual void UpdateRegisteredInvalidationIds(
- syncer::InvalidationHandler* handler,
- const syncer::ObjectIdSet& ids) OVERRIDE;
- virtual void UnregisterInvalidationHandler(
- syncer::InvalidationHandler* handler) OVERRIDE;
- virtual void AcknowledgeInvalidation(
- const invalidation::ObjectId& id,
- const syncer::AckHandle& ack_handle) OVERRIDE;
-
- virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE;
-
// ProfileKeyedService implementation. This must be called exactly
// once (before this object is destroyed).
virtual void Shutdown() OVERRIDE;
- // Simulate an incoming notification for the given id and payload.
- void EmitInvalidationForTest(
- const invalidation::ObjectId& id,
- const std::string& payload);
-
// Called when a datatype (SyncableService) has a need for sync to start
// ASAP, presumably because a local change event has occurred but we're
// still in deferred start mode, meaning the SyncableService hasn't been
@@ -696,8 +666,6 @@ class ProfileSyncService : public ProfileSyncServiceBase,
ERROR_REASON_ACTIONABLE_ERROR,
ERROR_REASON_LIMIT
};
- typedef std::vector<std::pair<invalidation::ObjectId,
- syncer::AckHandle> > AckHandleReplayQueue;
friend class ProfileSyncServicePasswordTest;
friend class SyncTest;
friend class TestProfileSyncService;
@@ -738,6 +706,7 @@ class ProfileSyncService : public ProfileSyncServiceBase,
void UpdateLastSyncedTime();
void NotifyObservers();
+ void NotifySyncCycleCompleted();
void ClearStaleErrors();
@@ -792,11 +761,6 @@ class ProfileSyncService : public ProfileSyncServiceBase,
bool delete_sync_database,
UnrecoverableErrorReason reason);
- // Must be called every time |backend_initialized_| or
- // |invalidator_state_| is changed (but only if
- // |invalidator_registrar_| is not NULL).
- void UpdateInvalidatorRegistrarState();
-
// Returns the username (in form of an email address) that should be used in
// the credentials.
std::string GetEffectiveUsername();
@@ -811,9 +775,6 @@ class ProfileSyncService : public ProfileSyncServiceBase,
// preferences.
browser_sync::SyncPrefs sync_prefs_;
- // TODO(tim): Move this to InvalidationService, once it exists. Bug 124137.
- invalidation::InvalidatorStorage invalidator_storage_;
-
// TODO(ncarter): Put this in a profile, once there is UI for it.
// This specifies where to find the sync server.
GURL sync_service_url_;
@@ -928,18 +889,6 @@ class ProfileSyncService : public ProfileSyncServiceBase,
// Factory the backend will use to build the SyncManager.
syncer::SyncManagerFactory sync_manager_factory_;
- // Holds the current invalidator state as updated by
- // OnInvalidatorStateChange(). Note that this is different from the
- // state known by |invalidator_registrar_| (See
- // UpdateInvalidatorState()).
- syncer::InvalidatorState invalidator_state_;
-
- // Dispatches invalidations to handlers. Set in Initialize() and
- // unset in Shutdown().
- scoped_ptr<syncer::InvalidatorRegistrar> invalidator_registrar_;
- // Queues any acknowledgements received while the backend is uninitialized.
- AckHandleReplayQueue ack_replay_queue_;
-
// Sync's internal debug info listener. Used to record datatype configuration
// and association information.
syncer::WeakHandle<syncer::DataTypeDebugInfoListener> debug_info_listener_;

Powered by Google App Engine
This is Rietveld 408576698