| 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 // SyncCycleContext encapsulates the contextual information and engine | |
| 6 // components specific to a SyncCycle. Unlike the SyncCycle, the context | |
| 7 // can be reused across several sync cycles. | |
| 8 // | |
| 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 | |
| 11 // context is in use. | |
| 12 // | |
| 13 // It can only be used from the SyncerThread. | |
| 14 | |
| 15 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_CONTEXT_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_CONTEXT_H_ |
| 16 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_CONTEXT_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_CONTEXT_H_ |
| 17 | 7 |
| 18 #include <stdint.h> | 8 #include <stdint.h> |
| 19 | 9 |
| 20 #include <string> | 10 #include <string> |
| 21 #include <vector> | 11 #include <vector> |
| 22 | 12 |
| 23 #include "base/macros.h" | 13 #include "base/macros.h" |
| 24 #include "components/sync/engine_impl/cycle/debug_info_getter.h" | 14 #include "components/sync/engine_impl/cycle/debug_info_getter.h" |
| 25 #include "components/sync/engine_impl/model_type_registry.h" | 15 #include "components/sync/engine_impl/model_type_registry.h" |
| 26 #include "components/sync/engine_impl/sync_engine_event_listener.h" | 16 #include "components/sync/engine_impl/sync_engine_event_listener.h" |
| 27 | 17 |
| 28 namespace syncer { | 18 namespace syncer { |
| 29 | 19 |
| 30 class ExtensionsActivity; | 20 class ExtensionsActivity; |
| 31 class ModelTypeRegistry; | 21 class ModelTypeRegistry; |
| 32 class ServerConnectionManager; | 22 class ServerConnectionManager; |
| 33 | 23 |
| 34 namespace syncable { | 24 namespace syncable { |
| 35 class Directory; | 25 class Directory; |
| 36 } | 26 } |
| 37 | 27 |
| 38 // Default number of items a client can commit in a single message. | 28 // Default number of items a client can commit in a single message. |
| 39 static const int kDefaultMaxCommitBatchSize = 25; | 29 static const int kDefaultMaxCommitBatchSize = 25; |
| 40 | 30 |
| 31 // SyncCycleContext encapsulates the contextual information and engine |
| 32 // components specific to a SyncCycle. Unlike the SyncCycle, the context |
| 33 // can be reused across several sync cycles. |
| 34 // |
| 35 // The context does not take ownership of its pointer members. It's up to |
| 36 // the surrounding classes to ensure those members remain valid while the |
| 37 // context is in use. |
| 38 // |
| 39 // It can only be used from the SyncerThread. |
| 41 class SyncCycleContext { | 40 class SyncCycleContext { |
| 42 public: | 41 public: |
| 43 SyncCycleContext(ServerConnectionManager* connection_manager, | 42 SyncCycleContext(ServerConnectionManager* connection_manager, |
| 44 syncable::Directory* directory, | 43 syncable::Directory* directory, |
| 45 ExtensionsActivity* extensions_activity, | 44 ExtensionsActivity* extensions_activity, |
| 46 const std::vector<SyncEngineEventListener*>& listeners, | 45 const std::vector<SyncEngineEventListener*>& listeners, |
| 47 DebugInfoGetter* debug_info_getter, | 46 DebugInfoGetter* debug_info_getter, |
| 48 ModelTypeRegistry* model_type_registry, | 47 ModelTypeRegistry* model_type_registry, |
| 49 bool keystore_encryption_enabled, | 48 bool keystore_encryption_enabled, |
| 50 bool client_enabled_pre_commit_update_avoidance, | 49 bool client_enabled_pre_commit_update_avoidance, |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 174 |
| 176 // If there's a cookie jar mismatch, whether the cookie jar was empty or not. | 175 // If there's a cookie jar mismatch, whether the cookie jar was empty or not. |
| 177 bool cookie_jar_empty_; | 176 bool cookie_jar_empty_; |
| 178 | 177 |
| 179 DISALLOW_COPY_AND_ASSIGN(SyncCycleContext); | 178 DISALLOW_COPY_AND_ASSIGN(SyncCycleContext); |
| 180 }; | 179 }; |
| 181 | 180 |
| 182 } // namespace syncer | 181 } // namespace syncer |
| 183 | 182 |
| 184 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_CONTEXT_H_ | 183 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_SYNC_CYCLE_CONTEXT_H_ |
| OLD | NEW |