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

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

Issue 9512005: [Sync] Move BridgedSyncNotifier and ChromeSyncNotificationBridge to glue/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 6bdc86bdbb00b35fae9004e1d3302b56883ef668..4bbac5a8cc3f8243dc8ed8d848a99145fa868040 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -20,6 +20,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/token_service.h"
+#include "chrome/browser/sync/glue/bridged_sync_notifier.h"
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/http_bridge.h"
#include "chrome/browser/sync/glue/sync_backend_registrar.h"
@@ -230,8 +231,8 @@ SyncBackendHost::SyncBackendHost(const std::string& name,
weak_ptr_factory_.GetWeakPtr())),
initialization_state_(NOT_ATTEMPTED),
sync_prefs_(sync_prefs),
+ chrome_sync_notification_bridge_(profile_),
sync_notifier_factory_(
- profile_,
content::GetUserAgent(GURL()),
profile_->GetRequestContext(),
sync_prefs,
@@ -247,8 +248,8 @@ SyncBackendHost::SyncBackendHost(Profile* profile)
profile_(profile),
name_("Unknown"),
initialization_state_(NOT_ATTEMPTED),
+ chrome_sync_notification_bridge_(profile_),
sync_notifier_factory_(
- profile_,
content::GetUserAgent(GURL()),
NULL,
base::WeakPtr<sync_notifier::InvalidationVersionTracker>(),
@@ -306,6 +307,7 @@ void SyncBackendHost::Initialize(
base::Bind(&MakeHttpBridgeFactory,
make_scoped_refptr(profile_->GetRequestContext())),
credentials,
+ &chrome_sync_notification_bridge_,
&sync_notifier_factory_,
delete_sync_data_folder,
sync_prefs_->GetEncryptionBootstrapToken(),
@@ -718,6 +720,7 @@ SyncBackendHost::DoInitializeOptions::DoInitializeOptions(
const GURL& service_url,
MakeHttpBridgeFactoryFn make_http_bridge_factory_fn,
const sync_api::SyncCredentials& credentials,
+ ChromeSyncNotificationBridge* chrome_sync_notification_bridge,
sync_notifier::SyncNotifierFactory* sync_notifier_factory,
bool delete_sync_data_folder,
const std::string& restored_key_for_bootstrapping,
@@ -731,6 +734,7 @@ SyncBackendHost::DoInitializeOptions::DoInitializeOptions(
service_url(service_url),
make_http_bridge_factory_fn(make_http_bridge_factory_fn),
credentials(credentials),
+ chrome_sync_notification_bridge(chrome_sync_notification_bridge),
sync_notifier_factory(sync_notifier_factory),
delete_sync_data_folder(delete_sync_data_folder),
restored_key_for_bootstrapping(restored_key_for_bootstrapping),
@@ -967,7 +971,9 @@ void SyncBackendHost::Core::DoInitialize(const DoInitializeOptions& options) {
options.registrar /* as SyncManager::ChangeDelegate */,
MakeUserAgentForSyncApi(),
options.credentials,
- options.sync_notifier_factory->CreateSyncNotifier(),
+ new BridgedSyncNotifier(
+ options.chrome_sync_notification_bridge,
+ options.sync_notifier_factory->CreateSyncNotifier()),
options.restored_key_for_bootstrapping,
options.setup_for_test_mode,
options.unrecoverable_error_handler,

Powered by Google App Engine
This is Rietveld 408576698