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

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

Issue 5939006: sync: beginnings of MessageLoop based SyncerThread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: linux compile Created 9 years, 11 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 14 matching lines...) Expand all
25 25
26 namespace syncable { 26 namespace syncable {
27 class DirectoryManager; 27 class DirectoryManager;
28 } 28 }
29 29
30 namespace browser_sync { 30 namespace browser_sync {
31 namespace sessions { 31 namespace sessions {
32 32
33 class UpdateProgress; 33 class UpdateProgress;
34 34
35 typedef std::pair<sync_pb::GetUpdatesCallerInfo::GetUpdatesSource,
36 syncable::ModelTypeBitSet> SyncSourceInfo;
37
35 // Data pertaining to the status of an active Syncer object. 38 // Data pertaining to the status of an active Syncer object.
36 struct SyncerStatus { 39 struct SyncerStatus {
37 SyncerStatus(); 40 SyncerStatus();
38 41
39 // True when we get such an INVALID_STORE error from the server. 42 // True when we get such an INVALID_STORE error from the server.
40 bool invalid_store; 43 bool invalid_store;
41 // True iff we're stuck. 44 // True iff we're stuck.
42 bool syncer_stuck; 45 bool syncer_stuck;
43 bool syncing; 46 bool syncing;
44 int num_successful_commits; 47 int num_successful_commits;
(...skipping 27 matching lines...) Expand all
72 const SyncerStatus& syncer_status, 75 const SyncerStatus& syncer_status,
73 const ErrorCounters& errors, 76 const ErrorCounters& errors,
74 int64 num_server_changes_remaining, 77 int64 num_server_changes_remaining,
75 bool is_share_usable, 78 bool is_share_usable,
76 const syncable::ModelTypeBitSet& initial_sync_ended, 79 const syncable::ModelTypeBitSet& initial_sync_ended,
77 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT], 80 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT],
78 bool more_to_sync, 81 bool more_to_sync,
79 bool is_silenced, 82 bool is_silenced,
80 int64 unsynced_count, 83 int64 unsynced_count,
81 int num_conflicting_updates, 84 int num_conflicting_updates,
82 bool did_commit_items); 85 bool did_commit_items,
86 const SyncSourceInfo& source);
83 ~SyncSessionSnapshot(); 87 ~SyncSessionSnapshot();
84 88
85 const SyncerStatus syncer_status; 89 const SyncerStatus syncer_status;
86 const ErrorCounters errors; 90 const ErrorCounters errors;
87 const int64 num_server_changes_remaining; 91 const int64 num_server_changes_remaining;
88 const bool is_share_usable; 92 const bool is_share_usable;
89 const syncable::ModelTypeBitSet initial_sync_ended; 93 const syncable::ModelTypeBitSet initial_sync_ended;
90 const std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 94 const std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
91 const bool has_more_to_sync; 95 const bool has_more_to_sync;
92 const bool is_silenced; 96 const bool is_silenced;
93 const int64 unsynced_count; 97 const int64 unsynced_count;
94 const int num_conflicting_updates; 98 const int num_conflicting_updates;
95 const bool did_commit_items; 99 const bool did_commit_items;
100 const SyncSourceInfo source;
96 }; 101 };
97 102
98 // Tracks progress of conflicts and their resolution using conflict sets. 103 // Tracks progress of conflicts and their resolution using conflict sets.
99 class ConflictProgress { 104 class ConflictProgress {
100 public: 105 public:
101 explicit ConflictProgress(bool* dirty_flag); 106 explicit ConflictProgress(bool* dirty_flag);
102 ~ConflictProgress(); 107 ~ConflictProgress();
103 // Various iterators, size, and retrieval functions for conflict sets. 108 // Various iterators, size, and retrieval functions for conflict sets.
104 IdToConflictSetMap::const_iterator IdToConflictSetBegin() const; 109 IdToConflictSetMap::const_iterator IdToConflictSetBegin() const;
105 IdToConflictSetMap::const_iterator IdToConflictSetEnd() const; 110 IdToConflictSetMap::const_iterator IdToConflictSetEnd() const;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 ~PerModelSafeGroupState(); 255 ~PerModelSafeGroupState();
251 256
252 UpdateProgress update_progress; 257 UpdateProgress update_progress;
253 ConflictProgress conflict_progress; 258 ConflictProgress conflict_progress;
254 }; 259 };
255 260
256 } // namespace sessions 261 } // namespace sessions
257 } // namespace browser_sync 262 } // namespace browser_sync
258 263
259 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_ 264 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_types.h ('k') | chrome/browser/sync/sessions/session_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698