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/internal_api/public/internal_components_factory_impl.h" | 5 #include "sync/internal_api/public/internal_components_factory_impl.h" |
6 | 6 |
7 #include "sync/engine/backoff_delay_provider.h" | 7 #include "sync/engine/backoff_delay_provider.h" |
8 #include "sync/engine/syncer.h" | 8 #include "sync/engine/syncer.h" |
9 #include "sync/engine/sync_scheduler_impl.h" | 9 #include "sync/engine/sync_scheduler_impl.h" |
10 #include "sync/sessions/sync_session_context.h" | 10 #include "sync/sessions/sync_session_context.h" |
11 #include "sync/syncable/on_disk_directory_backing_store.h" | 11 #include "sync/syncable/on_disk_directory_backing_store.h" |
12 | 12 |
13 using base::TimeDelta; | 13 using base::TimeDelta; |
14 | 14 |
15 namespace syncer { | 15 namespace syncer { |
16 | 16 |
17 InternalComponentsFactoryImpl::InternalComponentsFactoryImpl( | 17 InternalComponentsFactoryImpl::InternalComponentsFactoryImpl( |
18 const Switches& switches) : switches_(switches) { | 18 const Switches& switches) : switches_(switches) { |
19 } | 19 } |
20 | 20 |
21 InternalComponentsFactoryImpl::~InternalComponentsFactoryImpl() { } | 21 InternalComponentsFactoryImpl::~InternalComponentsFactoryImpl() { } |
22 | 22 |
23 scoped_ptr<SyncScheduler> InternalComponentsFactoryImpl::BuildScheduler( | 23 scoped_ptr<SyncScheduler> InternalComponentsFactoryImpl::BuildScheduler( |
24 const std::string& name, sessions::SyncSessionContext* context) { | 24 const std::string& name, |
| 25 sessions::SyncSessionContext* context, |
| 26 CancelationSignal* cancelation_signal) { |
25 | 27 |
26 scoped_ptr<BackoffDelayProvider> delay(BackoffDelayProvider::FromDefaults()); | 28 scoped_ptr<BackoffDelayProvider> delay(BackoffDelayProvider::FromDefaults()); |
27 | 29 |
28 if (switches_.backoff_override == BACKOFF_SHORT_INITIAL_RETRY_OVERRIDE) | 30 if (switches_.backoff_override == BACKOFF_SHORT_INITIAL_RETRY_OVERRIDE) |
29 delay.reset(BackoffDelayProvider::WithShortInitialRetryOverride()); | 31 delay.reset(BackoffDelayProvider::WithShortInitialRetryOverride()); |
30 | 32 |
31 return scoped_ptr<SyncScheduler>( | 33 return scoped_ptr<SyncScheduler>(new SyncSchedulerImpl( |
32 new SyncSchedulerImpl(name, delay.release(), context, new Syncer())); | 34 name, |
| 35 delay.release(), |
| 36 context, |
| 37 new Syncer(cancelation_signal))); |
33 } | 38 } |
34 | 39 |
35 scoped_ptr<sessions::SyncSessionContext> | 40 scoped_ptr<sessions::SyncSessionContext> |
36 InternalComponentsFactoryImpl::BuildContext( | 41 InternalComponentsFactoryImpl::BuildContext( |
37 ServerConnectionManager* connection_manager, | 42 ServerConnectionManager* connection_manager, |
38 syncable::Directory* directory, | 43 syncable::Directory* directory, |
39 const std::vector<ModelSafeWorker*>& workers, | 44 const std::vector<ModelSafeWorker*>& workers, |
40 ExtensionsActivity* extensions_activity, | 45 ExtensionsActivity* extensions_activity, |
41 const std::vector<SyncEngineEventListener*>& listeners, | 46 const std::vector<SyncEngineEventListener*>& listeners, |
42 sessions::DebugInfoGetter* debug_info_getter, | 47 sessions::DebugInfoGetter* debug_info_getter, |
(...skipping 16 matching lines...) Expand all Loading... |
59 return scoped_ptr<syncable::DirectoryBackingStore>( | 64 return scoped_ptr<syncable::DirectoryBackingStore>( |
60 new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath)); | 65 new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath)); |
61 } | 66 } |
62 | 67 |
63 InternalComponentsFactory::Switches | 68 InternalComponentsFactory::Switches |
64 InternalComponentsFactoryImpl::GetSwitches() const { | 69 InternalComponentsFactoryImpl::GetSwitches() const { |
65 return switches_; | 70 return switches_; |
66 } | 71 } |
67 | 72 |
68 } // namespace syncer | 73 } // namespace syncer |
OLD | NEW |