Chromium Code Reviews| Index: components/sync/driver/sync_client.h |
| diff --git a/components/sync/driver/sync_client.h b/components/sync/driver/sync_client.h |
| index ddf64d83d97675a279f0ec22c5b5b687b7e78974..cc48372c4f954c1fa7f9e3d088859d996f22dbea 100644 |
| --- a/components/sync/driver/sync_client.h |
| +++ b/components/sync/driver/sync_client.h |
| @@ -59,6 +59,8 @@ class SyncableService; |
| // to handle these scenarios gracefully. |
| class SyncClient { |
| public: |
| + using ServiceProvider = base::Callback<base::WeakPtr<SyncableService>()>; |
| + |
| SyncClient(); |
| virtual ~SyncClient(); |
| @@ -100,11 +102,10 @@ class SyncClient { |
| virtual scoped_refptr<ExtensionsActivity> GetExtensionsActivity() = 0; |
| virtual sync_sessions::SyncSessionsClient* GetSyncSessionsClient() = 0; |
| - // Returns a weak pointer to the syncable service specified by |type|. |
| - // Weak pointer may be unset if service is already destroyed. |
| - // Note: Should only be dereferenced from the model type thread. |
| - virtual base::WeakPtr<SyncableService> GetSyncableServiceForType( |
| - ModelType type) = 0; |
| + // Returns a callback to retrieve a syncable service specified by |type|. |
| + // Both the provider and the resulting weak pointer should only be accessed |
|
pavely
2017/03/27 19:38:25
nit: "should only be accessed" => "will only be ac
skym
2017/03/27 21:45:26
Done.
|
| + // on the model thread. |
| + virtual ServiceProvider GetSyncableServiceForType(ModelType type) = 0; |
| // Returns a weak pointer to the ModelTypeSyncBridge specified by |type|. Weak |
| // pointer may be unset if service is already destroyed. |