Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_LOCAL_SYNC_OPERATION_RESOLVER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_OPERATION_RESOLVER_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_OPERATION_RESOLVER_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_OPERATION_RESOLVER_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "webkit/fileapi/syncable/file_change.h" | 9 #include "webkit/fileapi/syncable/file_change.h" |
| 10 #include "webkit/fileapi/syncable/sync_file_type.h" | 10 #include "webkit/fileapi/syncable/sync_file_type.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 LOCAL_SYNC_OPERATION_NONE, | 23 LOCAL_SYNC_OPERATION_NONE, |
| 24 LOCAL_SYNC_OPERATION_CONFLICT, | 24 LOCAL_SYNC_OPERATION_CONFLICT, |
| 25 LOCAL_SYNC_OPERATION_RESOLVE_TO_LOCAL, | 25 LOCAL_SYNC_OPERATION_RESOLVE_TO_LOCAL, |
| 26 LOCAL_SYNC_OPERATION_RESOLVE_TO_REMOTE, | 26 LOCAL_SYNC_OPERATION_RESOLVE_TO_REMOTE, |
| 27 LOCAL_SYNC_OPERATION_DELETE_METADATA, | 27 LOCAL_SYNC_OPERATION_DELETE_METADATA, |
| 28 LOCAL_SYNC_OPERATION_FAIL, | 28 LOCAL_SYNC_OPERATION_FAIL, |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 class LocalSyncOperationResolver { | 31 class LocalSyncOperationResolver { |
| 32 public: | 32 public: |
| 33 static LocalSyncOperationType Resolve( | 33 static LocalSyncOperationType Resolve( |
|
kinuko
2013/05/07 11:20:16
Can you comment about parameters?
// |remote_file
nhiroki
2013/05/07 12:20:25
Done.
| |
| 34 const FileChange& local_file_change, | 34 const FileChange& local_file_change, |
| 35 bool has_remote_change, | 35 FileChange* remote_file_change, |
|
kinuko
2013/05/07 11:20:16
Can this be const pointer?
nhiroki
2013/05/07 12:20:25
Done.
| |
| 36 const FileChange& remote_file_change, | |
| 37 DriveMetadata* drive_metadata); | 36 DriveMetadata* drive_metadata); |
|
kinuko
2013/05/07 11:20:16
ditto
nhiroki
2013/05/07 12:20:25
Done.
| |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 static LocalSyncOperationType ResolveForAddOrUpdateFile( | 39 static LocalSyncOperationType ResolveForAddOrUpdateFile( |
| 41 bool has_remote_change, | 40 FileChange* remote_file_change, |
| 42 const FileChange& remote_file_change, | |
| 43 SyncFileType remote_file_type_in_metadata); | 41 SyncFileType remote_file_type_in_metadata); |
| 44 static LocalSyncOperationType ResolveForAddOrUpdateFileInConflict( | 42 static LocalSyncOperationType ResolveForAddOrUpdateFileInConflict( |
| 45 bool has_remote_change, | 43 FileChange* remote_file_change); |
| 46 const FileChange& remote_file_change); | |
| 47 static LocalSyncOperationType ResolveForAddDirectory( | 44 static LocalSyncOperationType ResolveForAddDirectory( |
| 48 bool has_remote_change, | 45 FileChange* remote_file_change, |
| 49 const FileChange& remote_file_change, | |
| 50 SyncFileType remote_file_type_in_metadata); | 46 SyncFileType remote_file_type_in_metadata); |
| 51 static LocalSyncOperationType ResolveForAddDirectoryInConflict( | 47 static LocalSyncOperationType ResolveForAddDirectoryInConflict(); |
| 52 bool has_remote_change, | |
| 53 const FileChange& remote_file_change); | |
| 54 static LocalSyncOperationType ResolveForDeleteFile( | 48 static LocalSyncOperationType ResolveForDeleteFile( |
| 55 bool has_remote_change, | 49 FileChange* remote_file_change, |
| 56 const FileChange& remote_file_change, | |
| 57 SyncFileType remote_file_type_in_metadata); | 50 SyncFileType remote_file_type_in_metadata); |
| 58 static LocalSyncOperationType ResolveForDeleteFileInConflict( | 51 static LocalSyncOperationType ResolveForDeleteFileInConflict( |
| 59 bool has_remote_change, | 52 FileChange* remote_file_change); |
| 60 const FileChange& remote_file_change); | |
| 61 static LocalSyncOperationType ResolveForDeleteDirectory( | 53 static LocalSyncOperationType ResolveForDeleteDirectory( |
| 62 bool has_remote_change, | 54 FileChange* remote_file_change, |
| 63 const FileChange& remote_file_change, | |
| 64 SyncFileType remote_file_type_in_metadata); | 55 SyncFileType remote_file_type_in_metadata); |
| 65 static LocalSyncOperationType ResolveForDeleteDirectoryInConflict( | 56 static LocalSyncOperationType ResolveForDeleteDirectoryInConflict( |
| 66 bool has_remote_change, | 57 FileChange* remote_file_change); |
| 67 const FileChange& remote_file_change); | |
| 68 | 58 |
| 69 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 59 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 70 ResolveForAddOrUpdateFile); | 60 ResolveForAddOrUpdateFile); |
| 71 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 61 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 72 ResolveForAddOrUpdateFileInConflict); | 62 ResolveForAddOrUpdateFileInConflict); |
| 73 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 63 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 74 ResolveForAddDirectory); | 64 ResolveForAddDirectory); |
| 75 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 65 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 76 ResolveForAddDirectoryInConflict); | 66 ResolveForAddDirectoryInConflict); |
| 77 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 67 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 78 ResolveForDeleteFile); | 68 ResolveForDeleteFile); |
| 79 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 69 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 80 ResolveForDeleteFileInConflict); | 70 ResolveForDeleteFileInConflict); |
| 81 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 71 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 82 ResolveForDeleteDirectory); | 72 ResolveForDeleteDirectory); |
| 83 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, | 73 FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest, |
| 84 ResolveForDeleteDirectoryInConflict); | 74 ResolveForDeleteDirectoryInConflict); |
| 85 }; | 75 }; |
| 86 | 76 |
| 87 } // namespace sync_file_system | 77 } // namespace sync_file_system |
| 88 | 78 |
| 89 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_OPERATION_RESOLVER_H_ | 79 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_OPERATION_RESOLVER_H_ |
| OLD | NEW |