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