Skip to content

Commit

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

Bug: 1396138
Change-Id: Iece7ebb503b4212f9d703fa8f26dcf88d4e84383
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4798401
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Auto-Submit: Arthur Milchior <arthurmilchior@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1187422}
  • Loading branch information
Arthur Milchior authored and Chromium LUCI CQ committed Aug 23, 2023
1 parent 030e44f commit 2e99090
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions extensions/browser/warning_service_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ WarningServiceFactory::WarningServiceFactory()
WarningServiceFactory::~WarningServiceFactory() {
}

KeyedService* WarningServiceFactory::BuildServiceInstanceFor(
std::unique_ptr<KeyedService>
WarningServiceFactory::BuildServiceInstanceForBrowserContext(
BrowserContext* context) const {
return new WarningService(context);
return std::make_unique<WarningService>(context);
}

BrowserContext* WarningServiceFactory::GetBrowserContextToUse(
Expand Down
2 changes: 1 addition & 1 deletion extensions/browser/warning_service_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WarningServiceFactory : public BrowserContextKeyedServiceFactory {
~WarningServiceFactory() override;

// BrowserContextKeyedServiceFactory implementation
KeyedService* BuildServiceInstanceFor(
std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const override;
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
Expand Down

0 comments on commit 2e99090

Please sign in to comment.