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_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // LocalChangeProcessor overrides. | 79 // LocalChangeProcessor overrides. |
80 virtual void ApplyLocalChange( | 80 virtual void ApplyLocalChange( |
81 const fileapi::FileChange& change, | 81 const fileapi::FileChange& change, |
82 const FilePath& local_file_path, | 82 const FilePath& local_file_path, |
83 const fileapi::SyncFileMetadata& local_file_metadata, | 83 const fileapi::SyncFileMetadata& local_file_metadata, |
84 const fileapi::FileSystemURL& url, | 84 const fileapi::FileSystemURL& url, |
85 const fileapi::SyncStatusCallback& callback) OVERRIDE; | 85 const fileapi::SyncStatusCallback& callback) OVERRIDE; |
86 | 86 |
87 // DriveFileSyncClientObserver overrides. | 87 // DriveFileSyncClientObserver overrides. |
88 virtual void OnAuthenticated() OVERRIDE; | 88 virtual void OnAuthenticated() OVERRIDE; |
| 89 virtual void OnNetworkConnected() OVERRIDE; |
89 | 90 |
90 private: | 91 private: |
91 friend class DriveFileSyncServiceTest; | 92 friend class DriveFileSyncServiceTest; |
92 class TaskToken; | 93 class TaskToken; |
93 struct ProcessRemoteChangeParam; | 94 struct ProcessRemoteChangeParam; |
94 | 95 |
95 enum RemoteSyncType { | 96 enum RemoteSyncType { |
96 // Smaller number indicates higher priority in ChangeQueue. | 97 // Smaller number indicates higher priority in ChangeQueue. |
97 REMOTE_SYNC_TYPE_INCREMENTAL = 0, | 98 REMOTE_SYNC_TYPE_INCREMENTAL = 0, |
98 REMOTE_SYNC_TYPE_BATCH = 1, | 99 REMOTE_SYNC_TYPE_BATCH = 1, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // |task_description| is optional but should give human-readable | 170 // |task_description| is optional but should give human-readable |
170 // messages that describe the task that is acquiring the token. | 171 // messages that describe the task that is acquiring the token. |
171 scoped_ptr<TaskToken> GetToken(const tracked_objects::Location& from_here, | 172 scoped_ptr<TaskToken> GetToken(const tracked_objects::Location& from_here, |
172 TaskType task_type, | 173 TaskType task_type, |
173 const std::string& task_description); | 174 const std::string& task_description); |
174 void NotifyTaskDone(fileapi::SyncStatusCode status, | 175 void NotifyTaskDone(fileapi::SyncStatusCode status, |
175 scoped_ptr<TaskToken> token); | 176 scoped_ptr<TaskToken> token); |
176 void UpdateServiceState(); | 177 void UpdateServiceState(); |
177 base::WeakPtr<DriveFileSyncService> AsWeakPtr(); | 178 base::WeakPtr<DriveFileSyncService> AsWeakPtr(); |
178 | 179 |
179 | |
180 void DidGetRemoteFileMetadata( | 180 void DidGetRemoteFileMetadata( |
181 const fileapi::SyncFileMetadataCallback& callback, | 181 const fileapi::SyncFileMetadataCallback& callback, |
182 google_apis::GDataErrorCode error, | 182 google_apis::GDataErrorCode error, |
183 scoped_ptr<google_apis::DocumentEntry> entry); | 183 scoped_ptr<google_apis::DocumentEntry> entry); |
184 | 184 |
185 SyncOperationType ResolveSyncOperationType( | 185 SyncOperationType ResolveSyncOperationType( |
186 const fileapi::FileChange& local_file_change, | 186 const fileapi::FileChange& local_file_change, |
187 const fileapi::FileSystemURL& url); | 187 const fileapi::FileSystemURL& url); |
188 | 188 |
189 void DidApplyLocalChange(scoped_ptr<TaskToken> token, | 189 void DidApplyLocalChange(scoped_ptr<TaskToken> token, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer | 321 // Use WeakPtrFactory instead of SupportsWeakPtr to revoke the weak pointer |
322 // in |token_|. | 322 // in |token_|. |
323 base::WeakPtrFactory<DriveFileSyncService> weak_factory_; | 323 base::WeakPtrFactory<DriveFileSyncService> weak_factory_; |
324 | 324 |
325 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); | 325 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); |
326 }; | 326 }; |
327 | 327 |
328 } // namespace sync_file_system | 328 } // namespace sync_file_system |
329 | 329 |
330 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 330 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
OLD | NEW |