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

Unified Diff: sync/tools/sync_client.cc

Issue 10704214: [Sync] Refactor sync manager into interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Comments Created 8 years, 5 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
« chrome/browser/sync/glue/sync_backend_host.cc ('K') | « sync/sync.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/tools/sync_client.cc
diff --git a/sync/tools/sync_client.cc b/sync/tools/sync_client.cc
index d9fd4c5f7312be493511a7cee750aa75619bf2b6..1b9dbf8333fcf426e30c2a736d4ebf2b187fc1f3 100644
--- a/sync/tools/sync_client.cc
+++ b/sync/tools/sync_client.cc
@@ -32,12 +32,14 @@
#include "sync/internal_api/public/http_bridge.h"
#include "sync/internal_api/public/read_node.h"
#include "sync/internal_api/public/sync_manager.h"
+#include "sync/internal_api/public/sync_manager_factory.h"
#include "sync/internal_api/public/util/report_unrecoverable_error_function.h"
#include "sync/internal_api/public/util/unrecoverable_error_handler.h"
#include "sync/internal_api/public/util/weak_handle.h"
#include "sync/js/js_event_details.h"
#include "sync/js/js_event_handler.h"
#include "sync/notifier/invalidation_state_tracker.h"
+#include "sync/notifier/sync_notifier.h"
#include "sync/notifier/sync_notifier_factory.h"
#include "sync/test/fake_encryptor.h"
@@ -326,7 +328,9 @@ int main(int argc, char* argv[]) {
workers.push_back(passive_model_safe_worker.get());
// Set up sync manager.
- syncer::SyncManager sync_manager("sync_client manager");
+ syncer::SyncManagerFactory sync_manager_factory;
+ scoped_ptr<syncer::SyncManager> sync_manager =
+ sync_manager_factory.CreateSyncManager("sync_client manager");
LoggingJsEventHandler js_event_handler;
const char kSyncServerAndPath[] = "clients4.google.com/chrome-sync/dev";
int kSyncServerPort = 443;
@@ -347,20 +351,21 @@ int main(int argc, char* argv[]) {
syncer::SyncManager::NON_TEST;
NullEncryptor null_encryptor;
LoggingUnrecoverableErrorHandler unrecoverable_error_handler;
- sync_manager.Init(database_dir.path(),
+ sync_manager->Init(database_dir.path(),
syncer::WeakHandle<syncer::JsEventHandler>(
js_event_handler.AsWeakPtr()),
kSyncServerAndPath,
kSyncServerPort,
kUseSsl,
blocking_task_runner,
- post_factory.release(),
+ post_factory.Pass(),
routing_info,
workers,
extensions_activity_monitor,
&change_delegate,
credentials,
- sync_notifier_factory.CreateSyncNotifier(),
+ scoped_ptr<syncer::SyncNotifier>(
+ sync_notifier_factory.CreateSyncNotifier()),
kRestoredKeyForBootstrapping,
kTestingMode,
&null_encryptor,
@@ -368,8 +373,8 @@ int main(int argc, char* argv[]) {
&LogUnrecoverableErrorContext);
// TODO(akalin): We have pass in model parameters multiple times.
// Organize handling of model types.
- sync_manager.UpdateEnabledTypes(model_types);
- sync_manager.StartSyncingNormally(routing_info);
+ sync_manager->UpdateEnabledTypes(model_types);
+ sync_manager->StartSyncingNormally(routing_info);
sync_loop.Run();
« chrome/browser/sync/glue/sync_backend_host.cc ('K') | « sync/sync.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698