Remove disabled remains of the performance data (= profiler data + text input) upload feature from the UserReporter from 0da7e822ff.

User-submitted text upload was removed in 2779512c6e in preference of
the bugtracker.
Remove leftover mainmenu.js function that this commit should have
removed.

Profiler data upload was disabled in b9e46f386b because the data amount
was too large and because the two timing snapshots are inconclusive
without further data.
The hereby removed exposed JS functions could have been exploited by JS
mods to upload 0ad userdata to arbitrary places.

The performance data upload feature can be redesigned, implemented
without JS exposure, with a more transparent privacy policy (refs
#5257).

Differential Revision: https://code.wildfiregames.com/D1597
Performance upload feature removal accepted by: Vladislav
This was SVN commit r21858.
This commit is contained in:
elexis
2018-08-05 15:18:00 +00:00
parent bdc68f85c9
commit 2af94c5898
7 changed files with 2 additions and 68 deletions
-12
View File
@@ -55,11 +55,6 @@ void JSI_Debug::DisplayErrorDialog(ScriptInterface::CxPrivate* UNUSED(pCxPrivate
debug_DisplayError(msg.c_str(), DE_NO_DEBUG_INFO, NULL, NULL, NULL, 0, NULL, NULL);
}
JS::Value JSI_Debug::GetProfilerState(ScriptInterface::CxPrivate* pCxPrivate)
{
return g_ProfileViewer.SaveToJS(*(pCxPrivate->pScriptInterface));
}
// Return the date/time at which the current executable was compiled.
// params: mode OR an integer specifying
// what to display: -1 for "date time (svn revision)", 0 for date, 1 for time, 2 for svn revision
@@ -137,23 +132,16 @@ std::string JSI_Debug::GetUserReportStatus(ScriptInterface::CxPrivate* UNUSED(pC
return g_UserReporter.GetStatus();
}
void JSI_Debug::SubmitUserReport(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::string& type, int version, const std::wstring& data)
{
g_UserReporter.SubmitReport(type.c_str(), version, utf8_from_wstring(data));
}
void JSI_Debug::RegisterScriptFunctions(const ScriptInterface& scriptInterface)
{
scriptInterface.RegisterFunction<double, &GetMicroseconds>("GetMicroseconds");
scriptInterface.RegisterFunction<int, &Crash>("Crash");
scriptInterface.RegisterFunction<void, &DebugWarn>("DebugWarn");
scriptInterface.RegisterFunction<void, std::wstring, &DisplayErrorDialog>("DisplayErrorDialog");
scriptInterface.RegisterFunction<JS::Value, &GetProfilerState>("GetProfilerState");
scriptInterface.RegisterFunction<std::wstring, int, &GetBuildTimestamp>("GetBuildTimestamp");
// User report functions
scriptInterface.RegisterFunction<bool, &IsUserReportEnabled>("IsUserReportEnabled");
scriptInterface.RegisterFunction<void, bool, &SetUserReportEnabled>("SetUserReportEnabled");
scriptInterface.RegisterFunction<std::string, &GetUserReportStatus>("GetUserReportStatus");
scriptInterface.RegisterFunction<void, std::string, int, std::wstring, &SubmitUserReport>("SubmitUserReport");
}