Skip to content

Commit

Permalink
Bug 1614923 - Disable the FOGotype. r=chutten
Browse files Browse the repository at this point in the history
This removes calling the initializer on the fog crate.
It leaves everything else in tact, including:

* Leaves the fog crate in tree, including its dependencies such as glean-preview
* Leaves the "fogotype" feature on gkrust-shared in place, ensuring glean is still compiled on nightly
  * it's not used, so it should just get removed at link time
* Leaves the build config untouched (which sets the `MOZ_FOGOTYPE` definition)

Differential Revision: https://phabricator.services.mozilla.com/D62579

--HG--
extra : moz-landing-system : lando
  • Loading branch information
badboy committed Feb 12, 2020
1 parent c354a21 commit cc6a46d
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions toolkit/components/telemetry/core/Telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1167,57 +1167,6 @@ TelemetryImpl::GetIsOfficialTelemetry(bool* ret) {
return NS_OK;
}

#if defined(MOZ_FOGOTYPE)
// The FOGotype API is implemented in Rust and exposed to C++ via a set of
// C functions with the "fog_" prefix.
// See toolkit/components/telemetry/fog/*.
extern "C" {
nsresult fog_init(const nsAString* dataDir, const nsAString* pingsenderPath);
}

static void internal_initFogotype(bool aUseTelemetry) {
nsCOMPtr<nsIFile> dataDir;
nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(dataDir));
if (NS_FAILED(rv)) {
NS_WARNING("Couldn't get temp dir. Bailing on FOGotype.");
return;
}

rv = dataDir->AppendNative(nsPrintfCString("fogotype.%d", base::GetCurrentProcId()));
if (NS_FAILED(rv)) {
NS_WARNING("Couldn't get data dir. Bailing on FOGotype.");
return;
}

nsAutoString path;
rv = dataDir->GetPath(path);
if (NS_FAILED(rv)) {
NS_WARNING("Couldn't get data path. Bailing on FOGotype.");
return;
}

nsCOMPtr<nsIFile> pingsender;
rv = NS_GetSpecialDirectory(NS_GRE_BIN_DIR, getter_AddRefs(pingsender));
if (NS_FAILED(rv)) {
NS_WARNING("Couldn't find pingsender. Bailing on FOGotype");
return;
}
# ifdef XP_WIN
pingsender->Append(NS_LITERAL_STRING("pingsender.exe"));
# else
pingsender->Append(NS_LITERAL_STRING("pingsender"));
# endif
nsAutoString pingsenderPath;
rv = pingsender->GetPath(pingsenderPath);
if (NS_FAILED(rv)) {
NS_WARNING("Couldn't get pingsender path. Bailing on FOGotype.");
return;
}

Unused << NS_WARN_IF(NS_FAILED(fog_init(&path, &pingsenderPath)));
}
#endif // defined(MOZ_FOGOTYPE)

already_AddRefed<nsITelemetry> TelemetryImpl::CreateTelemetryInstance() {
{
auto lock = sTelemetry.Lock();
Expand Down Expand Up @@ -1275,12 +1224,6 @@ already_AddRefed<nsITelemetry> TelemetryImpl::CreateTelemetryInstance() {
}
#endif

#if defined(MOZ_FOGOTYPE)
if (XRE_IsParentProcess()) {
internal_initFogotype(useTelemetry);
}
#endif

return ret.forget();
}

Expand Down

0 comments on commit cc6a46d

Please sign in to comment.