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

Unified Diff: sync/internal_api/internal_components_factory_impl.cc

Issue 455023003: Let SyncBackupManager keep backup data in memory until shutdown. Only persist (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: sync/internal_api/internal_components_factory_impl.cc
diff --git a/sync/internal_api/internal_components_factory_impl.cc b/sync/internal_api/internal_components_factory_impl.cc
index e764a1698ab6c25ebad48d8ac4181c9b511355ea..dbc424374a9b5020f36389df45aa8843b0ea8c21 100644
--- a/sync/internal_api/internal_components_factory_impl.cc
+++ b/sync/internal_api/internal_components_factory_impl.cc
@@ -8,6 +8,7 @@
#include "sync/engine/syncer.h"
#include "sync/engine/sync_scheduler_impl.h"
#include "sync/sessions/sync_session_context.h"
+#include "sync/syncable/deferred_on_disk_directory_backing_store.h"
#include "sync/syncable/on_disk_directory_backing_store.h"
using base::TimeDelta;
@@ -59,9 +60,19 @@ InternalComponentsFactoryImpl::BuildContext(
scoped_ptr<syncable::DirectoryBackingStore>
InternalComponentsFactoryImpl::BuildDirectoryBackingStore(
- const std::string& dir_name, const base::FilePath& backing_filepath) {
- return scoped_ptr<syncable::DirectoryBackingStore>(
- new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath));
+ StorageOption storage, const std::string& dir_name,
+ const base::FilePath& backing_filepath) {
+ if (storage == STORAGE_ON_DISK) {
+ return scoped_ptr<syncable::DirectoryBackingStore>(
+ new syncable::OnDiskDirectoryBackingStore(dir_name, backing_filepath));
+ } else if (storage == STORAGE_ON_DISK_DEFERRED) {
+ return scoped_ptr<syncable::DirectoryBackingStore>(
+ new syncable::DeferredOnDiskDirectoryBackingStore(dir_name,
+ backing_filepath));
+ } else {
+ NOTREACHED();
+ return scoped_ptr<syncable::DirectoryBackingStore>();
+ }
}
InternalComponentsFactory::Switches

Powered by Google App Engine
This is Rietveld 408576698