Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Side by Side Diff: trunk/src/sync/internal_api/internal_components_factory_impl.cc

Issue 23658030: Revert 222154 "sync: Gracefully handle very early shutdown" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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, 24 const std::string& name, sessions::SyncSessionContext* context) {
25 sessions::SyncSessionContext* context,
26 CancelationSignal* cancelation_signal) {
27 25
28 scoped_ptr<BackoffDelayProvider> delay(BackoffDelayProvider::FromDefaults()); 26 scoped_ptr<BackoffDelayProvider> delay(BackoffDelayProvider::FromDefaults());
29 27
30 if (switches_.backoff_override == BACKOFF_SHORT_INITIAL_RETRY_OVERRIDE) 28 if (switches_.backoff_override == BACKOFF_SHORT_INITIAL_RETRY_OVERRIDE)
31 delay.reset(BackoffDelayProvider::WithShortInitialRetryOverride()); 29 delay.reset(BackoffDelayProvider::WithShortInitialRetryOverride());
32 30
33 return scoped_ptr<SyncScheduler>(new SyncSchedulerImpl( 31 return scoped_ptr<SyncScheduler>(
34 name, 32 new SyncSchedulerImpl(name, delay.release(), context, new Syncer()));
35 delay.release(),
36 context,
37 new Syncer(cancelation_signal)));
38 } 33 }
39 34
40 scoped_ptr<sessions::SyncSessionContext> 35 scoped_ptr<sessions::SyncSessionContext>
41 InternalComponentsFactoryImpl::BuildContext( 36 InternalComponentsFactoryImpl::BuildContext(
42 ServerConnectionManager* connection_manager, 37 ServerConnectionManager* connection_manager,
43 syncable::Directory* directory, 38 syncable::Directory* directory,
44 const std::vector<ModelSafeWorker*>& workers, 39 const std::vector<ModelSafeWorker*>& workers,
45 ExtensionsActivity* extensions_activity, 40 ExtensionsActivity* extensions_activity,
46 const std::vector<SyncEngineEventListener*>& listeners, 41 const std::vector<SyncEngineEventListener*>& listeners,
47 sessions::DebugInfoGetter* debug_info_getter, 42 sessions::DebugInfoGetter* debug_info_getter,
(...skipping 16 matching lines...) Expand all
64 return scoped_ptr<syncable::DirectoryBackingStore>( 59 return scoped_ptr<syncable::DirectoryBackingStore>(
65 new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath)); 60 new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath));
66 } 61 }
67 62
68 InternalComponentsFactory::Switches 63 InternalComponentsFactory::Switches
69 InternalComponentsFactoryImpl::GetSwitches() const { 64 InternalComponentsFactoryImpl::GetSwitches() const {
70 return switches_; 65 return switches_;
71 } 66 }
72 67
73 } // namespace syncer 68 } // namespace syncer
OLDNEW
« no previous file with comments | « trunk/src/sync/engine/syncer_unittest.cc ('k') | trunk/src/sync/internal_api/public/base/cancelation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698