From 2fb3b9b951d08da071841a6bb4e02439e7d78698 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 28 May 2019 20:56:22 -0400 Subject: core/telemetry_session: Remove unused include --- src/core/telemetry_session.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/core/telemetry_session.h') diff --git a/src/core/telemetry_session.h b/src/core/telemetry_session.h index cae5a45a0..8229d1333 100644 --- a/src/core/telemetry_session.h +++ b/src/core/telemetry_session.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "common/telemetry.h" -- cgit v1.2.3 From 05af9d915ced92e72e20e3a2d6db831ad5a9a8e6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 28 May 2019 21:07:34 -0400 Subject: core/telemetry_session: Explicitly delete copy and move constructors NonCopyable is misleading here. It also makes the class non-moveable as well, so we can be explicit about this. --- src/core/telemetry_session.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/core/telemetry_session.h') diff --git a/src/core/telemetry_session.h b/src/core/telemetry_session.h index 8229d1333..7d0c8d413 100644 --- a/src/core/telemetry_session.h +++ b/src/core/telemetry_session.h @@ -14,11 +14,17 @@ namespace Core { * session, logging any one-time fields. Interfaces with the telemetry backend used for submitting * data to the web service. Submits session data on close. */ -class TelemetrySession : NonCopyable { +class TelemetrySession { public: TelemetrySession(); ~TelemetrySession(); + TelemetrySession(const TelemetrySession&) = delete; + TelemetrySession& operator=(const TelemetrySession&) = delete; + + TelemetrySession(TelemetrySession&&) = delete; + TelemetrySession& operator=(TelemetrySession&&) = delete; + /** * Wrapper around the Telemetry::FieldCollection::AddField method. * @param type Type of the field to add. -- cgit v1.2.3 From 215fd827384904f1cb7fa689ff8cd3f61dbbd007 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 28 May 2019 21:12:23 -0400 Subject: 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. --- src/core/telemetry_session.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/core/telemetry_session.h') 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 @@ #include #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; @@ -25,6 +29,22 @@ public: TelemetrySession(TelemetrySession&&) = delete; 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. -- cgit v1.2.3