aboutsummaryrefslogtreecommitdiff
path: root/src/core/telemetry_session.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-05-28 21:12:23 -0400
committerLioncash <mathew1800@gmail.com>2019-05-28 22:28:15 -0400
commit215fd827384904f1cb7fa689ff8cd3f61dbbd007 (patch)
tree3c5d144f741228e966e13b576bfa0cadbaebd5fa /src/core/telemetry_session.h
parent05af9d915ced92e72e20e3a2d6db831ad5a9a8e6 (diff)
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 7d0c8d4131..17ac223777 100644
--- a/src/core/telemetry_session.h
+++ b/src/core/telemetry_session.h
@@ -7,6 +7,10 @@
#include <string>
#include "common/telemetry.h"
+namespace Loader {
+class AppLoader;
+}
+
namespace Core {
/**
@@ -16,7 +20,7 @@ namespace Core {
*/
class TelemetrySession {
public:
- TelemetrySession();
+ explicit TelemetrySession();
~TelemetrySession();
TelemetrySession(const TelemetrySession&) = delete;
@@ -26,6 +30,22 @@ public:
TelemetrySession& operator=(TelemetrySession&&) = delete;
/**
+ * Adds the initial telemetry info necessary when starting up a title.
+ *
+ * This includes information such as:
+ * - Telemetry ID
+ * - Initialization time
+ * - Title ID
+ * - Title name
+ * - Title file format
+ * - Miscellaneous settings values.
+ *
+ * @param app_loader The application loader to use to retrieve
+ * title-specific information.
+ */
+ void AddInitialInfo(Loader::AppLoader& app_loader);
+
+ /**
* Wrapper around the Telemetry::FieldCollection::AddField method.
* @param type Type of the field to add.
* @param name Name of the field to add.