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/deferred_on_disk_directory_backing_store.h" | |
12 #include "sync/syncable/on_disk_directory_backing_store.h" | 11 #include "sync/syncable/on_disk_directory_backing_store.h" |
13 | 12 |
14 using base::TimeDelta; | 13 using base::TimeDelta; |
15 | 14 |
16 namespace syncer { | 15 namespace syncer { |
17 | 16 |
18 InternalComponentsFactoryImpl::InternalComponentsFactoryImpl( | 17 InternalComponentsFactoryImpl::InternalComponentsFactoryImpl( |
19 const Switches& switches) : switches_(switches) { | 18 const Switches& switches) : switches_(switches) { |
20 } | 19 } |
21 | 20 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 listeners, debug_info_getter, | 52 listeners, debug_info_getter, |
54 model_type_registry, | 53 model_type_registry, |
55 switches_.encryption_method == ENCRYPTION_KEYSTORE, | 54 switches_.encryption_method == ENCRYPTION_KEYSTORE, |
56 switches_.pre_commit_updates_policy == | 55 switches_.pre_commit_updates_policy == |
57 FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE, | 56 FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE, |
58 invalidation_client_id)); | 57 invalidation_client_id)); |
59 } | 58 } |
60 | 59 |
61 scoped_ptr<syncable::DirectoryBackingStore> | 60 scoped_ptr<syncable::DirectoryBackingStore> |
62 InternalComponentsFactoryImpl::BuildDirectoryBackingStore( | 61 InternalComponentsFactoryImpl::BuildDirectoryBackingStore( |
63 StorageOption storage, const std::string& dir_name, | 62 const std::string& dir_name, const base::FilePath& backing_filepath) { |
64 const base::FilePath& backing_filepath) { | 63 return scoped_ptr<syncable::DirectoryBackingStore>( |
65 if (storage == STORAGE_ON_DISK) { | 64 new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath)); |
66 return scoped_ptr<syncable::DirectoryBackingStore>( | |
67 new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath)); | |
68 } else if (storage == STORAGE_ON_DISK_DEFERRED) { | |
69 return scoped_ptr<syncable::DirectoryBackingStore>( | |
70 new syncable::DeferredOnDiskDirectoryBackingStore(dir_name, | |
71 backing_filepath)); | |
72 } else { | |
73 NOTREACHED(); | |
74 return scoped_ptr<syncable::DirectoryBackingStore>(); | |
75 } | |
76 } | 65 } |
77 | 66 |
78 InternalComponentsFactory::Switches | 67 InternalComponentsFactory::Switches |
79 InternalComponentsFactoryImpl::GetSwitches() const { | 68 InternalComponentsFactoryImpl::GetSwitches() const { |
80 return switches_; | 69 return switches_; |
81 } | 70 } |
82 | 71 |
83 } // namespace syncer | 72 } // namespace syncer |
OLD | NEW |