| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // consider passing around immutable references instead of values. | 27 // consider passing around immutable references instead of values. |
| 28 // Default copy and assign welcome. | 28 // Default copy and assign welcome. |
| 29 class SyncSessionSnapshot { | 29 class SyncSessionSnapshot { |
| 30 public: | 30 public: |
| 31 SyncSessionSnapshot(); | 31 SyncSessionSnapshot(); |
| 32 SyncSessionSnapshot( | 32 SyncSessionSnapshot( |
| 33 const ModelNeutralState& model_neutral_state, | 33 const ModelNeutralState& model_neutral_state, |
| 34 bool is_share_usable, | 34 bool is_share_usable, |
| 35 ModelTypeSet initial_sync_ended, | 35 ModelTypeSet initial_sync_ended, |
| 36 const ProgressMarkerMap& download_progress_markers, | 36 const ProgressMarkerMap& download_progress_markers, |
| 37 bool more_to_sync, | |
| 38 bool is_silenced, | 37 bool is_silenced, |
| 39 int num_encryption_conflicts, | 38 int num_encryption_conflicts, |
| 40 int num_hierarchy_conflicts, | 39 int num_hierarchy_conflicts, |
| 41 int num_simple_conflicts, | |
| 42 int num_server_conflicts, | 40 int num_server_conflicts, |
| 43 const SyncSourceInfo& source, | 41 const SyncSourceInfo& source, |
| 44 bool notifications_enabled, | 42 bool notifications_enabled, |
| 45 size_t num_entries, | 43 size_t num_entries, |
| 46 base::Time sync_start_time); | 44 base::Time sync_start_time); |
| 47 ~SyncSessionSnapshot(); | 45 ~SyncSessionSnapshot(); |
| 48 | 46 |
| 49 // Caller takes ownership of the returned dictionary. | 47 // Caller takes ownership of the returned dictionary. |
| 50 base::DictionaryValue* ToValue() const; | 48 base::DictionaryValue* ToValue() const; |
| 51 | 49 |
| 52 std::string ToString() const; | 50 std::string ToString() const; |
| 53 | 51 |
| 54 ModelNeutralState model_neutral_state() const { | 52 ModelNeutralState model_neutral_state() const { |
| 55 return model_neutral_state_; | 53 return model_neutral_state_; |
| 56 } | 54 } |
| 57 int64 num_server_changes_remaining() const; | 55 int64 num_server_changes_remaining() const; |
| 58 bool is_share_usable() const; | 56 bool is_share_usable() const; |
| 59 ModelTypeSet initial_sync_ended() const; | 57 ModelTypeSet initial_sync_ended() const; |
| 60 const ProgressMarkerMap& download_progress_markers() const; | 58 const ProgressMarkerMap& download_progress_markers() const; |
| 61 bool has_more_to_sync() const; | |
| 62 bool is_silenced() const; | 59 bool is_silenced() const; |
| 63 int num_encryption_conflicts() const; | 60 int num_encryption_conflicts() const; |
| 64 int num_hierarchy_conflicts() const; | 61 int num_hierarchy_conflicts() const; |
| 65 int num_simple_conflicts() const; | |
| 66 int num_server_conflicts() const; | 62 int num_server_conflicts() const; |
| 67 SyncSourceInfo source() const; | 63 SyncSourceInfo source() const; |
| 68 bool notifications_enabled() const; | 64 bool notifications_enabled() const; |
| 69 size_t num_entries() const; | 65 size_t num_entries() const; |
| 70 base::Time sync_start_time() const; | 66 base::Time sync_start_time() const; |
| 71 | 67 |
| 72 // Set iff this snapshot was not built using the default constructor. | 68 // Set iff this snapshot was not built using the default constructor. |
| 73 bool is_initialized() const; | 69 bool is_initialized() const; |
| 74 | 70 |
| 75 private: | 71 private: |
| 76 ModelNeutralState model_neutral_state_; | 72 ModelNeutralState model_neutral_state_; |
| 77 bool is_share_usable_; | 73 bool is_share_usable_; |
| 78 ModelTypeSet initial_sync_ended_; | 74 ModelTypeSet initial_sync_ended_; |
| 79 ProgressMarkerMap download_progress_markers_; | 75 ProgressMarkerMap download_progress_markers_; |
| 80 bool has_more_to_sync_; | |
| 81 bool is_silenced_; | 76 bool is_silenced_; |
| 82 int num_encryption_conflicts_; | 77 int num_encryption_conflicts_; |
| 83 int num_hierarchy_conflicts_; | 78 int num_hierarchy_conflicts_; |
| 84 int num_simple_conflicts_; | |
| 85 int num_server_conflicts_; | 79 int num_server_conflicts_; |
| 86 SyncSourceInfo source_; | 80 SyncSourceInfo source_; |
| 87 bool notifications_enabled_; | 81 bool notifications_enabled_; |
| 88 size_t num_entries_; | 82 size_t num_entries_; |
| 89 base::Time sync_start_time_; | 83 base::Time sync_start_time_; |
| 90 | 84 |
| 91 bool is_initialized_; | 85 bool is_initialized_; |
| 92 }; | 86 }; |
| 93 | 87 |
| 94 } // namespace sessions | 88 } // namespace sessions |
| 95 } // namespace syncer | 89 } // namespace syncer |
| 96 | 90 |
| 97 #endif // SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ | 91 #endif // SYNC_INTERNAL_API_PUBLIC_SESSIONS_SYNC_SESSION_SNAPSHOT_H_ |
| OLD | NEW |