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

Unified Diff: chrome/browser/invalidation/invalidation_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/invalidation/invalidation_service.h
diff --git a/chrome/browser/invalidation/invalidation_frontend.h b/chrome/browser/invalidation/invalidation_service.h
similarity index 81%
rename from chrome/browser/invalidation/invalidation_frontend.h
rename to chrome/browser/invalidation/invalidation_service.h
index 8344e271e13d8cbaeddc4a3c05453a328ddc1db7..e50732a46e5cf9bf3a2b5fe059e121b5d9bd89e1 100644
--- a/chrome/browser/invalidation/invalidation_frontend.h
+++ b/chrome/browser/invalidation/invalidation_service.h
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_
-#define CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_
+#ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_
+#define CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_
+#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "sync/notifier/invalidation_util.h"
#include "sync/notifier/invalidator_state.h"
@@ -42,15 +43,17 @@ namespace invalidation {
// It can also do the above in OnInvalidatorStateChange(), or it can use the
// argument to OnInvalidatorStateChange().
//
-// It is an error to have registered handlers when an InvalidationFrontend is
+// It is an error to have registered handlers when an InvalidationService is
// shut down; clients must ensure that they unregister themselves before then.
//
-// TODO(rlarocque): This class should extend ProfileKeyedService.
-//
// NOTE(akalin): Invalidations that come in during browser shutdown may get
// dropped. This won't matter once we have an Acknowledge API, though: see
// http://crbug.com/78462 and http://crbug.com/124149.
-class InvalidationFrontend {
+//
+// This class inherits from ProfileKeyedService to make it possible to correctly
+// cast from various InvalidationService implementations to ProfileKeyedService
+// in InvalidationServiceFactory.
+class InvalidationService : public ProfileKeyedService {
public:
// Starts sending notifications to |handler|. |handler| must not be NULL,
// and it must not already be registered.
@@ -86,10 +89,14 @@ class InvalidationFrontend {
// the updated state.
virtual syncer::InvalidatorState GetInvalidatorState() const = 0;
+ // Returns the ID belonging to this invalidation client. Can be used to
+ // prevent the receipt of notifications of our own changes.
+ virtual std::string GetInvalidatorClientId() const = 0;
+
protected:
- virtual ~InvalidationFrontend() { }
+ virtual ~InvalidationService() { }
};
} // namespace invalidation
-#endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_
+#endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698