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

Unified Diff: components/browser_sync/profile_sync_service.cc

Issue 2658743002: [Sync] Add ProfileSyncService::GetModelTypeStoreFactory. (Closed)
Patch Set: Fix iOS PSS factory. Created 3 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 | « components/browser_sync/profile_sync_service.h ('k') | components/browser_sync/profile_sync_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/profile_sync_service.cc
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index d95fccdcf275cf30c22f545529571cfd7cd14f2b..a28a87f4530a7d2574f052e2c7886d26f976240a 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -69,7 +69,6 @@
#include "components/sync/js/js_event_details.h"
#include "components/sync/model/change_processor.h"
#include "components/sync/model/model_type_change_processor.h"
-#include "components/sync/model/model_type_store.h"
#include "components/sync/model/sync_error.h"
#include "components/sync/protocol/sync.pb.h"
#include "components/sync/syncable/directory.h"
@@ -193,7 +192,7 @@ ProfileSyncService::ProfileSyncService(InitParams init_params)
network_time_update_callback_(
std::move(init_params.network_time_update_callback)),
url_request_context_(init_params.url_request_context),
- blocking_pool_(init_params.blocking_pool),
+ blocking_task_runner_(std::move(init_params.blocking_task_runner)),
is_first_time_sync_configure_(false),
engine_initialized_(false),
sync_disabled_by_admin_(false),
@@ -274,19 +273,11 @@ void ProfileSyncService::Initialize() {
syncer::ModelTypeSet(syncer::SESSIONS)));
if (base::FeatureList::IsEnabled(switches::kSyncUSSDeviceInfo)) {
- scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
- blocking_pool_->GetSequencedTaskRunnerWithShutdownBehavior(
- blocking_pool_->GetSequenceToken(),
- base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
// TODO(skym): Stop creating leveldb files when signed out.
// TODO(skym): Verify using AsUTF8Unsafe is okay here. Should work as long
// as the Local State file is guaranteed to be UTF-8.
device_info_sync_bridge_ = base::MakeUnique<DeviceInfoSyncBridge>(
- local_device_.get(),
- base::Bind(&ModelTypeStore::CreateStore, syncer::DEVICE_INFO,
- sync_data_folder_.Append(base::FilePath(kLevelDBFolderName))
- .AsUTF8Unsafe(),
- blocking_task_runner),
+ local_device_.get(), GetModelTypeStoreFactory(syncer::DEVICE_INFO),
base::BindRepeating(
&ModelTypeChangeProcessor::Create,
base::BindRepeating(&syncer::ReportUnrecoverableError, channel_)));
@@ -974,7 +965,7 @@ void ProfileSyncService::OnEngineInitialized(
// Initialize local device info.
local_device_->Initialize(cache_guid, signin_scoped_device_id,
- blocking_pool_);
+ blocking_task_runner_);
if (protocol_event_observers_.might_have_observers()) {
engine_->RequestBufferedProtocolEventsAndEnableForwarding();
@@ -1822,6 +1813,14 @@ void ProfileSyncService::SetPlatformSyncAllowedProvider(
platform_sync_allowed_provider_ = platform_sync_allowed_provider;
}
+syncer::ModelTypeStoreFactory ProfileSyncService::GetModelTypeStoreFactory(
+ ModelType type) {
+ return base::Bind(&ModelTypeStore::CreateStore, type,
+ sync_data_folder_.Append(base::FilePath(kLevelDBFolderName))
+ .AsUTF8Unsafe(),
+ blocking_task_runner_);
+}
+
void ProfileSyncService::ConfigureDataTypeManager() {
// Don't configure datatypes if the setup UI is still on the screen - this
// is to help multi-screen setting UIs (like iOS) where they don't want to
« no previous file with comments | « components/browser_sync/profile_sync_service.h ('k') | components/browser_sync/profile_sync_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698