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

* refactor: update BadgeManagerFactory

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: update NetworkContextServiceFactory

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: update ElectronExtensionSystemFactory

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: update UsbChooserContextFactory

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: update UsbHidChooserContextFactory

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: update SerialChooserContextFactory

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: update FileSystemAccessPermissionContextFactory

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* empty commit

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-09-13 15:26:10 -05:00 committed by GitHub
parent 7a04a77ed0
commit 748f293400
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 42 additions and 36 deletions

View file

@ -36,15 +36,9 @@ FileSystemAccessPermissionContextFactory::
FileSystemAccessPermissionContextFactory::
~FileSystemAccessPermissionContextFactory() = default;
// static
KeyedService* FileSystemAccessPermissionContextFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
return BuildInstanceFor(context).release();
}
std::unique_ptr<KeyedService>
FileSystemAccessPermissionContextFactory::BuildInstanceFor(
content::BrowserContext* context) {
FileSystemAccessPermissionContextFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const {
return std::make_unique<FileSystemAccessPermissionContext>(context);
}

View file

@ -5,6 +5,8 @@
#ifndef ELECTRON_SHELL_BROWSER_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_H_
#define ELECTRON_SHELL_BROWSER_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_PERMISSION_CONTEXT_FACTORY_H_
#include <memory>
#include "base/no_destructor.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "shell/browser/file_system_access/file_system_access_permission_context.h"
@ -18,9 +20,6 @@ class FileSystemAccessPermissionContextFactory
content::BrowserContext* context);
static FileSystemAccessPermissionContextFactory* GetInstance();
static std::unique_ptr<KeyedService> BuildInstanceFor(
content::BrowserContext* context);
FileSystemAccessPermissionContextFactory(
const FileSystemAccessPermissionContextFactory&) = delete;
FileSystemAccessPermissionContextFactory& operator=(
@ -33,7 +32,7 @@ class FileSystemAccessPermissionContextFactory
~FileSystemAccessPermissionContextFactory() override;
// BrowserContextKeyedServiceFactory:
KeyedService* BuildServiceInstanceFor(
std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const override;
};