summaryrefslogtreecommitdiff
path: root/src/core/telemetry_session.h
diff options
context:
space:
mode:
authorGravatar Lioncash2019-05-28 21:12:23 -0400
committerGravatar Lioncash2019-05-28 22:28:15 -0400
commit215fd827384904f1cb7fa689ff8cd3f61dbbd007 (patch)
tree3c5d144f741228e966e13b576bfa0cadbaebd5fa /src/core/telemetry_session.h
parentcore/telemetry_session: Explicitly delete copy and move constructors (diff)
downloadyuzu-215fd827384904f1cb7fa689ff8cd3f61dbbd007.tar.gz
yuzu-215fd827384904f1cb7fa689ff8cd3f61dbbd007.tar.xz
yuzu-215fd827384904f1cb7fa689ff8cd3f61dbbd007.zip
core/telemetry_session: Remove usages of the global system accessor
Makes the dependency explicit in the TelemetrySession's interface instead of making it a hidden dependency. This also revealed a hidden issue with the way the telemetry session was being initialized. It was attempting to retrieve the app loader and log out title-specific information. However, this isn't always guaranteed to be possible. During the initialization phase, everything is being constructed. It doesn't mean an actual title has been selected. This is what the Load() function is for. This potentially results in dead code paths involving the app loader. Instead, we explicitly add this information when we know the app loader instance is available.
Diffstat (limited to 'src/core/telemetry_session.h')
-rw-r--r--src/core/telemetry_session.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/telemetry_session.h b/src/core/telemetry_session.h
index 7d0c8d413..17ac22377 100644
--- a/src/core/telemetry_session.h
+++ b/src/core/telemetry_session.h
@@ -7,6 +7,10 @@
7#include <string> 7#include <string>
8#include "common/telemetry.h" 8#include "common/telemetry.h"
9 9
10namespace Loader {
11class AppLoader;
12}
13
10namespace Core { 14namespace Core {
11 15
12/** 16/**
@@ -16,7 +20,7 @@ namespace Core {
16 */ 20 */
17class TelemetrySession { 21class TelemetrySession {
18public: 22public:
19 TelemetrySession(); 23 explicit TelemetrySession();
20 ~TelemetrySession(); 24 ~TelemetrySession();
21 25
22 TelemetrySession(const TelemetrySession&) = delete; 26 TelemetrySession(const TelemetrySession&) = delete;
@@ -26,6 +30,22 @@ public:
26 TelemetrySession& operator=(TelemetrySession&&) = delete; 30 TelemetrySession& operator=(TelemetrySession&&) = delete;
27 31
28 /** 32 /**
33 * Adds the initial telemetry info necessary when starting up a title.
34 *
35 * This includes information such as:
36 * - Telemetry ID
37 * - Initialization time
38 * - Title ID
39 * - Title name
40 * - Title file format
41 * - Miscellaneous settings values.
42 *
43 * @param app_loader The application loader to use to retrieve
44 * title-specific information.
45 */
46 void AddInitialInfo(Loader::AppLoader& app_loader);
47
48 /**
29 * Wrapper around the Telemetry::FieldCollection::AddField method. 49 * Wrapper around the Telemetry::FieldCollection::AddField method.
30 * @param type Type of the field to add. 50 * @param type Type of the field to add.
31 * @param name Name of the field to add. 51 * @param name Name of the field to add.