mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -18,11 +18,11 @@ SerialChooserContextFactory::SerialChooserContextFactory()
|
||||
|
||||
SerialChooserContextFactory::~SerialChooserContextFactory() = default;
|
||||
|
||||
KeyedService* SerialChooserContextFactory::BuildServiceInstanceFor(
|
||||
std::unique_ptr<KeyedService>
|
||||
SerialChooserContextFactory::BuildServiceInstanceForBrowserContext(
|
||||
content::BrowserContext* context) const {
|
||||
auto* browser_context =
|
||||
static_cast<electron::ElectronBrowserContext*>(context);
|
||||
return new SerialChooserContext(browser_context);
|
||||
return std::make_unique<SerialChooserContext>(
|
||||
static_cast<electron::ElectronBrowserContext*>(context));
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef ELECTRON_SHELL_BROWSER_SERIAL_SERIAL_CHOOSER_CONTEXT_FACTORY_H_
|
||||
#define ELECTRON_SHELL_BROWSER_SERIAL_SERIAL_CHOOSER_CONTEXT_FACTORY_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
|
||||
#include "shell/browser/serial/serial_chooser_context.h"
|
||||
|
||||
@@ -35,7 +37,7 @@ class SerialChooserContextFactory : public BrowserContextKeyedServiceFactory {
|
||||
delete;
|
||||
|
||||
// BrowserContextKeyedServiceFactory methods:
|
||||
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