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

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

Issue 7861013: Fix the false-positive detection of commit errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another attempt at detecting errors Created 9 years, 2 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 10 matching lines...) Expand all
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/sessions/ordered_commit_set.h" 25 #include "chrome/browser/sync/sessions/ordered_commit_set.h"
26 #include "chrome/browser/sync/protocol/sync_protocol_error.h" 26 #include "chrome/browser/sync/protocol/sync_protocol_error.h"
27 #include "chrome/browser/sync/syncable/model_type.h" 27 #include "chrome/browser/sync/syncable/model_type.h"
28 #include "chrome/browser/sync/syncable/model_type_payload_map.h" 28 #include "chrome/browser/sync/syncable/model_type_payload_map.h"
29 #include "chrome/browser/sync/syncable/syncable.h" 29 #include "chrome/browser/sync/syncable/syncable.h"
30 30
31 #include "chrome/browser/sync/engine/syncer_proto_util.h"
32
31 namespace base { 33 namespace base {
32 class DictionaryValue; 34 class DictionaryValue;
33 } 35 }
34 36
35 namespace syncable { 37 namespace syncable {
36 class DirectoryManager; 38 class DirectoryManager;
37 } 39 }
38 40
39 namespace browser_sync { 41 namespace browser_sync {
40 namespace sessions { 42 namespace sessions {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Number of commits hitting transient errors since the last successful 104 // Number of commits hitting transient errors since the last successful
103 // commit. 105 // commit.
104 int consecutive_transient_error_commits; 106 int consecutive_transient_error_commits;
105 107
106 // Incremented when get_updates fails, commit fails, and when hitting 108 // Incremented when get_updates fails, commit fails, and when hitting
107 // transient errors. When any of these succeed, this counter is reset. 109 // transient errors. When any of these succeed, this counter is reset.
108 // TODO(chron): Reduce number of weird counters we use. 110 // TODO(chron): Reduce number of weird counters we use.
109 int consecutive_errors; 111 int consecutive_errors;
110 112
111 // Any protocol errors that we received during this sync session. 113 // Any protocol errors that we received during this sync session.
112 SyncProtocolError sync_protocol_error; 114 SyncOperationResult sync_protocol_error; // FIXME: umm... really? Is this use d?
113 }; 115 };
114 116
115 // Caller takes ownership of the returned dictionary. 117 // Caller takes ownership of the returned dictionary.
116 base::DictionaryValue* DownloadProgressMarkersToValue( 118 base::DictionaryValue* DownloadProgressMarkersToValue(
117 const std::string 119 const std::string
118 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT]); 120 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT]);
119 121
120 // An immutable snapshot of state from a SyncSession. Convenient to use as 122 // An immutable snapshot of state from a SyncSession. Convenient to use as
121 // part of notifications as it is inherently thread-safe. 123 // part of notifications as it is inherently thread-safe.
122 struct SyncSessionSnapshot { 124 struct SyncSessionSnapshot {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 explicit AllModelTypeState(bool* dirty_flag); 317 explicit AllModelTypeState(bool* dirty_flag);
316 ~AllModelTypeState(); 318 ~AllModelTypeState();
317 319
318 // Commits for all model types are bundled together into a single message. 320 // Commits for all model types are bundled together into a single message.
319 ClientToServerMessage commit_message; 321 ClientToServerMessage commit_message;
320 ClientToServerResponse commit_response; 322 ClientToServerResponse commit_response;
321 // We GetUpdates for some combination of types at once. 323 // We GetUpdates for some combination of types at once.
322 // requested_update_types stores the set of types which were requested. 324 // requested_update_types stores the set of types which were requested.
323 syncable::ModelTypeBitSet updates_request_types; 325 syncable::ModelTypeBitSet updates_request_types;
324 ClientToServerResponse updates_response; 326 ClientToServerResponse updates_response;
327
328 // FIXME: move these to error counters?
329 SyncOperationResult last_download_updates_result;
330 SyncOperationResult last_post_commit_result;
331 SyncOperationResult last_clear_data_result;
332
325 // Used to build the shared commit message. 333 // Used to build the shared commit message.
326 DirtyOnWrite<std::vector<int64> > unsynced_handles; 334 DirtyOnWrite<std::vector<int64> > unsynced_handles;
327 DirtyOnWrite<SyncerStatus> syncer_status; 335 DirtyOnWrite<SyncerStatus> syncer_status;
328 DirtyOnWrite<ErrorCounters> error; 336 DirtyOnWrite<ErrorCounters> error;
329 SyncCycleControlParameters control_params; 337 SyncCycleControlParameters control_params;
330 DirtyOnWrite<int64> num_server_changes_remaining; 338 DirtyOnWrite<int64> num_server_changes_remaining;
331 OrderedCommitSet commit_set; 339 OrderedCommitSet commit_set;
332 }; 340 };
333 341
334 // Grouping of all state that applies to a single ModelSafeGroup. 342 // Grouping of all state that applies to a single ModelSafeGroup.
335 struct PerModelSafeGroupState { 343 struct PerModelSafeGroupState {
336 explicit PerModelSafeGroupState(bool* dirty_flag); 344 explicit PerModelSafeGroupState(bool* dirty_flag);
337 ~PerModelSafeGroupState(); 345 ~PerModelSafeGroupState();
338 346
339 UpdateProgress update_progress; 347 UpdateProgress update_progress;
340 ConflictProgress conflict_progress; 348 ConflictProgress conflict_progress;
341 }; 349 };
342 350
343 } // namespace sessions 351 } // namespace sessions
344 } // namespace browser_sync 352 } // namespace browser_sync
345 353
346 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_ 354 #endif // CHROME_BROWSER_SYNC_SESSIONS_SESSION_STATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/protocol/sync_protocol_error.cc ('k') | chrome/browser/sync/sessions/status_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698