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

Side by Side Diff: chrome/browser/sync/internal_api/sync_manager.h

Issue 9323015: [Sync] - In about:sync page display if the first sync after restart has taken place or not. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ 5 #ifndef CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_
6 #define CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ 6 #define CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Status encapsulates detailed state about the internals of the SyncManager. 87 // Status encapsulates detailed state about the internals of the SyncManager.
88 struct Status { 88 struct Status {
89 // Summary is a distilled set of important information that the end-user may 89 // Summary is a distilled set of important information that the end-user may
90 // wish to be informed about (through UI, for example). Note that if a 90 // wish to be informed about (through UI, for example). Note that if a
91 // summary state requires user interaction (such as auth failures), more 91 // summary state requires user interaction (such as auth failures), more
92 // detailed information may be contained in additional status fields. 92 // detailed information may be contained in additional status fields.
93 enum Summary { 93 enum Summary {
94 // The internal instance is in an unrecognizable state. This should not 94 // The internal instance is in an unrecognizable state. This should not
95 // happen. 95 // happen.
96 INVALID = 0, 96 INVALID = 0,
97 // A sync has not happened since restart.
98 UNININITIALIZED,
rlarocque 2012/02/02 22:44:13 I no longer think this is a good name. It makes s
lipalani1 2012/02/03 01:55:39 our target audience is: 1. We expect only develope
97 // Can't connect to server, but there are no pending changes in 99 // Can't connect to server, but there are no pending changes in
98 // our local cache. 100 // our local cache.
99 OFFLINE, 101 OFFLINE,
100 // Can't connect to server, and there are pending changes in our 102 // Can't connect to server, and there are pending changes in our
101 // local cache. 103 // local cache.
102 OFFLINE_UNSYNCED, 104 OFFLINE_UNSYNCED,
103 // Connected and syncing. 105 // Connected and syncing.
104 SYNCING, 106 SYNCING,
105 // Connected, no pending changes. 107 // Connected, no pending changes.
106 READY, 108 READY,
107 // Can't connect to server, and we haven't completed the initial 109 // Can't connect to server.
108 // sync yet. So there's nothing we can do but wait for the server. 110 // So there's nothing we can do but wait for the server.
111 // This state indicates there are no pending changes. Client
112 // is trying to sync possibly because of a notification.
109 OFFLINE_UNUSABLE, 113 OFFLINE_UNUSABLE,
110 114
111 SUMMARY_STATUS_COUNT, 115 SUMMARY_STATUS_COUNT,
112 }; 116 };
113 117
114 Status(); 118 Status();
115 ~Status(); 119 ~Status();
116 120
117 Summary summary; 121 Summary summary;
118 bool authenticated; // Successfully authenticated via GAIA. 122 bool authenticated; // Successfully authenticated via GAIA.
(...skipping 11 matching lines...) Expand all
130 134
131 browser_sync::SyncProtocolError sync_protocol_error; 135 browser_sync::SyncProtocolError sync_protocol_error;
132 136
133 // Number of unsynced items counted at the start of most recent sync cycle. 137 // Number of unsynced items counted at the start of most recent sync cycle.
134 int unsynced_count; 138 int unsynced_count;
135 139
136 // Number of conflicting items counted during most recent sync cycle. 140 // Number of conflicting items counted during most recent sync cycle.
137 int conflicting_count; 141 int conflicting_count;
138 142
139 bool syncing; 143 bool syncing;
140 // True after a client has done a first sync.
141 bool initial_sync_ended;
142 144
143 // Total updates available. If zero, nothing left to download. 145 // Total updates available. If zero, nothing left to download.
144 int64 updates_available; 146 int64 updates_available;
145 // Total updates received by the syncer since browser start. 147 // Total updates received by the syncer since browser start.
146 int updates_received; 148 int updates_received;
147 149
148 // Of updates_received, how many were tombstones. 150 // Of updates_received, how many were tombstones.
149 int tombstone_updates_received; 151 int tombstone_updates_received;
150 152
151 // Total number of overwrites due to conflict resolver since browser start. 153 // Total number of overwrites due to conflict resolver since browser start.
152 int num_local_overwrites_total; 154 int num_local_overwrites_total;
153 int num_server_overwrites_total; 155 int num_server_overwrites_total;
154 156
155 // Count of empty and non empty getupdates; 157 // Count of empty and non empty getupdates;
156 int nonempty_get_updates; 158 int nonempty_get_updates;
157 int empty_get_updates; 159 int empty_get_updates;
158 160
159 // Count of useless and useful syncs we perform. 161 // Count of useless and useful syncs we perform.
160 int useless_sync_cycles; 162 int useless_sync_cycles;
161 int useful_sync_cycles; 163 int useful_sync_cycles;
162 164
165 // Sync cycle count.
166 int sync_count;
167
163 // Encryption related. 168 // Encryption related.
164 syncable::ModelTypeSet encrypted_types; 169 syncable::ModelTypeSet encrypted_types;
165 bool cryptographer_ready; 170 bool cryptographer_ready;
166 bool crypto_has_pending_keys; 171 bool crypto_has_pending_keys;
167 172
168 // The unique identifer for this client. 173 // The unique identifer for this client.
169 std::string unique_id; 174 std::string unique_id;
170 }; 175 };
171 176
172 // An interface the embedding application implements to be notified 177 // An interface the embedding application implements to be notified
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 syncable::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( 622 syncable::ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
618 syncable::ModelTypeSet types, 623 syncable::ModelTypeSet types,
619 sync_api::UserShare* share); 624 sync_api::UserShare* share);
620 625
621 // Returns the string representation of a PassphraseRequiredReason value. 626 // Returns the string representation of a PassphraseRequiredReason value.
622 std::string PassphraseRequiredReasonToString(PassphraseRequiredReason reason); 627 std::string PassphraseRequiredReasonToString(PassphraseRequiredReason reason);
623 628
624 } // namespace sync_api 629 } // namespace sync_api
625 630
626 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_ 631 #endif // CHROME_BROWSER_SYNC_INTERNAL_API_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698