mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 1444275 - Don't set the telemetry pref in content processes. r=glandium
It'll be set via the normal parent-to-child pref setting process. MozReview-Commit-ID: By4mG7brc55 --HG-- extra : rebase_source : 480a289edf81b36395619a3bb9f5a1e065cb33d8
This commit is contained in:
parent
500ff7c746
commit
22b2a2e3c2
@ -3151,6 +3151,8 @@ TelemetryPrefValue()
|
||||
/* static */ void
|
||||
Preferences::SetupTelemetryPref()
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
Maybe<bool> telemetryPrefValue = TelemetryPrefValue();
|
||||
if (telemetryPrefValue.isSome()) {
|
||||
Preferences::SetBoolInAnyProcess(
|
||||
@ -3199,11 +3201,27 @@ TelemetryPrefValue()
|
||||
/* static */ void
|
||||
Preferences::SetupTelemetryPref()
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
Preferences::SetBoolInAnyProcess(
|
||||
kTelemetryPref, TelemetryPrefValue(), PrefValueKind::Default);
|
||||
Preferences::LockInAnyProcess(kTelemetryPref);
|
||||
}
|
||||
|
||||
static void
|
||||
CheckTelemetryPref()
|
||||
{
|
||||
MOZ_ASSERT(!XRE_IsParentProcess());
|
||||
|
||||
// Make sure the children got passed the right telemetry pref details.
|
||||
DebugOnly<bool> value;
|
||||
MOZ_ASSERT(NS_SUCCEEDED(Preferences::GetBool(kTelemetryPref, &value)) &&
|
||||
value == TelemetryPrefValue());
|
||||
// njn: uncomment after bug 1436911 lands; it ensures that the locked status
|
||||
// is passed correctly
|
||||
// MOZ_ASSERT(Preferences::IsLocked(kTelemetryPref));
|
||||
}
|
||||
|
||||
#endif // MOZ_WIDGET_ANDROID
|
||||
|
||||
/* static */ already_AddRefed<Preferences>
|
||||
@ -3242,6 +3260,10 @@ Preferences::GetInstanceForService()
|
||||
delete gChangedDomPrefs;
|
||||
gChangedDomPrefs = nullptr;
|
||||
|
||||
#ifndef MOZ_WIDGET_ANDROID
|
||||
CheckTelemetryPref();
|
||||
#endif
|
||||
|
||||
} else {
|
||||
// Check if there is a deployment configuration file. If so, set up the
|
||||
// pref config machinery, which will actually read the file.
|
||||
@ -4245,7 +4267,9 @@ Preferences::InitInitialObjects()
|
||||
}
|
||||
}
|
||||
|
||||
if (XRE_IsParentProcess()) {
|
||||
SetupTelemetryPref();
|
||||
}
|
||||
|
||||
NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID,
|
||||
nullptr,
|
||||
|
Loading…
Reference in New Issue
Block a user