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" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // to a temporary file which has the data downloaded from the server). | 54 // to a temporary file which has the data downloaded from the server). |
55 // This may fail with an error but should NOT result in a conflict | 55 // This may fail with an error but should NOT result in a conflict |
56 // (as we must have checked the change status in PrepareRemoteSync and | 56 // (as we must have checked the change status in PrepareRemoteSync and |
57 // have disabled any further writing). | 57 // have disabled any further writing). |
58 virtual void ApplyRemoteChange( | 58 virtual void ApplyRemoteChange( |
59 const fileapi::FileChange& change, | 59 const fileapi::FileChange& change, |
60 const FilePath& local_path, | 60 const FilePath& local_path, |
61 const fileapi::FileSystemURL& url, | 61 const fileapi::FileSystemURL& url, |
62 const fileapi::SyncStatusCallback& callback) = 0; | 62 const fileapi::SyncStatusCallback& callback) = 0; |
63 | 63 |
| 64 // Clears all local changes. This should be called when the remote sync |
| 65 // service reconciled or processed the existing local changes while |
| 66 // processing a remote change. |
| 67 virtual void ClearLocalChanges( |
| 68 const fileapi::FileSystemURL& url, |
| 69 const base::Closure& completion_callback) = 0; |
| 70 |
64 // Records a fake local change so that the change will be processed in the | 71 // Records a fake local change so that the change will be processed in the |
65 // next local sync. | 72 // next local sync. |
66 // This is called when the remote side wants to trigger a local sync | 73 // This is called when the remote side wants to trigger a local sync |
67 // to propagate the local change to the remote change (e.g. to | 74 // to propagate the local change to the remote change (e.g. to |
68 // resolve a conflict by uploading the local file). | 75 // resolve a conflict by uploading the local file). |
69 virtual void RecordFakeLocalChange( | 76 virtual void RecordFakeLocalChange( |
70 const fileapi::FileSystemURL& url, | 77 const fileapi::FileSystemURL& url, |
71 const fileapi::FileChange& change, | 78 const fileapi::FileChange& change, |
72 const fileapi::SyncStatusCallback& callback) = 0; | 79 const fileapi::SyncStatusCallback& callback) = 0; |
73 | 80 |
74 private: | 81 private: |
75 DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessor); | 82 DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessor); |
76 }; | 83 }; |
77 | 84 |
78 } // namespace sync_file_system | 85 } // namespace sync_file_system |
79 | 86 |
80 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ | 87 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ |
OLD | NEW |