Chromium Code Reviews| Index: chrome/browser/sync/invalidation_service.h |
| diff --git a/chrome/browser/sync/invalidation_service.h b/chrome/browser/sync/invalidation_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9e03f748586eaa06e7c89fab8e6e0ddfeb5a59ff |
| --- /dev/null |
| +++ b/chrome/browser/sync/invalidation_service.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_SYNC_INVALIDATION_SERVICE_H_ |
| +#define CHROME_BROWSER_SYNC_INVALIDATION_SERVICE_H_ |
| + |
| +#include "sync/notifier/invalidation_util.h" |
| + |
| +namespace syncer { |
| +class SyncNotifierObserver; |
| +} // namespace syncer |
| + |
| +// Interface for clients that want to register to receive invalidation notices |
| +// for object IDs. |
| +class InvalidationService { |
|
akalin
2012/08/20 20:35:01
Okay, how about the name InvalidationFrontend? Su
dcheng
2012/08/20 20:58:21
Done.
|
| + public: |
| + virtual ~InvalidationService() { } |
|
akalin
2012/08/20 20:35:01
make destructor protected
dcheng
2012/08/20 20:58:21
Done.
|
| + // Starts sending notifications to |handler|. |handler| must not be NULL, |
| + // and it must already be registered. |
|
akalin
2012/08/20 20:35:01
may as well fix the comment in this patch
dcheng
2012/08/20 20:58:21
Done.
|
| + // |
| + // Handler registrations are persisted across restarts of sync. |
| + virtual void RegisterInvalidationHandler( |
| + syncer::SyncNotifierObserver* handler) = 0; |
| + |
| + // Updates the set of ObjectIds associated with |handler|. |handler| must |
| + // not be NULL, and must already be registered. An ID must be registered for |
| + // at most one handler. |
| + // |
| + // Registered IDs are persisted across restarts of sync. |
| + virtual void UpdateRegisteredInvalidationIds( |
| + syncer::SyncNotifierObserver* handler, |
| + const syncer::ObjectIdSet& ids) = 0; |
| + |
| + // Stops sending notifications to |handler|. |handler| must not be NULL, and |
| + // it must already be registered. Note that this doesn't unregister the IDs |
| + // associated with |handler|. |
| + // |
| + // Handler registrations are persisted across restarts of sync. |
| + virtual void UnregisterInvalidationHandler( |
| + syncer::SyncNotifierObserver* handler) = 0; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_SYNC_INVALIDATION_SERVICE_H_ |