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:
parent
29c2744e57
commit
1c3a5ba5d1
14 changed files with 42 additions and 36 deletions
|
@ -18,11 +18,11 @@ UsbChooserContextFactory::UsbChooserContextFactory()
|
|||
|
||||
UsbChooserContextFactory::~UsbChooserContextFactory() = default;
|
||||
|
||||
KeyedService* UsbChooserContextFactory::BuildServiceInstanceFor(
|
||||
std::unique_ptr<KeyedService>
|
||||
UsbChooserContextFactory::BuildServiceInstanceForBrowserContext(
|
||||
content::BrowserContext* context) const {
|
||||
auto* browser_context =
|
||||
static_cast<electron::ElectronBrowserContext*>(context);
|
||||
return new UsbChooserContext(browser_context);
|
||||
return std::make_unique<UsbChooserContext>(
|
||||
static_cast<electron::ElectronBrowserContext*>(context));
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#ifndef ELECTRON_SHELL_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_
|
||||
#define ELECTRON_SHELL_BROWSER_USB_USB_CHOOSER_CONTEXT_FACTORY_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
|
||||
|
||||
namespace base {
|
||||
|
@ -34,7 +36,7 @@ class UsbChooserContextFactory : public BrowserContextKeyedServiceFactory {
|
|||
~UsbChooserContextFactory() override;
|
||||
|
||||
// BrowserContextKeyedServiceFactory methods:
|
||||
KeyedService* BuildServiceInstanceFor(
|
||||
std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext(
|
||||
content::BrowserContext* profile) const override;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue