| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_ |
| 6 #define CHROME_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <assert.h> | 9 #include <assert.h> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 virtual void Init(); | 98 virtual void Init(); |
| 99 virtual void CleanUp(); | 99 virtual void CleanUp(); |
| 100 | 100 |
| 101 // Task which run in the child thread. | 101 // Task which run in the child thread. |
| 102 void DoWifiScanTask(); | 102 void DoWifiScanTask(); |
| 103 | 103 |
| 104 // Will schedule a scan; i.e. enqueue DoWifiScanTask deferred task. | 104 // Will schedule a scan; i.e. enqueue DoWifiScanTask deferred task. |
| 105 void ScheduleNextScan(int interval); | 105 void ScheduleNextScan(int interval); |
| 106 | 106 |
| 107 WifiData wifi_data_; | 107 WifiData wifi_data_; |
| 108 Lock data_mutex_; | 108 base::Lock data_mutex_; |
| 109 | 109 |
| 110 // Whether we've successfully completed a scan for WiFi data (or the polling | 110 // Whether we've successfully completed a scan for WiFi data (or the polling |
| 111 // thread has terminated early). | 111 // thread has terminated early). |
| 112 bool is_first_scan_complete_; | 112 bool is_first_scan_complete_; |
| 113 | 113 |
| 114 // Underlying OS wifi API. | 114 // Underlying OS wifi API. |
| 115 scoped_ptr<WlanApiInterface> wlan_api_; | 115 scoped_ptr<WlanApiInterface> wlan_api_; |
| 116 | 116 |
| 117 // Controls the polling update interval. | 117 // Controls the polling update interval. |
| 118 scoped_ptr<PollingPolicyInterface> polling_policy_; | 118 scoped_ptr<PollingPolicyInterface> polling_policy_; |
| 119 | 119 |
| 120 // Holder for the tasks which run on the thread; takes care of cleanup. | 120 // Holder for the tasks which run on the thread; takes care of cleanup. |
| 121 ScopedRunnableMethodFactory<WifiDataProviderCommon> task_factory_; | 121 ScopedRunnableMethodFactory<WifiDataProviderCommon> task_factory_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderCommon); | 123 DISALLOW_COPY_AND_ASSIGN(WifiDataProviderCommon); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_ | 126 #endif // CHROME_BROWSER_GEOLOCATION_WIFI_DATA_PROVIDER_COMMON_H_ |
| OLD | NEW |