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 #include "sync/sessions/sync_session_context.h" | 5 #include "sync/sessions/sync_session_context.h" |
6 | 6 |
7 #include "sync/sessions/debug_info_getter.h" | 7 #include "sync/sessions/debug_info_getter.h" |
8 #include "sync/util/extensions_activity.h" | 8 #include "sync/util/extensions_activity.h" |
9 | 9 |
10 namespace syncer { | 10 namespace syncer { |
11 namespace sessions { | 11 namespace sessions { |
12 | 12 |
13 SyncSessionContext::SyncSessionContext( | 13 SyncSessionContext::SyncSessionContext( |
14 ServerConnectionManager* connection_manager, | 14 ServerConnectionManager* connection_manager, |
15 syncable::Directory* directory, | 15 syncable::Directory* directory, |
16 ExtensionsActivity* extensions_activity, | 16 ExtensionsActivity* extensions_activity, |
17 const std::vector<SyncEngineEventListener*>& listeners, | 17 const std::vector<SyncEngineEventListener*>& listeners, |
18 DebugInfoGetter* debug_info_getter, | 18 DebugInfoGetter* debug_info_getter, |
19 TrafficRecorder* traffic_recorder, | |
20 ModelTypeRegistry* model_type_registry, | 19 ModelTypeRegistry* model_type_registry, |
21 bool keystore_encryption_enabled, | 20 bool keystore_encryption_enabled, |
22 bool client_enabled_pre_commit_update_avoidance, | 21 bool client_enabled_pre_commit_update_avoidance, |
23 const std::string& invalidator_client_id) | 22 const std::string& invalidator_client_id) |
24 : connection_manager_(connection_manager), | 23 : connection_manager_(connection_manager), |
25 directory_(directory), | 24 directory_(directory), |
26 extensions_activity_(extensions_activity), | 25 extensions_activity_(extensions_activity), |
27 notifications_enabled_(false), | 26 notifications_enabled_(false), |
28 max_commit_batch_size_(kDefaultMaxCommitBatchSize), | 27 max_commit_batch_size_(kDefaultMaxCommitBatchSize), |
29 debug_info_getter_(debug_info_getter), | 28 debug_info_getter_(debug_info_getter), |
30 traffic_recorder_(traffic_recorder), | |
31 model_type_registry_(model_type_registry), | 29 model_type_registry_(model_type_registry), |
32 keystore_encryption_enabled_(keystore_encryption_enabled), | 30 keystore_encryption_enabled_(keystore_encryption_enabled), |
33 invalidator_client_id_(invalidator_client_id), | 31 invalidator_client_id_(invalidator_client_id), |
34 server_enabled_pre_commit_update_avoidance_(false), | 32 server_enabled_pre_commit_update_avoidance_(false), |
35 client_enabled_pre_commit_update_avoidance_( | 33 client_enabled_pre_commit_update_avoidance_( |
36 client_enabled_pre_commit_update_avoidance) { | 34 client_enabled_pre_commit_update_avoidance) { |
37 std::vector<SyncEngineEventListener*>::const_iterator it; | 35 std::vector<SyncEngineEventListener*>::const_iterator it; |
38 for (it = listeners.begin(); it != listeners.end(); ++it) | 36 for (it = listeners.begin(); it != listeners.end(); ++it) |
39 listeners_.AddObserver(*it); | 37 listeners_.AddObserver(*it); |
40 } | 38 } |
41 | 39 |
42 SyncSessionContext::~SyncSessionContext() { | 40 SyncSessionContext::~SyncSessionContext() { |
43 } | 41 } |
44 | 42 |
45 ModelTypeSet SyncSessionContext::GetEnabledTypes() const { | 43 ModelTypeSet SyncSessionContext::GetEnabledTypes() const { |
46 return model_type_registry_->GetEnabledTypes(); | 44 return model_type_registry_->GetEnabledTypes(); |
47 } | 45 } |
48 | 46 |
49 void SyncSessionContext::SetRoutingInfo( | 47 void SyncSessionContext::SetRoutingInfo( |
50 const ModelSafeRoutingInfo& routing_info) { | 48 const ModelSafeRoutingInfo& routing_info) { |
51 model_type_registry_->SetEnabledDirectoryTypes(routing_info); | 49 model_type_registry_->SetEnabledDirectoryTypes(routing_info); |
52 } | 50 } |
53 | 51 |
54 } // namespace sessions | 52 } // namespace sessions |
55 } // namespace syncer | 53 } // namespace syncer |
OLD | NEW |