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

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

Issue 7621085: Server directed error handling backend code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 4 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.
11 11
12 #ifndef CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_ 12 #ifndef CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_
13 #define CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_ 13 #define CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_
14 #pragma once 14 #pragma once
15 15
16 #include <map> 16 #include <map>
17 #include <set> 17 #include <set>
18 #include <string> 18 #include <string>
19 #include <utility> 19 #include <utility>
20 #include <vector> 20 #include <vector>
21 21
22 #include "base/basictypes.h" 22 #include "base/basictypes.h"
23 #include "chrome/browser/sync/engine/syncer_types.h" 23 #include "chrome/browser/sync/engine/syncer_types.h"
24 #include "chrome/browser/sync/engine/syncproto.h" 24 #include "chrome/browser/sync/engine/syncproto.h"
25 #include "chrome/browser/sync/engine/sync_error.h"
25 #include "chrome/browser/sync/sessions/ordered_commit_set.h" 26 #include "chrome/browser/sync/sessions/ordered_commit_set.h"
26 #include "chrome/browser/sync/syncable/model_type.h" 27 #include "chrome/browser/sync/syncable/model_type.h"
27 #include "chrome/browser/sync/syncable/model_type_payload_map.h" 28 #include "chrome/browser/sync/syncable/model_type_payload_map.h"
28 #include "chrome/browser/sync/syncable/syncable.h" 29 #include "chrome/browser/sync/syncable/syncable.h"
29 30
30 namespace base { 31 namespace base {
31 class DictionaryValue; 32 class DictionaryValue;
32 } 33 }
33 34
34 namespace syncable { 35 namespace syncable {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const std::string 125 const std::string
125 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT], 126 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT],
126 bool more_to_sync, 127 bool more_to_sync,
127 bool is_silenced, 128 bool is_silenced,
128 int64 unsynced_count, 129 int64 unsynced_count,
129 int num_blocking_conflicting_updates, 130 int num_blocking_conflicting_updates,
130 int num_conflicting_updates, 131 int num_conflicting_updates,
131 bool did_commit_items, 132 bool did_commit_items,
132 const SyncSourceInfo& source, 133 const SyncSourceInfo& source,
133 size_t num_entries, 134 size_t num_entries,
134 base::Time sync_start_time); 135 base::Time sync_start_time,
136 sync_api::SyncError sync_error);
135 ~SyncSessionSnapshot(); 137 ~SyncSessionSnapshot();
136 138
137 // Caller takes ownership of the returned dictionary. 139 // Caller takes ownership of the returned dictionary.
138 base::DictionaryValue* ToValue() const; 140 base::DictionaryValue* ToValue() const;
139 141
140 std::string ToString() const; 142 std::string ToString() const;
141 143
142 const SyncerStatus syncer_status; 144 const SyncerStatus syncer_status;
143 const ErrorCounters errors; 145 const ErrorCounters errors;
144 const int64 num_server_changes_remaining; 146 const int64 num_server_changes_remaining;
145 const bool is_share_usable; 147 const bool is_share_usable;
146 const syncable::ModelTypeBitSet initial_sync_ended; 148 const syncable::ModelTypeBitSet initial_sync_ended;
147 const std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; 149 const std::string download_progress_markers[syncable::MODEL_TYPE_COUNT];
148 const bool has_more_to_sync; 150 const bool has_more_to_sync;
149 const bool is_silenced; 151 const bool is_silenced;
150 const int64 unsynced_count; 152 const int64 unsynced_count;
151 const int num_blocking_conflicting_updates; 153 const int num_blocking_conflicting_updates;
152 const int num_conflicting_updates; 154 const int num_conflicting_updates;
153 const bool did_commit_items; 155 const bool did_commit_items;
154 const SyncSourceInfo source; 156 const SyncSourceInfo source;
155 const size_t num_entries; 157 const size_t num_entries;
156 base::Time sync_start_time; 158 base::Time sync_start_time;
159 sync_api::SyncError sync_error;
157 }; 160 };
158 161
159 // Tracks progress of conflicts and their resolution using conflict sets. 162 // Tracks progress of conflicts and their resolution using conflict sets.
160 class ConflictProgress { 163 class ConflictProgress {
161 public: 164 public:
162 explicit ConflictProgress(bool* dirty_flag); 165 explicit ConflictProgress(bool* dirty_flag);
163 ~ConflictProgress(); 166 ~ConflictProgress();
164 // Various iterators, size, and retrieval functions for conflict sets. 167 // Various iterators, size, and retrieval functions for conflict sets.
165 IdToConflictSetMap::const_iterator IdToConflictSetBegin() const; 168 IdToConflictSetMap::const_iterator IdToConflictSetBegin() const;
166 IdToConflictSetMap::const_iterator IdToConflictSetEnd() const; 169 IdToConflictSetMap::const_iterator IdToConflictSetEnd() const;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // We GetUpdates for some combination of types at once. 319 // We GetUpdates for some combination of types at once.
317 // requested_update_types stores the set of types which were requested. 320 // requested_update_types stores the set of types which were requested.
318 syncable::ModelTypeBitSet updates_request_types; 321 syncable::ModelTypeBitSet updates_request_types;
319 ClientToServerResponse updates_response; 322 ClientToServerResponse updates_response;
320 // Used to build the shared commit message. 323 // Used to build the shared commit message.
321 DirtyOnWrite<std::vector<int64> > unsynced_handles; 324 DirtyOnWrite<std::vector<int64> > unsynced_handles;
322 DirtyOnWrite<SyncerStatus> syncer_status; 325 DirtyOnWrite<SyncerStatus> syncer_status;
323 DirtyOnWrite<ErrorCounters> error_counters; 326 DirtyOnWrite<ErrorCounters> error_counters;
324 SyncCycleControlParameters control_params; 327 SyncCycleControlParameters control_params;
325 DirtyOnWrite<int64> num_server_changes_remaining; 328 DirtyOnWrite<int64> num_server_changes_remaining;
329 DirtyOnWrite<sync_api::SyncError> sync_error;
326 OrderedCommitSet commit_set; 330 OrderedCommitSet commit_set;
327 }; 331 };
328 332
329 // Grouping of all state that applies to a single ModelSafeGroup. 333 // Grouping of all state that applies to a single ModelSafeGroup.
330 struct PerModelSafeGroupState { 334 struct PerModelSafeGroupState {
331 explicit PerModelSafeGroupState(bool* dirty_flag); 335 explicit PerModelSafeGroupState(bool* dirty_flag);
332 ~PerModelSafeGroupState(); 336 ~PerModelSafeGroupState();
333 337
334 UpdateProgress update_progress; 338 UpdateProgress update_progress;
335 ConflictProgress conflict_progress; 339 ConflictProgress conflict_progress;
336 }; 340 };
337 341
338 } // namespace sessions 342 } // namespace sessions
339 } // namespace browser_sync 343 } // namespace browser_sync
340 344
341 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_ 345 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698