Roll src/third_party/WebKit 96fb88b:6bbd108 (svn 201045:201047)
[chromium-blink-merge.git] / sync / internal_api / public / sessions / model_neutral_state.h
blob8d97f8936548535728b3b9b285d50c208a42ef2c
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H
6 #define SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H
8 #include "base/basictypes.h"
9 #include "sync/base/sync_export.h"
10 #include "sync/internal_api/public/base/model_type.h"
11 #include "sync/internal_api/public/util/syncer_error.h"
12 #include "sync/protocol/sync.pb.h"
14 namespace syncer {
15 namespace sessions {
17 // Grouping of all state that applies to all model types. Note that some
18 // components of the global grouping can internally implement finer grained
19 // scope control, but the top level entity is still a singleton with respect to
20 // model types.
21 struct SYNC_EXPORT ModelNeutralState {
22 ModelNeutralState();
23 ~ModelNeutralState();
25 // The set of types for which commits were sent to the server.
26 ModelTypeSet commit_request_types;
28 int num_successful_commits;
30 // This is needed for monitoring extensions activity.
31 int num_successful_bookmark_commits;
33 // Download event counters.
34 int num_updates_downloaded_total;
35 int num_tombstone_updates_downloaded_total;
36 int num_reflected_updates_downloaded_total;
38 // Update application and conflicts.
39 int num_updates_applied;
40 int num_encryption_conflicts;
41 int num_server_conflicts;
42 int num_hierarchy_conflicts;
44 // Overwrites due to conflict resolution counters.
45 int num_local_overwrites;
46 int num_server_overwrites;
48 // Records the most recent results of GetKey, PostCommit and GetUpdates
49 // commands.
50 SyncerError last_get_key_result;
51 SyncerError last_download_updates_result;
52 SyncerError commit_result;
54 // Set to true by PostCommitMessageCommand if any commits were successful.
55 bool items_committed;
58 bool HasSyncerError(const ModelNeutralState& state);
60 } // namespace sessions
61 } // namespace syncer
63 #endif // SYNC_SESSIONS_MODEL_NEUTRAL_STATE_H_