| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool cookie_jar_mismatch() const { | 129 bool cookie_jar_mismatch() const { |
| 130 return cookie_jar_mismatch_; | 130 return cookie_jar_mismatch_; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void set_cookie_jar_mismatch(bool cookie_jar_mismatch) { | 133 void set_cookie_jar_mismatch(bool cookie_jar_mismatch) { |
| 134 cookie_jar_mismatch_ = cookie_jar_mismatch; | 134 cookie_jar_mismatch_ = cookie_jar_mismatch; |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool cookie_jar_empty() const { return cookie_jar_empty_; } |
| 138 |
| 139 void set_cookie_jar_empty(bool empty_jar) { cookie_jar_empty_ = empty_jar; } |
| 140 |
| 137 private: | 141 private: |
| 138 // Rather than force clients to set and null-out various context members, we | 142 // Rather than force clients to set and null-out various context members, we |
| 139 // extend our encapsulation boundary to scoped helpers that take care of this | 143 // extend our encapsulation boundary to scoped helpers that take care of this |
| 140 // once they are allocated. See definitions of these below. | 144 // once they are allocated. See definitions of these below. |
| 141 friend class TestScopedSessionEventListener; | 145 friend class TestScopedSessionEventListener; |
| 142 | 146 |
| 143 base::ObserverList<SyncEngineEventListener> listeners_; | 147 base::ObserverList<SyncEngineEventListener> listeners_; |
| 144 | 148 |
| 145 ServerConnectionManager* const connection_manager_; | 149 ServerConnectionManager* const connection_manager_; |
| 146 syncable::Directory* const directory_; | 150 syncable::Directory* const directory_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 190 |
| 187 // If true, indicates that we've been passed a command-line flag to force | 191 // If true, indicates that we've been passed a command-line flag to force |
| 188 // enable the pre-commit update avoidance experiment described above. | 192 // enable the pre-commit update avoidance experiment described above. |
| 189 const bool client_enabled_pre_commit_update_avoidance_; | 193 const bool client_enabled_pre_commit_update_avoidance_; |
| 190 | 194 |
| 191 // Whether the account(s) present in the content area's cookie jar match the | 195 // Whether the account(s) present in the content area's cookie jar match the |
| 192 // chrome account. If multiple accounts are present in the cookie jar, a | 196 // chrome account. If multiple accounts are present in the cookie jar, a |
| 193 // mismatch implies all of them are different from the chrome account. | 197 // mismatch implies all of them are different from the chrome account. |
| 194 bool cookie_jar_mismatch_; | 198 bool cookie_jar_mismatch_; |
| 195 | 199 |
| 200 // If there's a cookie jar mismatch, whether the cookie jar was empty or not. |
| 201 bool cookie_jar_empty_; |
| 202 |
| 196 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); | 203 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); |
| 197 }; | 204 }; |
| 198 | 205 |
| 199 } // namespace sessions | 206 } // namespace sessions |
| 200 } // namespace syncer | 207 } // namespace syncer |
| 201 | 208 |
| 202 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 209 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
| OLD | NEW |