OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_ |
6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_ | 6 #define CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_ |
7 | 7 |
8 #include "sync/notifier/invalidation_util.h" | 8 #include "sync/notifier/invalidation_util.h" |
9 #include "sync/notifier/invalidator_state.h" | 9 #include "sync/notifier/invalidator_state.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 // do the following when starting the client: | 38 // do the following when starting the client: |
39 // | 39 // |
40 // invalidator_state = frontend->GetInvalidatorState(); | 40 // invalidator_state = frontend->GetInvalidatorState(); |
41 // | 41 // |
42 // It can also do the above in OnInvalidatorStateChange(), or it can use the | 42 // It can also do the above in OnInvalidatorStateChange(), or it can use the |
43 // argument to OnInvalidatorStateChange(). | 43 // argument to OnInvalidatorStateChange(). |
44 // | 44 // |
45 // It is an error to have registered handlers when an InvalidationFrontend is | 45 // It is an error to have registered handlers when an InvalidationFrontend is |
46 // shut down; clients must ensure that they unregister themselves before then. | 46 // shut down; clients must ensure that they unregister themselves before then. |
47 // | 47 // |
48 // TODO(rlarocque): This class should extend ProfileKeyedService. | 48 // TODO(rlarocque): This class should extend BrowserContextKeyedService. |
49 // | 49 // |
50 // NOTE(akalin): Invalidations that come in during browser shutdown may get | 50 // NOTE(akalin): Invalidations that come in during browser shutdown may get |
51 // dropped. This won't matter once we have an Acknowledge API, though: see | 51 // dropped. This won't matter once we have an Acknowledge API, though: see |
52 // http://crbug.com/78462 and http://crbug.com/124149. | 52 // http://crbug.com/78462 and http://crbug.com/124149. |
53 class InvalidationFrontend { | 53 class InvalidationFrontend { |
54 public: | 54 public: |
55 // Starts sending notifications to |handler|. |handler| must not be NULL, | 55 // Starts sending notifications to |handler|. |handler| must not be NULL, |
56 // and it must not already be registered. | 56 // and it must not already be registered. |
57 // | 57 // |
58 // Handler registrations are persisted across restarts of sync. | 58 // Handler registrations are persisted across restarts of sync. |
(...skipping 27 matching lines...) Expand all Loading... |
86 // the updated state. | 86 // the updated state. |
87 virtual syncer::InvalidatorState GetInvalidatorState() const = 0; | 87 virtual syncer::InvalidatorState GetInvalidatorState() const = 0; |
88 | 88 |
89 protected: | 89 protected: |
90 virtual ~InvalidationFrontend() { } | 90 virtual ~InvalidationFrontend() { } |
91 }; | 91 }; |
92 | 92 |
93 } // namespace invalidation | 93 } // namespace invalidation |
94 | 94 |
95 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_ | 95 #endif // CHROME_BROWSER_INVALIDATION_INVALIDATION_FRONTEND_H_ |
OLD | NEW |