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