OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROMEOS_COMPONENTS_TETHER_HOST_SCAN_CACHE_H_ | 5 #ifndef CHROMEOS_COMPONENTS_TETHER_HOST_SCAN_CACHE_H_ |
6 #define CHROMEOS_COMPONENTS_TETHER_HOST_SCAN_CACHE_H_ | 6 #define CHROMEOS_COMPONENTS_TETHER_HOST_SCAN_CACHE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // Removes all scan results from the cache unless they correspond to the | 71 // Removes all scan results from the cache unless they correspond to the |
72 // active host; the active host must always remain in the cache while | 72 // active host; the active host must always remain in the cache while |
73 // connecting/connected to ensure the UI is up to date. | 73 // connecting/connected to ensure the UI is up to date. |
74 virtual void ClearCacheExceptForActiveHost(); | 74 virtual void ClearCacheExceptForActiveHost(); |
75 | 75 |
76 // TetherHostResponseRecorder::Observer: | 76 // TetherHostResponseRecorder::Observer: |
77 void OnPreviouslyConnectedHostIdsChanged() override; | 77 void OnPreviouslyConnectedHostIdsChanged() override; |
78 | 78 |
79 class TimerFactory { | 79 class TimerFactory { |
80 public: | 80 public: |
81 virtual std::unique_ptr<base::Timer> CreateOneShotTimer(); | 81 virtual std::unique_ptr<base::Timer> CreateOneShotTimer() = 0; |
82 }; | 82 }; |
83 | 83 |
84 private: | 84 private: |
85 friend class HostScanCacheTest; | 85 friend class HostScanCacheTest; |
86 | 86 |
87 void SetTimerFactoryForTest( | 87 void SetTimerFactoryForTest( |
88 std::unique_ptr<TimerFactory> timer_factory_for_test); | 88 std::unique_ptr<TimerFactory> timer_factory_for_test); |
89 | 89 |
90 bool HasConnectedToHost(const std::string& tether_network_guid); | 90 bool HasConnectedToHost(const std::string& tether_network_guid); |
91 void StartTimer(const std::string& tether_network_guid); | 91 void StartTimer(const std::string& tether_network_guid); |
(...skipping 14 matching lines...) Expand all Loading... |
106 base::WeakPtrFactory<HostScanCache> weak_ptr_factory_; | 106 base::WeakPtrFactory<HostScanCache> weak_ptr_factory_; |
107 | 107 |
108 DISALLOW_COPY_AND_ASSIGN(HostScanCache); | 108 DISALLOW_COPY_AND_ASSIGN(HostScanCache); |
109 }; | 109 }; |
110 | 110 |
111 } // namespace tether | 111 } // namespace tether |
112 | 112 |
113 } // namespace chromeos | 113 } // namespace chromeos |
114 | 114 |
115 #endif // CHROMEOS_COMPONENTS_TETHER_HOST_SCAN_CACHE_H_ | 115 #endif // CHROMEOS_COMPONENTS_TETHER_HOST_SCAN_CACHE_H_ |
OLD | NEW |