OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 // SyncSessionContext encapsulates the contextual information and engine | 5 // SyncSessionContext encapsulates the contextual information and engine |
6 // components specific to a SyncSession. Unlike the SyncSession, the context | 6 // components specific to a SyncSession. Unlike the SyncSession, the context |
7 // can be reused across several sync cycles. | 7 // can be reused across several sync cycles. |
8 // | 8 // |
9 // The context does not take ownership of its pointer members. It's up to | 9 // The context does not take ownership of its pointer members. It's up to |
10 // the surrounding classes to ensure those members remain valid while the | 10 // the surrounding classes to ensure those members remain valid while the |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 DCHECK(account_name_.empty()); | 83 DCHECK(account_name_.empty()); |
84 account_name_ = name; | 84 account_name_ = name; |
85 } | 85 } |
86 const std::string& account_name() const { return account_name_; } | 86 const std::string& account_name() const { return account_name_; } |
87 | 87 |
88 void set_max_commit_batch_size(int batch_size) { | 88 void set_max_commit_batch_size(int batch_size) { |
89 max_commit_batch_size_ = batch_size; | 89 max_commit_batch_size_ = batch_size; |
90 } | 90 } |
91 int32 max_commit_batch_size() const { return max_commit_batch_size_; } | 91 int32 max_commit_batch_size() const { return max_commit_batch_size_; } |
92 | 92 |
93 ObserverList<SyncEngineEventListener>* listeners() { | 93 base::ObserverList<SyncEngineEventListener>* listeners() { |
94 return &listeners_; | 94 return &listeners_; |
95 } | 95 } |
96 | 96 |
97 bool keystore_encryption_enabled() const { | 97 bool keystore_encryption_enabled() const { |
98 return keystore_encryption_enabled_; | 98 return keystore_encryption_enabled_; |
99 } | 99 } |
100 | 100 |
101 void set_hierarchy_conflict_detected(bool value) { | 101 void set_hierarchy_conflict_detected(bool value) { |
102 client_status_.set_hierarchy_conflict_detected(value); | 102 client_status_.set_hierarchy_conflict_detected(value); |
103 } | 103 } |
(...skipping 18 matching lines...) Expand all Loading... |
122 ModelTypeRegistry* model_type_registry() { | 122 ModelTypeRegistry* model_type_registry() { |
123 return model_type_registry_; | 123 return model_type_registry_; |
124 } | 124 } |
125 | 125 |
126 private: | 126 private: |
127 // Rather than force clients to set and null-out various context members, we | 127 // Rather than force clients to set and null-out various context members, we |
128 // extend our encapsulation boundary to scoped helpers that take care of this | 128 // extend our encapsulation boundary to scoped helpers that take care of this |
129 // once they are allocated. See definitions of these below. | 129 // once they are allocated. See definitions of these below. |
130 friend class TestScopedSessionEventListener; | 130 friend class TestScopedSessionEventListener; |
131 | 131 |
132 ObserverList<SyncEngineEventListener> listeners_; | 132 base::ObserverList<SyncEngineEventListener> listeners_; |
133 | 133 |
134 ServerConnectionManager* const connection_manager_; | 134 ServerConnectionManager* const connection_manager_; |
135 syncable::Directory* const directory_; | 135 syncable::Directory* const directory_; |
136 | 136 |
137 // We use this to stuff extensions activity into CommitMessages so the server | 137 // We use this to stuff extensions activity into CommitMessages so the server |
138 // can correlate commit traffic with extension-related bookmark mutations. | 138 // can correlate commit traffic with extension-related bookmark mutations. |
139 scoped_refptr<ExtensionsActivity> extensions_activity_; | 139 scoped_refptr<ExtensionsActivity> extensions_activity_; |
140 | 140 |
141 // Kept up to date with talk events to determine whether notifications are | 141 // Kept up to date with talk events to determine whether notifications are |
142 // enabled. True only if the notification channel is authorized and open. | 142 // enabled. True only if the notification channel is authorized and open. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // enable the pre-commit update avoidance experiment described above. | 177 // enable the pre-commit update avoidance experiment described above. |
178 const bool client_enabled_pre_commit_update_avoidance_; | 178 const bool client_enabled_pre_commit_update_avoidance_; |
179 | 179 |
180 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); | 180 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace sessions | 183 } // namespace sessions |
184 } // namespace syncer | 184 } // namespace syncer |
185 | 185 |
186 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 186 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
OLD | NEW |