| 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/test/test_internal_components_factory.h" | 5 #include "sync/internal_api/public/test/test_internal_components_factory.h" |
| 6 | 6 |
| 7 #include "sync/sessions/sync_session_context.h" | 7 #include "sync/sessions/sync_session_context.h" |
| 8 #include "sync/syncable/in_memory_directory_backing_store.h" | 8 #include "sync/syncable/in_memory_directory_backing_store.h" |
| 9 #include "sync/syncable/on_disk_directory_backing_store.h" | 9 #include "sync/syncable/on_disk_directory_backing_store.h" |
| 10 #include "sync/syncable/invalid_directory_backing_store.h" | 10 #include "sync/syncable/invalid_directory_backing_store.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 scoped_ptr<sessions::SyncSessionContext> | 29 scoped_ptr<sessions::SyncSessionContext> |
| 30 TestInternalComponentsFactory::BuildContext( | 30 TestInternalComponentsFactory::BuildContext( |
| 31 ServerConnectionManager* connection_manager, | 31 ServerConnectionManager* connection_manager, |
| 32 syncable::Directory* directory, | 32 syncable::Directory* directory, |
| 33 const std::vector<ModelSafeWorker*> workers, | 33 const std::vector<ModelSafeWorker*> workers, |
| 34 ExtensionsActivityMonitor* monitor, | 34 ExtensionsActivityMonitor* monitor, |
| 35 ThrottledDataTypeTracker* throttled_data_type_tracker, | 35 ThrottledDataTypeTracker* throttled_data_type_tracker, |
| 36 const std::vector<SyncEngineEventListener*>& listeners, | 36 const std::vector<SyncEngineEventListener*>& listeners, |
| 37 sessions::DebugInfoGetter* debug_info_getter, | 37 sessions::DebugInfoGetter* debug_info_getter, |
| 38 TrafficRecorder* traffic_recorder) { | 38 TrafficRecorder* traffic_recorder, |
| 39 const std::string& invalidator_client_id) { |
| 39 | 40 |
| 40 // Tests don't wire up listeners. | 41 // Tests don't wire up listeners. |
| 41 std::vector<SyncEngineEventListener*> empty_listeners; | 42 std::vector<SyncEngineEventListener*> empty_listeners; |
| 42 return scoped_ptr<sessions::SyncSessionContext>( | 43 return scoped_ptr<sessions::SyncSessionContext>( |
| 43 new sessions::SyncSessionContext( | 44 new sessions::SyncSessionContext( |
| 44 connection_manager, directory, workers, monitor, | 45 connection_manager, directory, workers, monitor, |
| 45 throttled_data_type_tracker, empty_listeners, debug_info_getter, | 46 throttled_data_type_tracker, empty_listeners, debug_info_getter, |
| 46 traffic_recorder, | 47 traffic_recorder, |
| 47 switches_.encryption_method == ENCRYPTION_KEYSTORE)); | 48 switches_.encryption_method == ENCRYPTION_KEYSTORE, |
| 49 invalidator_client_id)); |
| 48 | 50 |
| 49 } | 51 } |
| 50 | 52 |
| 51 scoped_ptr<syncable::DirectoryBackingStore> | 53 scoped_ptr<syncable::DirectoryBackingStore> |
| 52 TestInternalComponentsFactory::BuildDirectoryBackingStore( | 54 TestInternalComponentsFactory::BuildDirectoryBackingStore( |
| 53 const std::string& dir_name, const FilePath& backing_filepath) { | 55 const std::string& dir_name, const FilePath& backing_filepath) { |
| 54 switch (storage_option_) { | 56 switch (storage_option_) { |
| 55 case STORAGE_IN_MEMORY: | 57 case STORAGE_IN_MEMORY: |
| 56 return scoped_ptr<syncable::DirectoryBackingStore>( | 58 return scoped_ptr<syncable::DirectoryBackingStore>( |
| 57 new syncable::InMemoryDirectoryBackingStore(dir_name)); | 59 new syncable::InMemoryDirectoryBackingStore(dir_name)); |
| 58 case STORAGE_ON_DISK: | 60 case STORAGE_ON_DISK: |
| 59 return scoped_ptr<syncable::DirectoryBackingStore>( | 61 return scoped_ptr<syncable::DirectoryBackingStore>( |
| 60 new syncable::OnDiskDirectoryBackingStore(dir_name, | 62 new syncable::OnDiskDirectoryBackingStore(dir_name, |
| 61 backing_filepath)); | 63 backing_filepath)); |
| 62 case STORAGE_INVALID: | 64 case STORAGE_INVALID: |
| 63 return scoped_ptr<syncable::DirectoryBackingStore>( | 65 return scoped_ptr<syncable::DirectoryBackingStore>( |
| 64 new syncable::InvalidDirectoryBackingStore()); | 66 new syncable::InvalidDirectoryBackingStore()); |
| 65 } | 67 } |
| 66 NOTREACHED(); | 68 NOTREACHED(); |
| 67 return scoped_ptr<syncable::DirectoryBackingStore>(); | 69 return scoped_ptr<syncable::DirectoryBackingStore>(); |
| 68 } | 70 } |
| 69 | 71 |
| 70 InternalComponentsFactory::Switches | 72 InternalComponentsFactory::Switches |
| 71 TestInternalComponentsFactory::GetSwitches() const { | 73 TestInternalComponentsFactory::GetSwitches() const { |
| 72 return switches_; | 74 return switches_; |
| 73 } | 75 } |
| 74 | 76 |
| 75 } // namespace syncer | 77 } // namespace syncer |
| OLD | NEW |