| 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_REMOTE_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "webkit/fileapi/syncable/sync_callbacks.h" | 10 #include "webkit/fileapi/syncable/sync_callbacks.h" |
| 11 #include "webkit/fileapi/syncable/sync_status_code.h" | 11 #include "webkit/fileapi/syncable/sync_status_code.h" |
| 12 | 12 |
| 13 namespace base { |
| 13 class FilePath; | 14 class FilePath; |
| 15 } |
| 14 | 16 |
| 15 namespace fileapi { | 17 namespace fileapi { |
| 16 class FileChange; | 18 class FileChange; |
| 17 class FileChangeList; | 19 class FileChangeList; |
| 18 class FileSystemURL; | 20 class FileSystemURL; |
| 19 class SyncFileMetadata; | 21 class SyncFileMetadata; |
| 20 } | 22 } |
| 21 | 23 |
| 22 namespace sync_file_system { | 24 namespace sync_file_system { |
| 23 | 25 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 52 | 54 |
| 53 // This is called to apply the remote |change|. If the change type is | 55 // This is called to apply the remote |change|. If the change type is |
| 54 // ADD_OR_UPDATE for a file, |local_path| needs to point to a | 56 // ADD_OR_UPDATE for a file, |local_path| needs to point to a |
| 55 // local file path that contains the latest file image (e.g. a path | 57 // local file path that contains the latest file image (e.g. a path |
| 56 // to a temporary file which has the data downloaded from the server). | 58 // to a temporary file which has the data downloaded from the server). |
| 57 // This may fail with an error but should NOT result in a conflict | 59 // This may fail with an error but should NOT result in a conflict |
| 58 // (as we must have checked the change status in PrepareRemoteSync and | 60 // (as we must have checked the change status in PrepareRemoteSync and |
| 59 // have disabled any further writing). | 61 // have disabled any further writing). |
| 60 virtual void ApplyRemoteChange( | 62 virtual void ApplyRemoteChange( |
| 61 const fileapi::FileChange& change, | 63 const fileapi::FileChange& change, |
| 62 const FilePath& local_path, | 64 const base::FilePath& local_path, |
| 63 const fileapi::FileSystemURL& url, | 65 const fileapi::FileSystemURL& url, |
| 64 const fileapi::SyncStatusCallback& callback) = 0; | 66 const fileapi::SyncStatusCallback& callback) = 0; |
| 65 | 67 |
| 66 // Clears all local changes. This should be called when the remote sync | 68 // Clears all local changes. This should be called when the remote sync |
| 67 // service reconciled or processed the existing local changes while | 69 // service reconciled or processed the existing local changes while |
| 68 // processing a remote change. | 70 // processing a remote change. |
| 69 virtual void ClearLocalChanges( | 71 virtual void ClearLocalChanges( |
| 70 const fileapi::FileSystemURL& url, | 72 const fileapi::FileSystemURL& url, |
| 71 const base::Closure& completion_callback) = 0; | 73 const base::Closure& completion_callback) = 0; |
| 72 | 74 |
| 73 // Records a fake local change so that the change will be processed in the | 75 // Records a fake local change so that the change will be processed in the |
| 74 // next local sync. | 76 // next local sync. |
| 75 // This is called when the remote side wants to trigger a local sync | 77 // This is called when the remote side wants to trigger a local sync |
| 76 // to propagate the local change to the remote change (e.g. to | 78 // to propagate the local change to the remote change (e.g. to |
| 77 // resolve a conflict by uploading the local file). | 79 // resolve a conflict by uploading the local file). |
| 78 virtual void RecordFakeLocalChange( | 80 virtual void RecordFakeLocalChange( |
| 79 const fileapi::FileSystemURL& url, | 81 const fileapi::FileSystemURL& url, |
| 80 const fileapi::FileChange& change, | 82 const fileapi::FileChange& change, |
| 81 const fileapi::SyncStatusCallback& callback) = 0; | 83 const fileapi::SyncStatusCallback& callback) = 0; |
| 82 | 84 |
| 83 private: | 85 private: |
| 84 DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessor); | 86 DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessor); |
| 85 }; | 87 }; |
| 86 | 88 |
| 87 } // namespace sync_file_system | 89 } // namespace sync_file_system |
| 88 | 90 |
| 89 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ | 91 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ |
| OLD | NEW |