OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 class RemoteChangeProcessor; | 32 class RemoteChangeProcessor; |
33 | 33 |
34 namespace drive_backend { | 34 namespace drive_backend { |
35 | 35 |
36 class FileTracker; | 36 class FileTracker; |
37 class FolderCreator; | 37 class FolderCreator; |
38 class MetadataDatabase; | 38 class MetadataDatabase; |
39 class SyncEngineContext; | 39 class SyncEngineContext; |
40 | 40 |
41 class LocalToRemoteSyncer : public ExclusiveTask { | 41 class LocalToRemoteSyncer : public SyncTask { |
42 public: | 42 public: |
43 LocalToRemoteSyncer(SyncEngineContext* sync_context, | 43 LocalToRemoteSyncer(SyncEngineContext* sync_context, |
44 const SyncFileMetadata& local_metadata, | 44 const SyncFileMetadata& local_metadata, |
45 const FileChange& local_change, | 45 const FileChange& local_change, |
46 const base::FilePath& local_path, | 46 const base::FilePath& local_path, |
47 const fileapi::FileSystemURL& url); | 47 const fileapi::FileSystemURL& url); |
48 virtual ~LocalToRemoteSyncer(); | 48 virtual ~LocalToRemoteSyncer(); |
49 virtual void RunExclusive(const SyncStatusCallback& callback) OVERRIDE; | 49 virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) OVERRIDE; |
| 50 void RunExclusive(scoped_ptr<SyncTaskToken> token); |
50 | 51 |
51 const fileapi::FileSystemURL& url() const { return url_; } | 52 const fileapi::FileSystemURL& url() const { return url_; } |
52 const base::FilePath& target_path() const { return target_path_; } | 53 const base::FilePath& target_path() const { return target_path_; } |
53 SyncAction sync_action() const { return sync_action_; } | 54 SyncAction sync_action() const { return sync_action_; } |
54 bool needs_remote_change_listing() const { | 55 bool needs_remote_change_listing() const { |
55 return needs_remote_change_listing_; | 56 return needs_remote_change_listing_; |
56 } | 57 } |
57 | 58 |
58 private: | 59 private: |
59 void SyncCompleted(const SyncStatusCallback& callback, | 60 void SyncCompleted(scoped_ptr<SyncTaskToken> token, |
60 SyncStatusCode status); | 61 SyncStatusCode status); |
61 | 62 |
62 void HandleConflict(const SyncStatusCallback& callback); | 63 void HandleConflict(const SyncStatusCallback& callback); |
63 void HandleExistingRemoteFile(const SyncStatusCallback& callback); | 64 void HandleExistingRemoteFile(const SyncStatusCallback& callback); |
64 | 65 |
65 void DeleteRemoteFile(const SyncStatusCallback& callback); | 66 void DeleteRemoteFile(const SyncStatusCallback& callback); |
66 void DidDeleteRemoteFile(const SyncStatusCallback& callback, | 67 void DidDeleteRemoteFile(const SyncStatusCallback& callback, |
67 google_apis::GDataErrorCode error); | 68 google_apis::GDataErrorCode error); |
68 | 69 |
69 void UploadExistingFile(const SyncStatusCallback& callback); | 70 void UploadExistingFile(const SyncStatusCallback& callback); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 125 |
125 base::WeakPtrFactory<LocalToRemoteSyncer> weak_ptr_factory_; | 126 base::WeakPtrFactory<LocalToRemoteSyncer> weak_ptr_factory_; |
126 | 127 |
127 DISALLOW_COPY_AND_ASSIGN(LocalToRemoteSyncer); | 128 DISALLOW_COPY_AND_ASSIGN(LocalToRemoteSyncer); |
128 }; | 129 }; |
129 | 130 |
130 } // namespace drive_backend | 131 } // namespace drive_backend |
131 } // namespace sync_file_system | 132 } // namespace sync_file_system |
132 | 133 |
133 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_
H_ | 134 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_
H_ |
OLD | NEW |