• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4//
5// Sync protocol for communication between sync client and server.
6
7// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
8// any fields in this file.
9
10syntax = "proto2";
11
12option optimize_for = LITE_RUNTIME;
13option retain_unknown_fields = true;
14
15package sync_pb;
16
17message SyncEnums {
18  // These events are sent by the DebugInfo class for singleton events.
19  enum SingletonDebugEventType {
20    CONNECTION_STATUS_CHANGE = 1; // Connection status change. Note this
21                                  // gets generated even during a successful
22                                  // connection.
23    UPDATED_TOKEN = 2; // Client received an updated token.
24    PASSPHRASE_REQUIRED = 3; // Cryptographer needs passphrase.
25    PASSPHRASE_ACCEPTED = 4; // Passphrase was accepted by cryptographer.
26    INITIALIZATION_COMPLETE = 5; // Sync Initialization is complete.
27
28    // |STOP_SYNCING_PERMANENTLY| event should never be seen by the server in
29    // the absence of bugs.
30    STOP_SYNCING_PERMANENTLY = 6; // Server sent stop syncing permanently.
31
32    ENCRYPTION_COMPLETE = 7; // Client has finished encrypting all data.
33    ACTIONABLE_ERROR = 8; // Client received an actionable error.
34    ENCRYPTED_TYPES_CHANGED = 9; // Set of encrypted types has changed.
35                                 // NOTE: until m25 bootstrap token updated also
36                                 // shared this field (erroneously).
37    PASSPHRASE_TYPE_CHANGED = 10;  // The encryption passphrase state changed.
38    KEYSTORE_TOKEN_UPDATED = 11;  // A new keystore encryption token was
39                                  // persisted.
40    CONFIGURE_COMPLETE = 12;      // The datatype manager has finished an
41                                  // at least partially successful
42                                  // configuration and is once again syncing
43                                  // with the server.
44    BOOTSTRAP_TOKEN_UPDATED = 13;  // A new cryptographer bootstrap token was
45                                   // generated.
46  }
47
48  // See content/public/common/page_transition_types.h for detailed
49  // information on the values of PageTransition and
50  // PageTransitionRedirectType below.
51
52  // Types of transitions between pages.
53  enum PageTransition {
54    LINK = 0;
55    TYPED = 1;
56    AUTO_BOOKMARK = 2;
57    AUTO_SUBFRAME = 3;
58    MANUAL_SUBFRAME = 4;
59    GENERATED = 5;
60    AUTO_TOPLEVEL = 6;
61    FORM_SUBMIT = 7;
62    RELOAD = 8;
63    KEYWORD = 9;
64    KEYWORD_GENERATED = 10;
65    // The below two were mistakenly added but never properly used. They are
66    // actually transition qualifiers, and are set independently of other
67    // qualifiers and of the main transitions. See session_specifics.proto for
68    // the list of synced transition qualifiers.
69    // CHAIN_START = 12;     Deprecated.
70    // CHAIN_END = 13;       Deprecated.
71  }
72
73  // Types of redirects that triggered a transition.
74  enum PageTransitionRedirectType {
75    CLIENT_REDIRECT = 1;
76    SERVER_REDIRECT = 2;
77  }
78
79  enum ErrorType {
80    SUCCESS            = 0;
81    ACCESS_DENIED      = 1;   // Returned when the user doesn't have access to
82                              // store (instead of HTTP 401).
83    NOT_MY_BIRTHDAY    = 2;   // Returned when the server and client disagree on
84                              // the store birthday.
85    THROTTLED          = 3;   // Returned when the store has exceeded the
86                              // allowed bandwidth utilization.
87    AUTH_EXPIRED       = 4;   // Auth token or cookie has expired.
88    USER_NOT_ACTIVATED = 5;   // User doesn't have the Chrome bit set on that
89                              // Google Account.
90    AUTH_INVALID       = 6;   // Auth token or cookie is otherwise invalid.
91    CLEAR_PENDING      = 7;   // A clear of the user data is pending (e.g.
92                              // initiated by privacy request).  Client should
93                              // come back later.
94    TRANSIENT_ERROR    = 8;   // A transient error occured (eg. backend
95                              // timeout). Client should try again later.
96    MIGRATION_DONE     = 9;   // Migration has finished for one or more data
97                              // types.  Client should clear the cache for
98                              // these data types only and then re-sync with
99                              // a server.
100    DISABLED_BY_ADMIN = 10;   // An administrator disabled sync for this domain.
101    USER_ROLLBACK     = 11;   // Client told to stop syncing and roll back.
102    UNKNOWN            = 100; // Unknown value. This should never be explicitly
103                              // used; it is the default value when an
104                              // out-of-date client parses a value it doesn't
105                              // recognize.
106  }
107
108  enum Action {
109    UPGRADE_CLIENT              = 0; // Upgrade the client to latest version.
110    CLEAR_USER_DATA_AND_RESYNC  = 1; // Clear user data from dashboard and
111                                     // setup sync again.
112    ENABLE_SYNC_ON_ACCOUNT      = 2; // The administrator needs to enable sync
113                                     // on the account.
114    STOP_AND_RESTART_SYNC       = 3; // Stop sync and set up sync again.
115    DISABLE_SYNC_ON_CLIENT      = 4; // Wipe the client of all sync data and
116                                     // stop syncing.
117    UNKNOWN_ACTION              = 5; // This is the default.
118  }
119
120  enum DeviceType {
121    TYPE_WIN = 1;
122    TYPE_MAC = 2;
123    TYPE_LINUX = 3;
124    TYPE_CROS = 4;
125    TYPE_OTHER = 5;
126    TYPE_PHONE = 6;
127    TYPE_TABLET = 7;
128  }
129
130  // This is the successor to GetUpdatesSource.  It merges the "normal mode"
131  // values (LOCAL, NOTIFICATION and DATATYPE_REFRESH), which were never really
132  // mutually exclusive to being with, into the GU_TRIGGER value.  It also
133  // drops support for some old values that are not supported by newer clients.
134  //
135  // Mind the gaps: Some values are intentionally unused because we want to
136  // keep the values in sync with GetUpdatesSource as much as possible.  Please
137  // don't add any values < 12 unless there's a good reason for it.
138  //
139  // Introduced in M28.
140  enum GetUpdatesOrigin {
141    UNKNOWN_ORIGIN = 0;  // The source was not set by the caller.
142    PERIODIC = 4;  // The source of the update was periodic polling.
143    NEWLY_SUPPORTED_DATATYPE = 7;   // The client is in configuration mode
144                                    // because it's syncing all datatypes, and
145                                    // support for a new datatype was recently
146                                    // released via a software auto-update.
147    MIGRATION = 8;         // The client is in configuration mode because a
148                           // MIGRATION_DONE error previously returned by the
149                           // server necessitated resynchronization.
150    NEW_CLIENT = 9;        // The client is in configuration mode because the
151                           // user enabled sync for the first time.  Not to be
152                           // confused with FIRST_UPDATE.
153    RECONFIGURATION = 10;  // The client is in configuration mode because the
154                           // user opted to sync a different set of datatypes.
155    GU_TRIGGER = 12;  // The client is in 'normal' mode.  It may have several
156                      // reasons for requesting an update.  See the per-type
157                      // GetUpdateTriggers message for more details.
158    RETRY = 13;  // A retry GU to pick up updates missed by last GU due to
159                 // replication delay, missing hints, etc.
160  }
161}
162