mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-28 19:27:53 -05:00
service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
This commit is contained in:
@ -17,7 +17,7 @@ namespace Service::Friend {
|
||||
|
||||
class IFriendService final : public ServiceFramework<IFriendService> {
|
||||
public:
|
||||
IFriendService() : ServiceFramework("IFriendService") {
|
||||
explicit IFriendService(Core::System& system_) : ServiceFramework{system_, "IFriendService"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "GetCompletionEvent"},
|
||||
@ -171,8 +171,8 @@ private:
|
||||
|
||||
class INotificationService final : public ServiceFramework<INotificationService> {
|
||||
public:
|
||||
INotificationService(Common::UUID uuid, Core::System& system)
|
||||
: ServiceFramework("INotificationService"), uuid(uuid) {
|
||||
explicit INotificationService(Common::UUID uuid_, Core::System& system_)
|
||||
: ServiceFramework{system_, "INotificationService"}, uuid{uuid_} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &INotificationService::GetEvent, "GetEvent"},
|
||||
@ -267,7 +267,7 @@ private:
|
||||
void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IFriendService>();
|
||||
rb.PushIpcInterface<IFriendService>(system);
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
}
|
||||
|
||||
@ -282,8 +282,9 @@ void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx
|
||||
rb.PushIpcInterface<INotificationService>(uuid, system);
|
||||
}
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)), system(system) {}
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_,
|
||||
const char* name)
|
||||
: ServiceFramework{system_, name}, module{std::move(module_)} {}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
|
||||
|
Reference in New Issue
Block a user