summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2018-08-11 13:17:06 +1000
committerGravatar David Marcec2018-08-11 13:17:06 +1000
commit6aa8ee6943f6ae8b0ed1770b91355b36c2618a4c (patch)
treead26da7ddef3252817beeddba47e9912c822b4ff /src
parentMerge remote-tracking branch 'origin/master' into better-account (diff)
downloadyuzu-6aa8ee6943f6ae8b0ed1770b91355b36c2618a4c.tar.gz
yuzu-6aa8ee6943f6ae8b0ed1770b91355b36c2618a4c.tar.xz
yuzu-6aa8ee6943f6ae8b0ed1770b91355b36c2618a4c.zip
Refactored profile manager sharing
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/acc/acc.cpp17
-rw-r--r--src/core/hle/service/acc/acc.h7
-rw-r--r--src/core/hle/service/acc/acc_aa.cpp3
-rw-r--r--src/core/hle/service/acc/acc_aa.h3
-rw-r--r--src/core/hle/service/acc/acc_su.cpp3
-rw-r--r--src/core/hle/service/acc/acc_su.h3
-rw-r--r--src/core/hle/service/acc/acc_u0.cpp3
-rw-r--r--src/core/hle/service/acc/acc_u0.h3
-rw-r--r--src/core/hle/service/acc/acc_u1.cpp3
-rw-r--r--src/core/hle/service/acc/acc_u1.h3
10 files changed, 28 insertions, 20 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index e74379a24..22e44368a 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -197,17 +197,18 @@ void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestCo
197 LOG_DEBUG(Service_ACC, "called"); 197 LOG_DEBUG(Service_ACC, "called");
198} 198}
199 199
200Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) 200Module::Interface::Interface(std::shared_ptr<Module> module,
201 : ServiceFramework(name), module(std::move(module)) { 201 std::shared_ptr<ProfileManager> profile_manager, const char* name)
202 profile_manager = std::make_unique<ProfileManager>(); 202 : ServiceFramework(name), module(std::move(module)),
203} 203 profile_manager(std::make_shared<ProfileManager>(*profile_manager)) {}
204 204
205void InstallInterfaces(SM::ServiceManager& service_manager) { 205void InstallInterfaces(SM::ServiceManager& service_manager) {
206 auto module = std::make_shared<Module>(); 206 auto module = std::make_shared<Module>();
207 std::make_shared<ACC_AA>(module)->InstallAsService(service_manager); 207 auto profile_manager = std::make_shared<ProfileManager>();
208 std::make_shared<ACC_SU>(module)->InstallAsService(service_manager); 208 std::make_shared<ACC_AA>(module, profile_manager)->InstallAsService(service_manager);
209 std::make_shared<ACC_U0>(module)->InstallAsService(service_manager); 209 std::make_shared<ACC_SU>(module, profile_manager)->InstallAsService(service_manager);
210 std::make_shared<ACC_U1>(module)->InstallAsService(service_manager); 210 std::make_shared<ACC_U0>(module, profile_manager)->InstallAsService(service_manager);
211 std::make_shared<ACC_U1>(module, profile_manager)->InstallAsService(service_manager);
211} 212}
212 213
213} // namespace Service::Account 214} // namespace Service::Account
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h
index 89d92c1c7..a94e6f588 100644
--- a/src/core/hle/service/acc/acc.h
+++ b/src/core/hle/service/acc/acc.h
@@ -13,7 +13,8 @@ class Module final {
13public: 13public:
14 class Interface : public ServiceFramework<Interface> { 14 class Interface : public ServiceFramework<Interface> {
15 public: 15 public:
16 explicit Interface(std::shared_ptr<Module> module, const char* name); 16 explicit Interface(std::shared_ptr<Module> module,
17 std::shared_ptr<ProfileManager> profile_manager, const char* name);
17 18
18 void GetUserCount(Kernel::HLERequestContext& ctx); 19 void GetUserCount(Kernel::HLERequestContext& ctx);
19 void GetUserExistence(Kernel::HLERequestContext& ctx); 20 void GetUserExistence(Kernel::HLERequestContext& ctx);
@@ -25,11 +26,9 @@ public:
25 void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx); 26 void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx);
26 void IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx); 27 void IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx);
27 28
28 private:
29 std::unique_ptr<ProfileManager> profile_manager{};
30
31 protected: 29 protected:
32 std::shared_ptr<Module> module; 30 std::shared_ptr<Module> module;
31 std::shared_ptr<ProfileManager> profile_manager;
33 }; 32 };
34}; 33};
35 34
diff --git a/src/core/hle/service/acc/acc_aa.cpp b/src/core/hle/service/acc/acc_aa.cpp
index 280b3e464..9bd595a37 100644
--- a/src/core/hle/service/acc/acc_aa.cpp
+++ b/src/core/hle/service/acc/acc_aa.cpp
@@ -6,7 +6,8 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_AA::ACC_AA(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:aa") { 9ACC_AA::ACC_AA(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager)
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:aa") {
10 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
11 {0, nullptr, "EnsureCacheAsync"}, 12 {0, nullptr, "EnsureCacheAsync"},
12 {1, nullptr, "LoadCache"}, 13 {1, nullptr, "LoadCache"},
diff --git a/src/core/hle/service/acc/acc_aa.h b/src/core/hle/service/acc/acc_aa.h
index 796f7ef85..2e08c781a 100644
--- a/src/core/hle/service/acc/acc_aa.h
+++ b/src/core/hle/service/acc/acc_aa.h
@@ -10,7 +10,8 @@ namespace Service::Account {
10 10
11class ACC_AA final : public Module::Interface { 11class ACC_AA final : public Module::Interface {
12public: 12public:
13 explicit ACC_AA(std::shared_ptr<Module> module); 13 explicit ACC_AA(std::shared_ptr<Module> module,
14 std::shared_ptr<ProfileManager> profile_manager);
14}; 15};
15 16
16} // namespace Service::Account 17} // namespace Service::Account
diff --git a/src/core/hle/service/acc/acc_su.cpp b/src/core/hle/service/acc/acc_su.cpp
index 5973768be..0218ee859 100644
--- a/src/core/hle/service/acc/acc_su.cpp
+++ b/src/core/hle/service/acc/acc_su.cpp
@@ -6,7 +6,8 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_SU::ACC_SU(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:su") { 9ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager)
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:su") {
10 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
11 {0, &ACC_SU::GetUserCount, "GetUserCount"}, 12 {0, &ACC_SU::GetUserCount, "GetUserCount"},
12 {1, &ACC_SU::GetUserExistence, "GetUserExistence"}, 13 {1, &ACC_SU::GetUserExistence, "GetUserExistence"},
diff --git a/src/core/hle/service/acc/acc_su.h b/src/core/hle/service/acc/acc_su.h
index 3894a6991..79a47d88d 100644
--- a/src/core/hle/service/acc/acc_su.h
+++ b/src/core/hle/service/acc/acc_su.h
@@ -11,7 +11,8 @@ namespace Account {
11 11
12class ACC_SU final : public Module::Interface { 12class ACC_SU final : public Module::Interface {
13public: 13public:
14 explicit ACC_SU(std::shared_ptr<Module> module); 14 explicit ACC_SU(std::shared_ptr<Module> module,
15 std::shared_ptr<ProfileManager> profile_manager);
15}; 16};
16 17
17} // namespace Account 18} // namespace Account
diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp
index b6fe45dd8..84a4d05b8 100644
--- a/src/core/hle/service/acc/acc_u0.cpp
+++ b/src/core/hle/service/acc/acc_u0.cpp
@@ -6,7 +6,8 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_U0::ACC_U0(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:u0") { 9ACC_U0::ACC_U0(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager)
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:u0") {
10 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
11 {0, &ACC_U0::GetUserCount, "GetUserCount"}, 12 {0, &ACC_U0::GetUserCount, "GetUserCount"},
12 {1, &ACC_U0::GetUserExistence, "GetUserExistence"}, 13 {1, &ACC_U0::GetUserExistence, "GetUserExistence"},
diff --git a/src/core/hle/service/acc/acc_u0.h b/src/core/hle/service/acc/acc_u0.h
index 6ded596b3..e8a114f99 100644
--- a/src/core/hle/service/acc/acc_u0.h
+++ b/src/core/hle/service/acc/acc_u0.h
@@ -10,7 +10,8 @@ namespace Service::Account {
10 10
11class ACC_U0 final : public Module::Interface { 11class ACC_U0 final : public Module::Interface {
12public: 12public:
13 explicit ACC_U0(std::shared_ptr<Module> module); 13 explicit ACC_U0(std::shared_ptr<Module> module,
14 std::shared_ptr<ProfileManager> profile_manager);
14}; 15};
15 16
16} // namespace Service::Account 17} // namespace Service::Account
diff --git a/src/core/hle/service/acc/acc_u1.cpp b/src/core/hle/service/acc/acc_u1.cpp
index 99e3f1ef6..495693949 100644
--- a/src/core/hle/service/acc/acc_u1.cpp
+++ b/src/core/hle/service/acc/acc_u1.cpp
@@ -6,7 +6,8 @@
6 6
7namespace Service::Account { 7namespace Service::Account {
8 8
9ACC_U1::ACC_U1(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "acc:u1") { 9ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> profile_manager)
10 : Module::Interface(std::move(module), std::move(profile_manager), "acc:u1") {
10 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
11 {0, &ACC_U1::GetUserCount, "GetUserCount"}, 12 {0, &ACC_U1::GetUserCount, "GetUserCount"},
12 {1, &ACC_U1::GetUserExistence, "GetUserExistence"}, 13 {1, &ACC_U1::GetUserExistence, "GetUserExistence"},
diff --git a/src/core/hle/service/acc/acc_u1.h b/src/core/hle/service/acc/acc_u1.h
index 5e3e7659b..a77520e6f 100644
--- a/src/core/hle/service/acc/acc_u1.h
+++ b/src/core/hle/service/acc/acc_u1.h
@@ -10,7 +10,8 @@ namespace Service::Account {
10 10
11class ACC_U1 final : public Module::Interface { 11class ACC_U1 final : public Module::Interface {
12public: 12public:
13 explicit ACC_U1(std::shared_ptr<Module> module); 13 explicit ACC_U1(std::shared_ptr<Module> module,
14 std::shared_ptr<ProfileManager> profile_manager);
14}; 15};
15 16
16} // namespace Service::Account 17} // namespace Service::Account