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_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 size_t max_devices_; | 159 size_t max_devices_; |
160 | 160 |
161 // A map used to track known devices by their device_id. | 161 // A map used to track known devices by their device_id. |
162 DeviceByIdMap device_by_id_map_; | 162 DeviceByIdMap device_by_id_map_; |
163 | 163 |
164 // A map used to track known devices sorted by label. We iterate over this to | 164 // A map used to track known devices sorted by label. We iterate over this to |
165 // construct the device list sent to API clients. | 165 // construct the device list sent to API clients. |
166 DeviceByLabelMap device_by_label_map_; | 166 DeviceByLabelMap device_by_label_map_; |
167 | 167 |
168 // Timer used to manage periodic discovery requests. | 168 // Timer used to manage periodic discovery requests. |
169 base::RepeatingTimer<DialRegistry> repeating_timer_; | 169 base::RepeatingTimer repeating_timer_; |
170 | 170 |
171 // Interface from which the DIAL API is notified of DIAL device events. the | 171 // Interface from which the DIAL API is notified of DIAL device events. the |
172 // DIAL API owns this DIAL registry. | 172 // DIAL API owns this DIAL registry. |
173 Observer* const dial_api_; | 173 Observer* const dial_api_; |
174 | 174 |
175 // Thread checker. | 175 // Thread checker. |
176 base::ThreadChecker thread_checker_; | 176 base::ThreadChecker thread_checker_; |
177 | 177 |
178 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestAddRemoveListeners); | 178 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestAddRemoveListeners); |
179 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNoDevicesDiscovered); | 179 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNoDevicesDiscovered); |
180 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestDevicesDiscovered); | 180 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestDevicesDiscovered); |
181 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestDeviceExpires); | 181 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestDeviceExpires); |
182 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestExpiredDeviceIsRediscovered); | 182 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestExpiredDeviceIsRediscovered); |
183 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, | 183 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, |
184 TestRemovingListenerDoesNotClearList); | 184 TestRemovingListenerDoesNotClearList); |
185 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNetworkEventConnectionLost); | 185 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, TestNetworkEventConnectionLost); |
186 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, | 186 FRIEND_TEST_ALL_PREFIXES(DialRegistryTest, |
187 TestNetworkEventConnectionRestored); | 187 TestNetworkEventConnectionRestored); |
188 DISALLOW_COPY_AND_ASSIGN(DialRegistry); | 188 DISALLOW_COPY_AND_ASSIGN(DialRegistry); |
189 }; | 189 }; |
190 | 190 |
191 } // namespace extensions | 191 } // namespace extensions |
192 | 192 |
193 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ | 193 #endif // CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_REGISTRY_H_ |
OLD | NEW |