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

Side by Side Diff: chrome/browser/sync/sessions/session_state.h

Issue 7013040: Add information about sync session and other useful data to about:sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing a bug. Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // The 'sessions' namespace comprises all the pieces of state that are 5 // The 'sessions' namespace comprises all the pieces of state that are
6 // combined to form a SyncSession instance. In that way, it can be thought of 6 // combined to form a SyncSession instance. In that way, it can be thought of
7 // as an extension of the SyncSession type itself. Session scoping gives 7 // as an extension of the SyncSession type itself. Session scoping gives
8 // context to things like "conflict progress", "update progress", etc, and the 8 // context to things like "conflict progress", "update progress", etc, and the
9 // separation this file provides allows clients to only include the parts they 9 // separation this file provides allows clients to only include the parts they
10 // need rather than the entire session stack. 10 // need rather than the entire session stack.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 int num_updates_downloaded_total; 77 int num_updates_downloaded_total;
78 int num_tombstone_updates_downloaded_total; 78 int num_tombstone_updates_downloaded_total;
79 79
80 // If the syncer encountered a MIGRATION_DONE code, these are the types that 80 // If the syncer encountered a MIGRATION_DONE code, these are the types that
81 // the client must now "migrate", by purging and re-downloading all updates. 81 // the client must now "migrate", by purging and re-downloading all updates.
82 syncable::ModelTypeSet types_needing_local_migration; 82 syncable::ModelTypeSet types_needing_local_migration;
83 83
84 // Overwrites due to conflict resolution counters. 84 // Overwrites due to conflict resolution counters.
85 int num_local_overwrites; 85 int num_local_overwrites;
86 int num_server_overwrites; 86 int num_server_overwrites;
87
88 // True if the account is currently throttled.
89 bool throttled;
akalin 2011/05/13 22:01:42 we already store this state (it's called is_silenc
lipalani1 2011/05/13 22:35:39 Done.
87 }; 90 };
88 91
89 // Counters for various errors that can occur repeatedly during a sync session. 92 // Counters for various errors that can occur repeatedly during a sync session.
90 struct ErrorCounters { 93 struct ErrorCounters {
91 ErrorCounters(); 94 ErrorCounters();
92 95
93 // Caller takes ownership of the returned dictionary. 96 // Caller takes ownership of the returned dictionary.
94 DictionaryValue* ToValue() const; 97 DictionaryValue* ToValue() const;
95 98
96 int num_conflicting_commits; 99 int num_conflicting_commits;
(...skipping 23 matching lines...) Expand all
120 bool is_share_usable, 123 bool is_share_usable,
121 const syncable::ModelTypeBitSet& initial_sync_ended, 124 const syncable::ModelTypeBitSet& initial_sync_ended,
122 const std::string 125 const std::string
123 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT], 126 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT],
124 bool more_to_sync, 127 bool more_to_sync,
125 bool is_silenced, 128 bool is_silenced,
126 int64 unsynced_count, 129 int64 unsynced_count,
127 int num_blocking_conflicting_updates, 130 int num_blocking_conflicting_updates,
128 int num_conflicting_updates, 131 int num_conflicting_updates,
129 bool did_commit_items, 132 bool did_commit_items,
130 const SyncSourceInfo& source); 133 const SyncSourceInfo& source,
134 size_t num_entries);
131 ~SyncSessionSnapshot(); 135 ~SyncSessionSnapshot();
132 136
133 // Caller takes ownership of the returned dictionary. 137 // Caller takes ownership of the returned dictionary.
134 DictionaryValue* ToValue() const; 138 DictionaryValue* ToValue() const;
135 139
136 const SyncerStatus syncer_status; 140 const SyncerStatus syncer_status;
137 const ErrorCounters errors; 141 const ErrorCounters errors;
138 const int64 num_server_changes_remaining; 142 const int64 num_server_changes_remaining;
139 const bool is_share_usable; 143 const bool is_share_usable;
140 const syncable::ModelTypeBitSet initial_sync_ended; 144 const syncable::ModelTypeBitSet initial_sync_ended;
141 const std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 145 const std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
142 const bool has_more_to_sync; 146 const bool has_more_to_sync;
143 const bool is_silenced; 147 const bool is_silenced;
144 const int64 unsynced_count; 148 const int64 unsynced_count;
145 const int num_blocking_conflicting_updates; 149 const int num_blocking_conflicting_updates;
146 const int num_conflicting_updates; 150 const int num_conflicting_updates;
147 const bool did_commit_items; 151 const bool did_commit_items;
148 const SyncSourceInfo source; 152 const SyncSourceInfo source;
153 const size_t num_entries;
149 }; 154 };
150 155
151 // Tracks progress of conflicts and their resolution using conflict sets. 156 // Tracks progress of conflicts and their resolution using conflict sets.
152 class ConflictProgress { 157 class ConflictProgress {
153 public: 158 public:
154 explicit ConflictProgress(bool* dirty_flag); 159 explicit ConflictProgress(bool* dirty_flag);
155 ~ConflictProgress(); 160 ~ConflictProgress();
156 // Various iterators, size, and retrieval functions for conflict sets. 161 // Various iterators, size, and retrieval functions for conflict sets.
157 IdToConflictSetMap::const_iterator IdToConflictSetBegin() const; 162 IdToConflictSetMap::const_iterator IdToConflictSetBegin() const;
158 IdToConflictSetMap::const_iterator IdToConflictSetEnd() const; 163 IdToConflictSetMap::const_iterator IdToConflictSetEnd() const;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 ~PerModelSafeGroupState(); 328 ~PerModelSafeGroupState();
324 329
325 UpdateProgress update_progress; 330 UpdateProgress update_progress;
326 ConflictProgress conflict_progress; 331 ConflictProgress conflict_progress;
327 }; 332 };
328 333
329 } // namespace sessions 334 } // namespace sessions
330 } // namespace browser_sync 335 } // namespace browser_sync
331 336
332 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_ 337 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698