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_GATEWAY_DATA_PROVIDER_COMMON_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ |
6 #define CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // Thread implementation. | 77 // Thread implementation. |
78 virtual void Init(); | 78 virtual void Init(); |
79 virtual void CleanUp(); | 79 virtual void CleanUp(); |
80 | 80 |
81 // Task which run in the child thread. | 81 // Task which run in the child thread. |
82 void DoRouterScanTask(); | 82 void DoRouterScanTask(); |
83 // Will schedule a scan; i.e. enqueue DoRouterScanTask deferred task. | 83 // Will schedule a scan; i.e. enqueue DoRouterScanTask deferred task. |
84 void ScheduleNextScan(int interval); | 84 void ScheduleNextScan(int interval); |
85 | 85 |
86 Lock data_mutex_; | 86 base::Lock data_mutex_; |
87 // Whether we've successfully completed a scan for gateway data (or the | 87 // Whether we've successfully completed a scan for gateway data (or the |
88 // polling thread has terminated early). | 88 // polling thread has terminated early). |
89 bool is_first_scan_complete_; | 89 bool is_first_scan_complete_; |
90 // Underlying OS gateway API. | 90 // Underlying OS gateway API. |
91 scoped_ptr<GatewayApiInterface> gateway_api_; | 91 scoped_ptr<GatewayApiInterface> gateway_api_; |
92 GatewayData gateway_data_; | 92 GatewayData gateway_data_; |
93 // Controls the polling update interval. | 93 // Controls the polling update interval. |
94 scoped_ptr<GatewayPollingPolicyInterface> polling_policy_; | 94 scoped_ptr<GatewayPollingPolicyInterface> polling_policy_; |
95 // Holder for the tasks which run on the thread; takes care of cleanup. | 95 // Holder for the tasks which run on the thread; takes care of cleanup. |
96 ScopedRunnableMethodFactory<GatewayDataProviderCommon> task_factory_; | 96 ScopedRunnableMethodFactory<GatewayDataProviderCommon> task_factory_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(GatewayDataProviderCommon); | 98 DISALLOW_COPY_AND_ASSIGN(GatewayDataProviderCommon); |
99 }; | 99 }; |
100 | 100 |
101 #endif // CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ | 101 #endif // CHROME_BROWSER_GEOLOCATION_GATEWAY_DATA_PROVIDER_COMMON_H_ |
OLD | NEW |