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 // SyncSessionContext encapsulates the contextual information and engine | 5 // SyncSessionContext encapsulates the contextual information and engine |
6 // components specific to a SyncSession. A context is accessible via | 6 // components specific to a SyncSession. A context is accessible via |
7 // a SyncSession so that session SyncerCommands and parts of the engine have | 7 // a SyncSession so that session SyncerCommands and parts of the engine have |
8 // a convenient way to access other parts. In this way it can be thought of as | 8 // a convenient way to access other parts. In this way it can be thought of as |
9 // the surrounding environment for the SyncSession. The components of this | 9 // the surrounding environment for the SyncSession. The components of this |
10 // environment are either valid or not valid for the entire context lifetime, | 10 // environment are either valid or not valid for the entire context lifetime, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 DCHECK(account_name_.empty()); | 102 DCHECK(account_name_.empty()); |
103 account_name_ = name; | 103 account_name_ = name; |
104 } | 104 } |
105 const std::string& account_name() const { return account_name_; } | 105 const std::string& account_name() const { return account_name_; } |
106 | 106 |
107 void set_max_commit_batch_size(int batch_size) { | 107 void set_max_commit_batch_size(int batch_size) { |
108 max_commit_batch_size_ = batch_size; | 108 max_commit_batch_size_ = batch_size; |
109 } | 109 } |
110 int32 max_commit_batch_size() const { return max_commit_batch_size_; } | 110 int32 max_commit_batch_size() const { return max_commit_batch_size_; } |
111 | 111 |
112 const ModelSafeRoutingInfo& previous_session_routing_info() const { | |
113 return previous_session_routing_info_; | |
114 } | |
115 | |
116 void set_previous_session_routing_info(const ModelSafeRoutingInfo& info) { | |
117 previous_session_routing_info_ = info; | |
118 } | |
119 | |
120 void NotifyListeners(const SyncEngineEvent& event) { | 112 void NotifyListeners(const SyncEngineEvent& event) { |
121 FOR_EACH_OBSERVER(SyncEngineEventListener, listeners_, | 113 FOR_EACH_OBSERVER(SyncEngineEventListener, listeners_, |
122 OnSyncEngineEvent(event)); | 114 OnSyncEngineEvent(event)); |
123 } | 115 } |
124 | 116 |
125 TrafficRecorder* traffic_recorder() { | 117 TrafficRecorder* traffic_recorder() { |
126 return traffic_recorder_; | 118 return traffic_recorder_; |
127 } | 119 } |
128 | 120 |
129 private: | 121 private: |
(...skipping 25 matching lines...) Expand all Loading... |
155 // Kept up to date with talk events to determine whether notifications are | 147 // Kept up to date with talk events to determine whether notifications are |
156 // enabled. True only if the notification channel is authorized and open. | 148 // enabled. True only if the notification channel is authorized and open. |
157 bool notifications_enabled_; | 149 bool notifications_enabled_; |
158 | 150 |
159 // The name of the account being synced. | 151 // The name of the account being synced. |
160 std::string account_name_; | 152 std::string account_name_; |
161 | 153 |
162 // The server limits the number of items a client can commit in one batch. | 154 // The server limits the number of items a client can commit in one batch. |
163 int max_commit_batch_size_; | 155 int max_commit_batch_size_; |
164 | 156 |
165 // Some routing info history to help us clean up types that get disabled | |
166 // by the user. | |
167 ModelSafeRoutingInfo previous_session_routing_info_; | |
168 | |
169 ThrottledDataTypeTracker* throttled_data_type_tracker_; | 157 ThrottledDataTypeTracker* throttled_data_type_tracker_; |
170 | 158 |
171 // We use this to get debug info to send to the server for debugging | 159 // We use this to get debug info to send to the server for debugging |
172 // client behavior on server side. | 160 // client behavior on server side. |
173 DebugInfoGetter* const debug_info_getter_; | 161 DebugInfoGetter* const debug_info_getter_; |
174 | 162 |
175 TrafficRecorder* traffic_recorder_; | 163 TrafficRecorder* traffic_recorder_; |
176 | 164 |
177 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); | 165 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); |
178 }; | 166 }; |
(...skipping 18 matching lines...) Expand all Loading... |
197 private: | 185 private: |
198 SyncSessionContext* context_; | 186 SyncSessionContext* context_; |
199 ConflictResolver* resolver_; | 187 ConflictResolver* resolver_; |
200 DISALLOW_COPY_AND_ASSIGN(ScopedSessionContextConflictResolver); | 188 DISALLOW_COPY_AND_ASSIGN(ScopedSessionContextConflictResolver); |
201 }; | 189 }; |
202 | 190 |
203 } // namespace sessions | 191 } // namespace sessions |
204 } // namespace syncer | 192 } // namespace syncer |
205 | 193 |
206 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 194 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
OLD | NEW |