Skip to content

Commit

Permalink
Implements the non-deprecated builder.
Browse files Browse the repository at this point in the history
Any class inheriting `BrowserContextKeyedServiceFactory` should
implements either `BuildServiceInstanceForBrowserContext` or
`BuildServiceInstanceFor`. The second one being deprecated,
this CL
replaces it by the first one.

This also ensures that, instead of applying `WrapUnique` to a `new` raw
ptr, it directly uses `make_unique`.

Change-Id: I25001e9a828890848a44622c1723278260b84f3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4797781
Commit-Queue: Josh Horwich <jhorwich@chromium.org>
Reviewed-by: Josh Horwich <jhorwich@chromium.org>
Auto-Submit: Arthur Milchior <arthurmilchior@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1188772}
  • Loading branch information
Arthur Milchior authored and Chromium LUCI CQ committed Aug 27, 2023
1 parent d473830 commit 36e72e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ SupportedLinksInfoBarPrefsServiceFactory::
SupportedLinksInfoBarPrefsServiceFactory::
~SupportedLinksInfoBarPrefsServiceFactory() = default;

KeyedService* SupportedLinksInfoBarPrefsServiceFactory::BuildServiceInstanceFor(
std::unique_ptr<KeyedService>
SupportedLinksInfoBarPrefsServiceFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const {
return new SupportedLinksInfoBarPrefsService(
return std::make_unique<SupportedLinksInfoBarPrefsService>(
Profile::FromBrowserContext(context));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SupportedLinksInfoBarPrefsServiceFactory
~SupportedLinksInfoBarPrefsServiceFactory() override;

// BrowserContextKeyedServiceFactory:
KeyedService* BuildServiceInstanceFor(
std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const override;
// Service needs to be running immediately in order to observe uninstalls.
bool ServiceIsCreatedWithBrowserContext() const override;
Expand Down

0 comments on commit 36e72e3

Please sign in to comment.