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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 6794005: Move sync notifier contruction out of syncer thread. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase Created 9 years, 8 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: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 302724f2e499733c71eca1d57c3e6155c201278a..9a29e037851e919ad5d13ffb8865447808fcb675 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/sync/glue/password_model_worker.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
#include "chrome/browser/sync/js_arg_list.h"
+#include "chrome/browser/sync/notifier/sync_notifier.h"
#include "chrome/browser/sync/notifier/sync_notifier_factory.h"
#include "chrome/browser/sync/sessions/session_state.h"
// TODO(tim): Remove this! We should have a syncapi pass-thru instead.
@@ -46,6 +47,7 @@ static const FilePath::CharType kSyncDataFolderName[] =
FILE_PATH_LITERAL("Sync Data");
using browser_sync::DataTypeController;
+using sync_notifier::SyncNotifierFactory;
typedef TokenService::TokenAvailableDetails TokenAvailableDetails;
typedef GoogleServiceAuthError AuthError;
@@ -698,6 +700,10 @@ SyncBackendHost::Core::Core(SyncBackendHost* backend)
parent_router_(NULL),
processing_passphrase_(false),
deferred_nudge_for_cleanup_requested_(false) {
+ const std::string& client_info = webkit_glue::GetUserAgent(GURL());
+ SyncNotifierFactory sync_notifier_factory(client_info);
+ sync_notifier_.reset(sync_notifier_factory.CreateSyncNotifier(
+ *CommandLine::ForCurrentProcess()));
}
// Helper to construct a user agent string (ASCII) suitable for use by
@@ -747,8 +753,6 @@ void SyncBackendHost::Core::DoInitialize(const DoInitializeOptions& options) {
syncapi_->AddObserver(this);
const FilePath& path_str = host_->sync_data_folder_path();
- const std::string& client_info = webkit_glue::GetUserAgent(GURL());
- sync_notifier::SyncNotifierFactory sync_notifier_factory(client_info);
success = syncapi_->Init(
path_str,
(options.service_url.host() + options.service_url.path()).c_str(),
@@ -758,8 +762,7 @@ void SyncBackendHost::Core::DoInitialize(const DoInitializeOptions& options) {
host_, // ModelSafeWorkerRegistrar.
MakeUserAgentForSyncapi().c_str(),
options.credentials,
- sync_notifier_factory.CreateSyncNotifier(
- *CommandLine::ForCurrentProcess()),
+ sync_notifier_.get(),
options.restored_key_for_bootstrapping,
options.setup_for_test_mode);
DCHECK(success) << "Syncapi initialization failed!";
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/browser/sync/notifier/non_blocking_invalidation_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698