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
3 // found in the LICENSE file.
5 #include "sync/sessions/sync_session_context.h"
7 #include "sync/engine/throttled_data_type_tracker.h"
8 #include "sync/sessions/debug_info_getter.h"
9 #include "sync/util/extensions_activity_monitor.h"
14 const unsigned int kMaxMessagesToRecord
= 10;
15 const unsigned int kMaxMessageSizeToRecord
= 5 * 1024;
17 SyncSessionContext::SyncSessionContext(
18 ServerConnectionManager
* connection_manager
,
19 syncable::Directory
* directory
,
20 const std::vector
<ModelSafeWorker
*>& workers
,
21 ExtensionsActivityMonitor
* extensions_activity_monitor
,
22 ThrottledDataTypeTracker
* throttled_data_type_tracker
,
23 const std::vector
<SyncEngineEventListener
*>& listeners
,
24 DebugInfoGetter
* debug_info_getter
,
25 TrafficRecorder
* traffic_recorder
,
26 bool keystore_encryption_enabled
)
28 connection_manager_(connection_manager
),
29 directory_(directory
),
31 extensions_activity_monitor_(extensions_activity_monitor
),
32 notifications_enabled_(false),
33 max_commit_batch_size_(kDefaultMaxCommitBatchSize
),
34 throttled_data_type_tracker_(throttled_data_type_tracker
),
35 debug_info_getter_(debug_info_getter
),
36 traffic_recorder_(traffic_recorder
),
37 keystore_encryption_enabled_(keystore_encryption_enabled
) {
38 std::vector
<SyncEngineEventListener
*>::const_iterator it
;
39 for (it
= listeners
.begin(); it
!= listeners
.end(); ++it
)
40 listeners_
.AddObserver(*it
);
43 SyncSessionContext::~SyncSessionContext() {
46 } // namespace sessions