Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Side by Side Diff: chrome/browser/sync_file_system/remote_sync_operation_resolver.h

Issue 13986011: SyncFS: Introduce RemoteSyncOperationResolver for directory operation support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add RemoteSyncOperationResolver and unit tests Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_
7
8 #include "webkit/fileapi/syncable/file_change.h"
9 #include "webkit/fileapi/syncable/sync_file_type.h"
10
11 namespace sync_file_system {
12
13 class RemoteSyncOperationResolver {
14 public:
15 enum RemoteSyncOperationType {
kinuko 2013/04/24 14:54:50 If this is a nested enum in a class, I think the e
nhiroki 2013/04/25 06:54:43 Done.
16 REMOTE_SYNC_OPERATION_ADD_FILE,
17 REMOTE_SYNC_OPERATION_ADD_DIRECTORY,
18 REMOTE_SYNC_OPERATION_UPDATE_FILE,
19 REMOTE_SYNC_OPERATION_DELETE_FILE,
20 REMOTE_SYNC_OPERATION_DELETE_DIRECTORY,
21 REMOTE_SYNC_OPERATION_NONE,
22 REMOTE_SYNC_OPERATION_CONFLICT,
23 REMOTE_SYNC_OPERATION_RESOLVE_TO_LOCAL,
24 REMOTE_SYNC_OPERATION_RESOLVE_TO_REMOTE,
25 REMOTE_SYNC_OPERATION_DELETE_METADATA,
26 REMOTE_SYNC_OPERATION_FAIL,
27 };
28
29 static RemoteSyncOperationType Resolve(
30 const FileChange& remote_file_change,
31 const FileChangeList& local_changes,
32 SyncFileType local_file_type,
33 bool is_conflicting);
34
35 private:
36 friend class RemoteSyncOperationResolverTest;
37
38 static RemoteSyncOperationType ResolveForAddOrUpdateFile(
39 const FileChangeList& local_changes,
40 SyncFileType local_file_type);
41 static RemoteSyncOperationType ResolveForAddOrUpdateFileInConflict(
42 const FileChangeList& local_changes,
43 SyncFileType local_file_type);
44 static RemoteSyncOperationType ResolveForAddDirectory(
45 const FileChangeList& local_changes,
46 SyncFileType local_file_type);
47 static RemoteSyncOperationType ResolveForAddDirectoryInConflict(
48 const FileChangeList& local_changes,
49 SyncFileType local_file_type);
50 static RemoteSyncOperationType ResolveForDeleteFile(
51 const FileChangeList& local_changes,
52 SyncFileType local_file_type);
53 static RemoteSyncOperationType ResolveForDeleteFileInConflict(
54 const FileChangeList& local_changes,
55 SyncFileType local_file_type);
56 static RemoteSyncOperationType ResolveForDeleteDirectory(
57 const FileChangeList& local_changes,
58 SyncFileType local_file_type);
59 static RemoteSyncOperationType ResolveForDeleteDirectoryInConflict(
60 const FileChangeList& local_changes,
61 SyncFileType local_file_type);
62 };
63
64 } // namespace sync_file_system
65
66 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698