Implements the non-deprecated builder.
Any class inheriting `BrowserContextKeyedServiceFactory` should implements either `BuildServiceInstanceForBrowserContext` or `BuildServiceInstanceFor`. The second one being deprecated, this CLreplaces it by the first one. This also ensures that, instead of applying `WrapUnique` to a `new` raw ptr, it directly uses `make_unique`. Bug: 40249337 Change-Id: Ia2e99f80a43e0b56449aa5585d810bdd832c1668 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4797779 Reviewed-by: Stefan Kuhne <skuhne@chromium.org> Auto-Submit: Arthur Milchior <arthurmilchior@chromium.org> Commit-Queue: Arthur Milchior <arthurmilchior@chromium.org> Cr-Commit-Position: refs/heads/main@{#1378740}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
ec3f17fb19
commit
5af1b366a1
@ -40,9 +40,10 @@ SavedFilesServiceFactory::SavedFilesServiceFactory()
|
||||
|
||||
SavedFilesServiceFactory::~SavedFilesServiceFactory() = default;
|
||||
|
||||
KeyedService* SavedFilesServiceFactory::BuildServiceInstanceFor(
|
||||
std::unique_ptr<KeyedService>
|
||||
SavedFilesServiceFactory::BuildServiceInstanceForBrowserContext(
|
||||
content::BrowserContext* context) const {
|
||||
return new SavedFilesService(context);
|
||||
return std::make_unique<SavedFilesService>(context);
|
||||
}
|
||||
|
||||
content::BrowserContext* SavedFilesServiceFactory::GetBrowserContextToUse(
|
||||
|
@ -35,7 +35,7 @@ class SavedFilesServiceFactory : public BrowserContextKeyedServiceFactory {
|
||||
~SavedFilesServiceFactory() override;
|
||||
friend struct base::DefaultSingletonTraits<SavedFilesServiceFactory>;
|
||||
|
||||
KeyedService* BuildServiceInstanceFor(
|
||||
std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext(
|
||||
content::BrowserContext* context) const override;
|
||||
content::BrowserContext* GetBrowserContextToUse(
|
||||
content::BrowserContext* context) const override;
|
||||
|
Reference in New Issue
Block a user