Right now ProfileSyncServiceFactory will return nullptr instead of a PSS if the --disable-sync flag is passed, see https://cs.chromium.org/chromium/src/chrome/browser/sync/profile_sync_service_factory.cc?l=92 This is a problem for anyone using ModelTypeStore (like printers), because they need to call https://cs.chromium.org/chromium/src/components/browser_sync/profile_sync_service.cc?type=cs&q=GetModelTypeStoreFactory&sq=package:chromium&l=1672 during their initialization. Temporarily we essentially break this flag. Is that okay? Unclear. Would be nice if we could grab the task runner from somewhere else.
This is the root cause of issue 694992 , it looks like ChromeOS Guest Mode doesn't have a PSS.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/222de9fb1677cdabfbf8998c17dd0e394f71a81e commit 222de9fb1677cdabfbf8998c17dd0e394f71a81e Author: pavely <pavely@chromium.org> Date: Thu Mar 09 15:23:59 2017 [Sync] ModelTypeStore factory shouldn't require valid PSS to function correctly The issue is that PSS::GetModelTypeStoreFactory requires valid PSS which doesn't have to be available when sync is disabled (for example in guest mode on ChromeOS). The reason it is currently wired through PSS is that PSS conveniently has path and blocking task runner required for ModelTypeStore. I added static GetModelTypeStoreFactory function that takes profile path and SequencedWorkerPool. It ensures that, for a given path, all task runners use the same sequence token and thus properly sequneced. Datatypes that wish to be hosted in shared leveldb database should use this factory function. I also fixed issue that backend_map_ is accessed from multiple threads and thus might get corrupt. I wrapped it into a class with lock. BUG= 688533 R=skym@chromium.org Review-Url: https://codereview.chromium.org/2732333003 Cr-Commit-Position: refs/heads/master@{#455749} [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/chrome/browser/chromeos/printing/printers_manager_factory.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/chrome/browser/sync/chrome_sync_client.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/chrome/browser/sync/chrome_sync_client.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/chrome/browser/sync/profile_sync_service_factory.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/chrome/browser/sync/profile_sync_test_util.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/browser_sync/profile_sync_service.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/browser_sync/profile_sync_service.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/browser_sync/profile_sync_test_util.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/driver/fake_sync_client.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/driver/fake_sync_client.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/driver/sync_client.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/driver/sync_service_base.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/driver/sync_service_base.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/model/model_type_store.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/model_impl/model_type_store_backend.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/model_impl/model_type_store_backend.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/components/sync/model_impl/model_type_store_backend_unittest.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/ios/chrome/browser/reading_list/reading_list_model_factory.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/ios/chrome/browser/sync/ios_chrome_profile_sync_test_util.cc [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/ios/chrome/browser/sync/ios_chrome_sync_client.h [modify] https://crrev.com/222de9fb1677cdabfbf8998c17dd0e394f71a81e/ios/chrome/browser/sync/ios_chrome_sync_client.mm
Comment 1 Deleted