| 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_LOCAL_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CHANGE_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "webkit/fileapi/syncable/sync_callbacks.h" | 9 #include "webkit/fileapi/syncable/sync_callbacks.h" |
| 10 | 10 |
| 11 namespace fileapi { | 11 namespace fileapi { |
| 12 class FileChange; | 12 class FileChange; |
| 13 class FileChangeList; | 13 class FileChangeList; |
| 14 class FileSystemURL; | 14 class FileSystemURL; |
| 15 class SyncFileMetadata; | |
| 16 } | 15 } |
| 17 | 16 |
| 18 namespace sync_file_system { | 17 namespace sync_file_system { |
| 19 | 18 |
| 20 // Represents an interface to process one local change and applies | 19 // Represents an interface to process one local change and applies |
| 21 // it to the remote server. | 20 // it to the remote server. |
| 22 // This interface is to be implemented/backed by RemoteSyncFileService. | 21 // This interface is to be implemented/backed by RemoteSyncFileService. |
| 23 class LocalChangeProcessor { | 22 class LocalChangeProcessor { |
| 24 public: | 23 public: |
| 25 LocalChangeProcessor() {} | 24 LocalChangeProcessor() {} |
| 26 virtual ~LocalChangeProcessor() {} | 25 virtual ~LocalChangeProcessor() {} |
| 27 | 26 |
| 28 // This is called to apply the local |change|. If the change type is | 27 // This is called to apply the local |change|. If the change type is |
| 29 // ADD_OR_UPDATE for a file, |local_file_path| points to a local file | 28 // ADD_OR_UPDATE for a file, |local_file_path| points to a local file |
| 30 // path that contains the latest file image whose file metadata is | 29 // path that contains the latest file image. |
| 31 // |local_file_metadata|. | |
| 32 // When SYNC_STATUS_HAS_CONFLICT is returned the implementation should | 30 // When SYNC_STATUS_HAS_CONFLICT is returned the implementation should |
| 33 // notify the backing RemoteFileSyncService of the existence of conflict | 31 // notify the backing RemoteFileSyncService of the existence of conflict |
| 34 // (as the remote service is supposed to maintain a list of conflict files). | 32 // (as the remote service is supposed to maintain a list of conflict files). |
| 35 virtual void ApplyLocalChange( | 33 virtual void ApplyLocalChange( |
| 36 const fileapi::FileChange& change, | 34 const fileapi::FileChange& change, |
| 37 const FilePath& local_file_path, | 35 const FilePath& local_file_path, |
| 38 const fileapi::SyncFileMetadata& local_file_metadata, | |
| 39 const fileapi::FileSystemURL& url, | 36 const fileapi::FileSystemURL& url, |
| 40 const fileapi::SyncStatusCallback& callback) = 0; | 37 const fileapi::SyncStatusCallback& callback) = 0; |
| 41 | 38 |
| 42 private: | 39 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(LocalChangeProcessor); | 40 DISALLOW_COPY_AND_ASSIGN(LocalChangeProcessor); |
| 44 }; | 41 }; |
| 45 | 42 |
| 46 } // namespace sync_file_system | 43 } // namespace sync_file_system |
| 47 | 44 |
| 48 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CHANGE_PROCESSOR_H_ | 45 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CHANGE_PROCESSOR_H_ |
| OLD | NEW |