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 |
11 // context is in use. | 11 // context is in use. |
12 // | 12 // |
13 // It can only be used from the SyncerThread. | 13 // It can only be used from the SyncerThread. |
14 | 14 |
15 #ifndef SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 15 #ifndef SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
16 #define SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 16 #define SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
17 | 17 |
| 18 #include <stdint.h> |
| 19 |
18 #include <string> | 20 #include <string> |
19 #include <vector> | 21 #include <vector> |
20 | 22 |
| 23 #include "base/macros.h" |
21 #include "sync/base/sync_export.h" | 24 #include "sync/base/sync_export.h" |
22 #include "sync/engine/sync_engine_event_listener.h" | 25 #include "sync/engine/sync_engine_event_listener.h" |
23 #include "sync/sessions/debug_info_getter.h" | 26 #include "sync/sessions/debug_info_getter.h" |
24 #include "sync/sessions/model_type_registry.h" | 27 #include "sync/sessions/model_type_registry.h" |
25 | 28 |
26 namespace syncer { | 29 namespace syncer { |
27 | 30 |
28 class ExtensionsActivity; | 31 class ExtensionsActivity; |
29 class ModelTypeRegistry; | 32 class ModelTypeRegistry; |
30 class ServerConnectionManager; | 33 class ServerConnectionManager; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Account name, set once a directory has been opened. | 85 // Account name, set once a directory has been opened. |
83 void set_account_name(const std::string& name) { | 86 void set_account_name(const std::string& name) { |
84 DCHECK(account_name_.empty()); | 87 DCHECK(account_name_.empty()); |
85 account_name_ = name; | 88 account_name_ = name; |
86 } | 89 } |
87 const std::string& account_name() const { return account_name_; } | 90 const std::string& account_name() const { return account_name_; } |
88 | 91 |
89 void set_max_commit_batch_size(int batch_size) { | 92 void set_max_commit_batch_size(int batch_size) { |
90 max_commit_batch_size_ = batch_size; | 93 max_commit_batch_size_ = batch_size; |
91 } | 94 } |
92 int32 max_commit_batch_size() const { return max_commit_batch_size_; } | 95 int32_t max_commit_batch_size() const { return max_commit_batch_size_; } |
93 | 96 |
94 base::ObserverList<SyncEngineEventListener>* listeners() { | 97 base::ObserverList<SyncEngineEventListener>* listeners() { |
95 return &listeners_; | 98 return &listeners_; |
96 } | 99 } |
97 | 100 |
98 bool keystore_encryption_enabled() const { | 101 bool keystore_encryption_enabled() const { |
99 return keystore_encryption_enabled_; | 102 return keystore_encryption_enabled_; |
100 } | 103 } |
101 | 104 |
102 void set_hierarchy_conflict_detected(bool value) { | 105 void set_hierarchy_conflict_detected(bool value) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // enable the pre-commit update avoidance experiment described above. | 181 // enable the pre-commit update avoidance experiment described above. |
179 const bool client_enabled_pre_commit_update_avoidance_; | 182 const bool client_enabled_pre_commit_update_avoidance_; |
180 | 183 |
181 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); | 184 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); |
182 }; | 185 }; |
183 | 186 |
184 } // namespace sessions | 187 } // namespace sessions |
185 } // namespace syncer | 188 } // namespace syncer |
186 | 189 |
187 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 190 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
OLD | NEW |