refactor: remove use of deprecated API BuildServiceInstanceFor() (#43690)

* refactor: update BadgeManagerFactory

* refactor: update NetworkContextServiceFactory

* refactor: update ElectronExtensionSystemFactory

* refactor: update UsbChooserContextFactory

* refactor: update UsbHidChooserContextFactory

* refactor: update SerialChooserContextFactory

* refactor: update FileSystemAccessPermissionContextFactory
This commit is contained in:
Charles Kerr 2024-09-12 15:44:14 -05:00 committed by GitHub
parent 29c2744e57
commit 1c3a5ba5d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 42 additions and 36 deletions

View file

@ -29,9 +29,10 @@ NetworkContextServiceFactory::NetworkContextServiceFactory()
NetworkContextServiceFactory::~NetworkContextServiceFactory() = default;
KeyedService* NetworkContextServiceFactory::BuildServiceInstanceFor(
std::unique_ptr<KeyedService>
NetworkContextServiceFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const {
return new NetworkContextService(
return std::make_unique<NetworkContextService>(
static_cast<ElectronBrowserContext*>(context));
}

View file

@ -5,6 +5,8 @@
#ifndef ELECTRON_SHELL_BROWSER_NET_NETWORK_CONTEXT_SERVICE_FACTORY_H_
#define ELECTRON_SHELL_BROWSER_NET_NETWORK_CONTEXT_SERVICE_FACTORY_H_
#include <memory>
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
class KeyedService;
@ -43,7 +45,7 @@ class NetworkContextServiceFactory : public BrowserContextKeyedServiceFactory {
~NetworkContextServiceFactory() override;
// BrowserContextKeyedServiceFactory implementation:
KeyedService* BuildServiceInstanceFor(
std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const override;
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;