OLD | NEW |
1 // Copyright 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 COMPONENTS_SYNC_ENGINE_IMPL_DEBUG_INFO_EVENT_LISTENER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_DEBUG_INFO_EVENT_LISTENER_H_ |
6 #define COMPONENTS_SYNC_ENGINE_IMPL_DEBUG_INFO_EVENT_LISTENER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_DEBUG_INFO_EVENT_LISTENER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 private: | 88 private: |
89 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyEventsAdded); | 89 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyEventsAdded); |
90 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyQueueSize); | 90 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyQueueSize); |
91 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyGetEvents); | 91 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyGetEvents); |
92 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyClearEvents); | 92 FRIEND_TEST_ALL_PREFIXES(DebugInfoEventListenerTest, VerifyClearEvents); |
93 | 93 |
94 void AddEventToQueue(const sync_pb::DebugEventInfo& event_info); | 94 void AddEventToQueue(const sync_pb::DebugEventInfo& event_info); |
95 void CreateAndAddEvent(sync_pb::SyncEnums::SingletonDebugEventType type); | 95 void CreateAndAddEvent(sync_pb::SyncEnums::SingletonDebugEventType type); |
96 | 96 |
97 typedef std::deque<sync_pb::DebugEventInfo> DebugEventInfoQueue; | 97 using DebugEventInfoQueue = std::deque<sync_pb::DebugEventInfo>; |
98 DebugEventInfoQueue events_; | 98 DebugEventInfoQueue events_; |
99 | 99 |
100 // True indicates we had to drop one or more events to keep our limit of | 100 // True indicates we had to drop one or more events to keep our limit of |
101 // |kMaxEntries|. | 101 // |kMaxEntries|. |
102 bool events_dropped_; | 102 bool events_dropped_; |
103 | 103 |
104 // Cryptographer has keys that are not yet decrypted. | 104 // Cryptographer has keys that are not yet decrypted. |
105 bool cryptographer_has_pending_keys_; | 105 bool cryptographer_has_pending_keys_; |
106 | 106 |
107 // Cryptographer is initialized and does not have pending keys. | 107 // Cryptographer is initialized and does not have pending keys. |
108 bool cryptographer_ready_; | 108 bool cryptographer_ready_; |
109 | 109 |
110 base::ThreadChecker thread_checker_; | 110 base::ThreadChecker thread_checker_; |
111 | 111 |
112 base::WeakPtrFactory<DebugInfoEventListener> weak_ptr_factory_; | 112 base::WeakPtrFactory<DebugInfoEventListener> weak_ptr_factory_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(DebugInfoEventListener); | 114 DISALLOW_COPY_AND_ASSIGN(DebugInfoEventListener); |
115 }; | 115 }; |
116 | 116 |
117 } // namespace syncer | 117 } // namespace syncer |
118 | 118 |
119 #endif // COMPONENTS_SYNC_ENGINE_IMPL_DEBUG_INFO_EVENT_LISTENER_H_ | 119 #endif // COMPONENTS_SYNC_ENGINE_IMPL_DEBUG_INFO_EVENT_LISTENER_H_ |
OLD | NEW |