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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync_file_system/remote_sync_operation_resolver.h
diff --git a/chrome/browser/sync_file_system/remote_sync_operation_resolver.h b/chrome/browser/sync_file_system/remote_sync_operation_resolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ed34cdd5e8b66b3b9d5dc20c6377cdeb456a1df
--- /dev/null
+++ b/chrome/browser/sync_file_system/remote_sync_operation_resolver.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_
+#define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_
+
+#include "webkit/fileapi/syncable/file_change.h"
+#include "webkit/fileapi/syncable/sync_file_type.h"
+
+namespace sync_file_system {
+
+class RemoteSyncOperationResolver {
+ public:
+ 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.
+ REMOTE_SYNC_OPERATION_ADD_FILE,
+ REMOTE_SYNC_OPERATION_ADD_DIRECTORY,
+ REMOTE_SYNC_OPERATION_UPDATE_FILE,
+ REMOTE_SYNC_OPERATION_DELETE_FILE,
+ REMOTE_SYNC_OPERATION_DELETE_DIRECTORY,
+ REMOTE_SYNC_OPERATION_NONE,
+ REMOTE_SYNC_OPERATION_CONFLICT,
+ REMOTE_SYNC_OPERATION_RESOLVE_TO_LOCAL,
+ REMOTE_SYNC_OPERATION_RESOLVE_TO_REMOTE,
+ REMOTE_SYNC_OPERATION_DELETE_METADATA,
+ REMOTE_SYNC_OPERATION_FAIL,
+ };
+
+ static RemoteSyncOperationType Resolve(
+ const FileChange& remote_file_change,
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type,
+ bool is_conflicting);
+
+ private:
+ friend class RemoteSyncOperationResolverTest;
+
+ static RemoteSyncOperationType ResolveForAddOrUpdateFile(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+ static RemoteSyncOperationType ResolveForAddOrUpdateFileInConflict(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+ static RemoteSyncOperationType ResolveForAddDirectory(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+ static RemoteSyncOperationType ResolveForAddDirectoryInConflict(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+ static RemoteSyncOperationType ResolveForDeleteFile(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+ static RemoteSyncOperationType ResolveForDeleteFileInConflict(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+ static RemoteSyncOperationType ResolveForDeleteDirectory(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+ static RemoteSyncOperationType ResolveForDeleteDirectoryInConflict(
+ const FileChangeList& local_changes,
+ SyncFileType local_file_type);
+};
+
+} // namespace sync_file_system
+
+#endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_

Powered by Google App Engine
This is Rietveld 408576698