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

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

Issue 6375007: [Sync] Refactored ProfileSyncService and remove its backend() function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment Created 9 years, 11 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
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/browser/sync/glue/theme_model_associator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3e600e1c4f4cbb47655bd0c5337df7edad5126ef..6ff01af4581b6bbcc2ca8df6d47c5473e995e346 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -51,12 +51,12 @@ namespace browser_sync {
using sessions::SyncSessionSnapshot;
using sync_api::SyncCredentials;
-SyncBackendHost::SyncBackendHost(SyncFrontend* frontend, Profile* profile)
+SyncBackendHost::SyncBackendHost(Profile* profile)
: core_(new Core(ALLOW_THIS_IN_INITIALIZER_LIST(this))),
core_thread_("Chrome_SyncCoreThread"),
frontend_loop_(MessageLoop::current()),
profile_(profile),
- frontend_(frontend),
+ frontend_(NULL),
sync_data_folder_path_(
profile_->GetPath().Append(kSyncDataFolderName)),
last_auth_error_(AuthError::None()),
@@ -78,6 +78,7 @@ SyncBackendHost::~SyncBackendHost() {
}
void SyncBackendHost::Initialize(
+ SyncFrontend* frontend,
const GURL& sync_service_url,
const syncable::ModelTypeSet& types,
URLRequestContextGetter* baseline_context_getter,
@@ -87,6 +88,9 @@ void SyncBackendHost::Initialize(
if (!core_thread_.Start())
return;
+ frontend_ = frontend;
+ DCHECK(frontend);
+
// Create a worker for the UI thread and route bookmark changes to it.
// TODO(tim): Pull this into a method to reuse. For now we don't even
// need to lock because we init before the syncapi exists and we tear down
@@ -172,7 +176,7 @@ bool SyncBackendHost::IsUsingExplicitPassphrase() {
bool SyncBackendHost::IsCryptographerReady() const {
return syncapi_initialized_ &&
- GetUserShareHandle()->dir_manager->cryptographer()->is_ready();
+ GetUserShare()->dir_manager->cryptographer()->is_ready();
}
sync_api::HttpPostProviderFactory* SyncBackendHost::MakeHttpBridgeFactory(
@@ -284,7 +288,7 @@ void SyncBackendHost::SetAutofillMigrationDebugInfo(
void SyncBackendHost::ConfigureAutofillMigration() {
if (GetAutofillMigrationState() == syncable::NOT_DETERMINED) {
- sync_api::ReadTransaction trans(GetUserShareHandle());
+ sync_api::ReadTransaction trans(GetUserShare());
sync_api::ReadNode autofil_root_node(&trans);
// Check for the presence of autofill node.
@@ -487,7 +491,7 @@ void SyncBackendHost::Core::NotifyUpdatedToken(const std::string& token) {
Details<const TokenAvailableDetails>(&details));
}
-SyncBackendHost::UserShareHandle SyncBackendHost::GetUserShareHandle() const {
+sync_api::UserShare* SyncBackendHost::GetUserShare() const {
DCHECK(syncapi_initialized_);
return core_->syncapi()->GetUserShare();
}
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/browser/sync/glue/theme_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698