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

Side by Side Diff: sync/notifier/invalidator_registrar.h

Issue 11515009: [sync] Componentize sync: Part 2: Add SYNC_EXPORTs to files in src/sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR Feedback Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/notifier/invalidator_factory.h ('k') | sync/notifier/invalidator_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 SYNC_NOTIFIER_INVALIDATOR_REGISTRAR_H_ 5 #ifndef SYNC_NOTIFIER_INVALIDATOR_REGISTRAR_H_
6 #define SYNC_NOTIFIER_INVALIDATOR_REGISTRAR_H_ 6 #define SYNC_NOTIFIER_INVALIDATOR_REGISTRAR_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "sync/base/sync_export.h"
13 #include "sync/notifier/invalidation_handler.h" 14 #include "sync/notifier/invalidation_handler.h"
14 #include "sync/notifier/invalidation_util.h" 15 #include "sync/notifier/invalidation_util.h"
15 #include "sync/notifier/object_id_invalidation_map.h" 16 #include "sync/notifier/object_id_invalidation_map.h"
16 17
17 namespace invalidation { 18 namespace invalidation {
18 class ObjectId; 19 class ObjectId;
19 } // namespace invalidation 20 } // namespace invalidation
20 21
21 namespace syncer { 22 namespace syncer {
22 23
23 // A helper class for implementations of the Invalidator interface. It helps 24 // A helper class for implementations of the Invalidator interface. It helps
24 // keep track of registered handlers and which object ID registrations are 25 // keep track of registered handlers and which object ID registrations are
25 // associated with which handlers, so implementors can just reuse the logic 26 // associated with which handlers, so implementors can just reuse the logic
26 // here to dispatch invalidations and other interesting notifications. 27 // here to dispatch invalidations and other interesting notifications.
27 class InvalidatorRegistrar { 28 class SYNC_EXPORT InvalidatorRegistrar {
28 public: 29 public:
29 InvalidatorRegistrar(); 30 InvalidatorRegistrar();
30 31
31 // It is an error to have registered handlers on destruction. 32 // It is an error to have registered handlers on destruction.
32 ~InvalidatorRegistrar(); 33 ~InvalidatorRegistrar();
33 34
34 // Starts sending notifications to |handler|. |handler| must not be NULL, 35 // Starts sending notifications to |handler|. |handler| must not be NULL,
35 // and it must already be registered. 36 // and it must already be registered.
36 void RegisterHandler(InvalidationHandler* handler); 37 void RegisterHandler(InvalidationHandler* handler);
37 38
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 ObserverList<InvalidationHandler> handlers_; 87 ObserverList<InvalidationHandler> handlers_;
87 IdHandlerMap id_to_handler_map_; 88 IdHandlerMap id_to_handler_map_;
88 InvalidatorState state_; 89 InvalidatorState state_;
89 90
90 DISALLOW_COPY_AND_ASSIGN(InvalidatorRegistrar); 91 DISALLOW_COPY_AND_ASSIGN(InvalidatorRegistrar);
91 }; 92 };
92 93
93 } // namespace syncer 94 } // namespace syncer
94 95
95 #endif // SYNC_NOTIFIER_INVALIDATOR_REGISTRAR_H_ 96 #endif // SYNC_NOTIFIER_INVALIDATOR_REGISTRAR_H_
OLDNEW
« no previous file with comments | « sync/notifier/invalidator_factory.h ('k') | sync/notifier/invalidator_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698