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

Unified Diff: ios/chrome/browser/reading_list/reading_list_model_factory.cc

Issue 2732333003: [Sync] ModelTypeStore factory shouldn't require valid PSS to function correctly (Closed)
Patch Set: Address comments Created 3 years, 9 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: ios/chrome/browser/reading_list/reading_list_model_factory.cc
diff --git a/ios/chrome/browser/reading_list/reading_list_model_factory.cc b/ios/chrome/browser/reading_list/reading_list_model_factory.cc
index e396d611e6c026f5e81d63dbaf8f9eb7fbfdb3f3..5d115aafeac63a669d0019919641b25fee145f1d 100644
--- a/ios/chrome/browser/reading_list/reading_list_model_factory.cc
+++ b/ios/chrome/browser/reading_list/reading_list_model_factory.cc
@@ -20,7 +20,6 @@
#include "ios/chrome/browser/browser_state/browser_state_otr_helper.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/experimental_flags.h"
-#include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h"
#include "ios/chrome/common/channel_info.h"
#include "ios/web/public/web_thread.h"
@@ -66,12 +65,13 @@ std::unique_ptr<KeyedService> ReadingListModelFactory::BuildServiceInstanceFor(
web::BrowserState* context) const {
ios::ChromeBrowserState* chrome_browser_state =
ios::ChromeBrowserState::FromBrowserState(context);
- browser_sync::ProfileSyncService* profile_sync_service =
- IOSChromeProfileSyncServiceFactory::GetForBrowserState(
- chrome_browser_state);
+ const syncer::ModelTypeStoreFactory& store_factory =
+ browser_sync::ProfileSyncService::GetModelTypeStoreFactory(
+ syncer::READING_LIST, chrome_browser_state->GetStatePath(),
+ web::WebThread::GetBlockingPool());
std::unique_ptr<ReadingListStore> store = base::MakeUnique<ReadingListStore>(
- profile_sync_service->GetModelTypeStoreFactory(syncer::READING_LIST),
+ store_factory,
base::Bind(&syncer::ModelTypeChangeProcessor::Create,
base::BindRepeating(&syncer::ReportUnrecoverableError,
GetChannel())));

Powered by Google App Engine
This is Rietveld 408576698