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 COMPONENTS_DRIVE_SYNC_CLIENT_H_ | 5 #ifndef COMPONENTS_DRIVE_SYNC_CLIENT_H_ |
6 #define COMPONENTS_DRIVE_SYNC_CLIENT_H_ | 6 #define COMPONENTS_DRIVE_SYNC_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 enum SyncState { | 100 enum SyncState { |
101 SUSPENDED, // Task is currently inactive. | 101 SUSPENDED, // Task is currently inactive. |
102 PENDING, // Task is going to run. | 102 PENDING, // Task is going to run. |
103 RUNNING, // Task is running. | 103 RUNNING, // Task is running. |
104 }; | 104 }; |
105 | 105 |
106 typedef std::pair<SyncType, std::string> SyncTaskKey; | 106 typedef std::pair<SyncType, std::string> SyncTaskKey; |
107 | 107 |
108 struct SyncTask { | 108 struct SyncTask { |
109 SyncTask(); | 109 SyncTask(); |
| 110 SyncTask(const SyncTask& other); |
110 ~SyncTask(); | 111 ~SyncTask(); |
111 SyncState state; | 112 SyncState state; |
112 ClientContext context; | 113 ClientContext context; |
113 base::Callback<base::Closure(const ClientContext& context)> task; | 114 base::Callback<base::Closure(const ClientContext& context)> task; |
114 bool should_run_again; | 115 bool should_run_again; |
115 base::Closure cancel_closure; | 116 base::Closure cancel_closure; |
116 std::vector<SyncTaskKey> dependent_tasks; | 117 std::vector<SyncTaskKey> dependent_tasks; |
117 std::vector<FileOperationCallback> waiting_callbacks; | 118 std::vector<FileOperationCallback> waiting_callbacks; |
118 }; | 119 }; |
119 | 120 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // invalidate its weak pointers before any other members are destroyed. | 192 // invalidate its weak pointers before any other members are destroyed. |
192 base::WeakPtrFactory<SyncClient> weak_ptr_factory_; | 193 base::WeakPtrFactory<SyncClient> weak_ptr_factory_; |
193 | 194 |
194 DISALLOW_COPY_AND_ASSIGN(SyncClient); | 195 DISALLOW_COPY_AND_ASSIGN(SyncClient); |
195 }; | 196 }; |
196 | 197 |
197 } // namespace internal | 198 } // namespace internal |
198 } // namespace drive | 199 } // namespace drive |
199 | 200 |
200 #endif // COMPONENTS_DRIVE_SYNC_CLIENT_H_ | 201 #endif // COMPONENTS_DRIVE_SYNC_CLIENT_H_ |
OLD | NEW |