| OLD | NEW |
| 1 // Copyright (c) 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. 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, |
| 11 // or they are valid for explicitly scoped periods of time by using Scoped | 11 // or they are valid for explicitly scoped periods of time by using Scoped |
| 12 // installation utilities found below. This means that the context assumes no | 12 // installation utilities found below. This means that the context assumes no |
| 13 // ownership whatsoever of any object that was not created by the context | 13 // ownership whatsoever of any object that was not created by the context |
| 14 // itself. | 14 // itself. |
| 15 // | 15 // |
| 16 // It can only be used from the SyncerThread. | 16 // It can only be used from the SyncerThread. |
| 17 | 17 |
| 18 #ifndef SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 18 #ifndef SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
| 19 #define SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 19 #define SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
| 20 | 20 |
| 21 #include <map> | 21 #include <map> |
| 22 #include <string> | 22 #include <string> |
| 23 #include <vector> | 23 #include <vector> |
| 24 | 24 |
| 25 #include "sync/base/sync_export.h" |
| 25 #include "sync/engine/sync_engine_event.h" | 26 #include "sync/engine/sync_engine_event.h" |
| 26 #include "sync/engine/syncer_types.h" | 27 #include "sync/engine/syncer_types.h" |
| 27 #include "sync/engine/traffic_recorder.h" | 28 #include "sync/engine/traffic_recorder.h" |
| 28 #include "sync/internal_api/public/engine/model_safe_worker.h" | 29 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 29 #include "sync/protocol/sync.pb.h" | 30 #include "sync/protocol/sync.pb.h" |
| 30 #include "sync/sessions/debug_info_getter.h" | 31 #include "sync/sessions/debug_info_getter.h" |
| 31 | 32 |
| 32 namespace syncer { | 33 namespace syncer { |
| 33 | 34 |
| 34 class ExtensionsActivityMonitor; | 35 class ExtensionsActivityMonitor; |
| 35 class ServerConnectionManager; | 36 class ServerConnectionManager; |
| 36 class ThrottledDataTypeTracker; | 37 class ThrottledDataTypeTracker; |
| 37 | 38 |
| 38 namespace syncable { | 39 namespace syncable { |
| 39 class Directory; | 40 class Directory; |
| 40 } | 41 } |
| 41 | 42 |
| 42 // Default number of items a client can commit in a single message. | 43 // Default number of items a client can commit in a single message. |
| 43 static const int kDefaultMaxCommitBatchSize = 25; | 44 static const int kDefaultMaxCommitBatchSize = 25; |
| 44 | 45 |
| 45 namespace sessions { | 46 namespace sessions { |
| 46 class TestScopedSessionEventListener; | 47 class TestScopedSessionEventListener; |
| 47 | 48 |
| 48 class SyncSessionContext { | 49 class SYNC_EXPORT_PRIVATE SyncSessionContext { |
| 49 public: | 50 public: |
| 50 SyncSessionContext(ServerConnectionManager* connection_manager, | 51 SyncSessionContext(ServerConnectionManager* connection_manager, |
| 51 syncable::Directory* directory, | 52 syncable::Directory* directory, |
| 52 const std::vector<ModelSafeWorker*>& workers, | 53 const std::vector<ModelSafeWorker*>& workers, |
| 53 ExtensionsActivityMonitor* extensions_activity_monitor, | 54 ExtensionsActivityMonitor* extensions_activity_monitor, |
| 54 ThrottledDataTypeTracker* throttled_data_type_tracker, | 55 ThrottledDataTypeTracker* throttled_data_type_tracker, |
| 55 const std::vector<SyncEngineEventListener*>& listeners, | 56 const std::vector<SyncEngineEventListener*>& listeners, |
| 56 DebugInfoGetter* debug_info_getter, | 57 DebugInfoGetter* debug_info_getter, |
| 57 TrafficRecorder* traffic_recorder, | 58 TrafficRecorder* traffic_recorder, |
| 58 bool keystore_encryption_enabled); | 59 bool keystore_encryption_enabled); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // the experiment is not enabled. | 178 // the experiment is not enabled. |
| 178 bool keystore_encryption_enabled_; | 179 bool keystore_encryption_enabled_; |
| 179 | 180 |
| 180 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); | 181 DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); |
| 181 }; | 182 }; |
| 182 | 183 |
| 183 } // namespace sessions | 184 } // namespace sessions |
| 184 } // namespace syncer | 185 } // namespace syncer |
| 185 | 186 |
| 186 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ | 187 #endif // SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_ |
| OLD | NEW |