OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_INVALIDATION_INVALIDATION_LOGGER_H_ | 5 #ifndef COMPONENTS_INVALIDATION_INVALIDATION_LOGGER_H_ |
6 #define COMPONENTS_INVALIDATION_INVALIDATION_LOGGER_H_ | 6 #define COMPONENTS_INVALIDATION_INVALIDATION_LOGGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void OnDebugMessage(const base::DictionaryValue& details); | 53 void OnDebugMessage(const base::DictionaryValue& details); |
54 void OnInvalidation(const syncer::ObjectIdInvalidationMap& details); | 54 void OnInvalidation(const syncer::ObjectIdInvalidationMap& details); |
55 | 55 |
56 // Triggers messages to be sent to the Observers to provide them with | 56 // Triggers messages to be sent to the Observers to provide them with |
57 // the current state of the logging. | 57 // the current state of the logging. |
58 void EmitContent(); | 58 void EmitContent(); |
59 | 59 |
60 // Add and remove observers listening for messages. | 60 // Add and remove observers listening for messages. |
61 void RegisterObserver(InvalidationLoggerObserver* debug_observer); | 61 void RegisterObserver(InvalidationLoggerObserver* debug_observer); |
62 void UnregisterObserver(InvalidationLoggerObserver* debug_observer); | 62 void UnregisterObserver(InvalidationLoggerObserver* debug_observer); |
63 bool IsObserverRegistered(InvalidationLoggerObserver* debug_observer); | 63 bool IsObserverRegistered( |
| 64 const InvalidationLoggerObserver* debug_observer) const; |
64 | 65 |
65 private: | 66 private: |
66 // Send to every Observer a OnStateChange event with the latest state. | 67 // Send to every Observer a OnStateChange event with the latest state. |
67 void EmitState(); | 68 void EmitState(); |
68 | 69 |
69 // Send to every Observer many OnUpdateIds events, each with one registrar | 70 // Send to every Observer many OnUpdateIds events, each with one registrar |
70 // and every objectId it currently has registered. | 71 // and every objectId it currently has registered. |
71 void EmitUpdatedIds(); | 72 void EmitUpdatedIds(); |
72 | 73 |
73 // Send to every Observer a vector with the all the current registered | 74 // Send to every Observer a vector with the all the current registered |
(...skipping 18 matching lines...) Expand all Loading... |
92 // necessarily the same as the keys of latest_ids_, because they might | 93 // necessarily the same as the keys of latest_ids_, because they might |
93 // have not registered any object id). | 94 // have not registered any object id). |
94 std::multiset<std::string> registered_handlers_; | 95 std::multiset<std::string> registered_handlers_; |
95 | 96 |
96 DISALLOW_COPY_AND_ASSIGN(InvalidationLogger); | 97 DISALLOW_COPY_AND_ASSIGN(InvalidationLogger); |
97 }; | 98 }; |
98 | 99 |
99 } // namespace invalidation | 100 } // namespace invalidation |
100 | 101 |
101 #endif // COMPONENTS_INVALIDATION_INVALIDATION_LOGGER_H_ | 102 #endif // COMPONENTS_INVALIDATION_INVALIDATION_LOGGER_H_ |
OLD | NEW |