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_CHROMEOS_GDATA_GDATA_SYNC_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYNC_CLIENT_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYNC_CLIENT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYNC_CLIENT_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // thread. Note that this class does not use a lock to protect |queue_| as | 189 // thread. Note that this class does not use a lock to protect |queue_| as |
190 // all methods touching |queue_| run on the UI thread. | 190 // all methods touching |queue_| run on the UI thread. |
191 std::deque<SyncTask> queue_; | 191 std::deque<SyncTask> queue_; |
192 | 192 |
193 // The delay is used for delaying processing SyncTasks in DoSyncLoop(). | 193 // The delay is used for delaying processing SyncTasks in DoSyncLoop(). |
194 base::TimeDelta delay_; | 194 base::TimeDelta delay_; |
195 | 195 |
196 // True if the sync loop is running. | 196 // True if the sync loop is running. |
197 bool sync_loop_is_running_; | 197 bool sync_loop_is_running_; |
198 | 198 |
| 199 // Note: This should remain the last member so it'll be destroyed and |
| 200 // invalidate its weak pointers before any other members are destroyed. |
199 base::WeakPtrFactory<GDataSyncClient> weak_ptr_factory_; | 201 base::WeakPtrFactory<GDataSyncClient> weak_ptr_factory_; |
200 | 202 |
201 DISALLOW_COPY_AND_ASSIGN(GDataSyncClient); | 203 DISALLOW_COPY_AND_ASSIGN(GDataSyncClient); |
202 }; | 204 }; |
203 | 205 |
204 } // namespace gdata | 206 } // namespace gdata |
205 | 207 |
206 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYNC_CLIENT_H_ | 208 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYNC_CLIENT_H_ |
OLD | NEW |