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
3 // found in the LICENSE file.
5 #ifndef SYNC_ENGINE_SYNCER_TYPES_H_
6 #define SYNC_ENGINE_SYNCER_TYPES_H_
8 // The intent of this is to keep all shared data types and enums for the syncer
9 // in a single place without having dependencies between other files.
12 enum UpdateAttemptResponse
{
13 // Update was applied or safely ignored.
16 // The conditions described by the following enum values are not mutually
17 // exclusive. The list has been ordered according to priority in the case of
18 // overlap, with highest priority first.
20 // For example, in the case where an item had both the IS_UNSYCNED and
21 // IS_UNAPPLIED_UPDATE flags set (CONFLICT_SIMPLE), and a SERVER_PARENT_ID
22 // that, if applied, would cause a directory loop (CONFLICT_HIERARCHY), and
23 // specifics that we can't decrypt right now (CONFLICT_ENCRYPTION), the
24 // UpdateApplicator would return CONFLICT_ENCRYPTION when attempting to
27 // We do not attempt to resolve CONFLICT_HIERARCHY or CONFLICT_ENCRYPTION
28 // items. We will leave these updates unapplied and wait for the server
29 // to send us newer updates that will resolve the conflict.
31 // We were unable to decrypt/encrypt this server data. As such, we can't make
32 // forward progress on this node, but because the passphrase may not arrive
33 // until later we don't want to get the syncer stuck. See UpdateApplicator
34 // for how this is handled.
37 // These are some updates that, if applied, would violate the tree's
38 // invariants. Examples of this include the server adding children to locally
39 // deleted directories and directory moves that would create loops.
42 // This indicates that item was modified both remotely (IS_UNAPPLIED_UPDATE)
43 // and locally (IS_UNSYNCED). We use the ConflictResolver to decide which of
44 // the changes should take priority, or if we can possibly merge the data.
48 enum ServerUpdateProcessingResult
{
49 // Success. Update applied and stored in SERVER_* fields or dropped if
53 // Success. Update details stored in SERVER_* fields, but wasn't applied.
56 // Update is illegally inconsistent with earlier updates. e.g. A bookmark
60 // Update is illegal when considered alone. e.g. broken UTF-8 in the name.
63 // Only used by VerifyUpdate. Indicates that an update is valid. As
64 // VerifyUpdate cannot return SUCCESS_STORED, we reuse the value.
65 SUCCESS_VALID
= SUCCESS_STORED
68 // Different results from the verify phase will yield different methods of
69 // processing in the ProcessUpdates phase. The SKIP result means the entry
70 // doesn't go to the ProcessUpdates phase.
79 enum VerifyCommitResult
{
86 #endif // SYNC_ENGINE_SYNCER_TYPES_H_