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

Unified Diff: sync/api/conflict_resolution.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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
« no previous file with comments | « sync/api/attachments/attachment_unittest.cc ('k') | sync/api/conflict_resolution.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/conflict_resolution.h
diff --git a/sync/api/conflict_resolution.h b/sync/api/conflict_resolution.h
deleted file mode 100644
index 3a9bb32cd81d72b809571b5f21e568ebf7756d7f..0000000000000000000000000000000000000000
--- a/sync/api/conflict_resolution.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2016 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 SYNC_API_CONFLICT_RESOLUTION_H_
-#define SYNC_API_CONFLICT_RESOLUTION_H_
-
-#include <memory>
-
-#include "sync/api/entity_data.h"
-
-namespace syncer_v2 {
-
-// A simple class to represent the resolution of a data conflict. We either:
-// 1) Use the local client data and update the server.
-// 2) Use the remote server data and update the client.
-// 3) Use newly created data and update both.
-class SYNC_EXPORT ConflictResolution {
- public:
- // This enum is used in histograms.xml and entries shouldn't be renumbered or
- // removed. New entries must be added at the end, before TYPE_SIZE.
- enum Type {
- CHANGES_MATCH, // Exists for logging purposes.
- USE_LOCAL,
- USE_REMOTE,
- USE_NEW,
- IGNORE_LOCAL_ENCRYPTION, // Exists for logging purposes.
- IGNORE_REMOTE_ENCRYPTION, // Exists for logging purposes.
- TYPE_SIZE,
- };
-
- // Convenience functions for brevity.
- static ConflictResolution UseLocal();
- static ConflictResolution UseRemote();
- static ConflictResolution UseNew(std::unique_ptr<EntityData> data);
-
- // Move constructor since we can't copy a unique_ptr.
- ConflictResolution(ConflictResolution&& other);
- ~ConflictResolution();
-
- Type type() const { return type_; }
-
- // Get the data for USE_NEW, or nullptr. Can only be called once.
- std::unique_ptr<EntityData> ExtractData();
-
- private:
- ConflictResolution(Type type, std::unique_ptr<EntityData> data);
-
- const Type type_;
- std::unique_ptr<EntityData> data_;
-
- DISALLOW_COPY_AND_ASSIGN(ConflictResolution);
-};
-
-} // namespace syncer_v2
-
-#endif // SYNC_API_CONFLICT_RESOLUTION_H_
« no previous file with comments | « sync/api/attachments/attachment_unittest.cc ('k') | sync/api/conflict_resolution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698