OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ | 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ | 6 #define COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Flag to indicate if GCM is enabled. | 143 // Flag to indicate if GCM is enabled. |
144 // TODO(jianli): Removed when we switch completely to support all users. | 144 // TODO(jianli): Removed when we switch completely to support all users. |
145 bool gcm_enabled_; | 145 bool gcm_enabled_; |
146 | 146 |
147 // Flag to indicate the last known state of the GCM client. Because this | 147 // Flag to indicate the last known state of the GCM client. Because this |
148 // flag lives on the UI thread, while the GCM client lives on the IO thread, | 148 // flag lives on the UI thread, while the GCM client lives on the IO thread, |
149 // it may be out of date while connection changes are happening. | 149 // it may be out of date while connection changes are happening. |
150 bool connected_; | 150 bool connected_; |
151 | 151 |
152 // List of observers to notify when connection state changes. | 152 // List of observers to notify when connection state changes. |
153 // Makes sure list is empty on destruction. | 153 ObserverList<GCMConnectionObserver, false> connection_observer_list_; |
154 ObserverList<GCMConnectionObserver, true> connection_observer_list_; | |
155 | 154 |
156 // Account mapper. Only works when user is signed in. | 155 // Account mapper. Only works when user is signed in. |
157 scoped_ptr<GCMAccountMapper> account_mapper_; | 156 scoped_ptr<GCMAccountMapper> account_mapper_; |
158 | 157 |
159 // Time of last token fetching. | 158 // Time of last token fetching. |
160 base::Time last_token_fetch_time_; | 159 base::Time last_token_fetch_time_; |
161 | 160 |
162 scoped_refptr<base::SequencedTaskRunner> ui_thread_; | 161 scoped_refptr<base::SequencedTaskRunner> ui_thread_; |
163 scoped_refptr<base::SequencedTaskRunner> io_thread_; | 162 scoped_refptr<base::SequencedTaskRunner> io_thread_; |
164 | 163 |
165 scoped_ptr<GCMDelayedTaskController> delayed_task_controller_; | 164 scoped_ptr<GCMDelayedTaskController> delayed_task_controller_; |
166 | 165 |
167 // For all the work occurring on the IO thread. Must be destroyed on the IO | 166 // For all the work occurring on the IO thread. Must be destroyed on the IO |
168 // thread. | 167 // thread. |
169 scoped_ptr<IOWorker> io_worker_; | 168 scoped_ptr<IOWorker> io_worker_; |
170 | 169 |
171 // Callback for GetGCMStatistics. | 170 // Callback for GetGCMStatistics. |
172 GetGCMStatisticsCallback request_gcm_statistics_callback_; | 171 GetGCMStatisticsCallback request_gcm_statistics_callback_; |
173 | 172 |
174 // Used to pass a weak pointer to the IO worker. | 173 // Used to pass a weak pointer to the IO worker. |
175 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; | 174 base::WeakPtrFactory<GCMDriverDesktop> weak_ptr_factory_; |
176 | 175 |
177 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); | 176 DISALLOW_COPY_AND_ASSIGN(GCMDriverDesktop); |
178 }; | 177 }; |
179 | 178 |
180 } // namespace gcm | 179 } // namespace gcm |
181 | 180 |
182 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ | 181 #endif // COMPONENTS_GCM_DRIVER_GCM_DRIVER_DESKTOP_H_ |
OLD | NEW |