зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1821283 - OHTTP experiment setup r=keeler,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D172122
This commit is contained in:
Родитель
983c039377
Коммит
66f1a30d33
|
@ -21,6 +21,11 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
setTimeout: "resource://gre/modules/Timer.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.jsm",
|
||||
ExperimentAPI: "resource://nimbus/ExperimentAPI.jsm",
|
||||
});
|
||||
|
||||
// When this is set we suppress automatic TRR selection beyond dry-run as well
|
||||
// as sending observer notifications during heuristics throttling.
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
|
@ -235,10 +240,19 @@ export const DoHController = {
|
|||
// If we enter this branch it means that no automatic selection was possible.
|
||||
// In this case, we try to set a fallback (as defined by DoHConfigController).
|
||||
if (!lazy.Preferences.isSet(ROLLOUT_URI_PREF)) {
|
||||
lazy.Preferences.set(
|
||||
ROLLOUT_URI_PREF,
|
||||
lazy.DoHConfigController.currentConfig.fallbackProviderURI
|
||||
);
|
||||
let uri = lazy.DoHConfigController.currentConfig.fallbackProviderURI;
|
||||
|
||||
// If part of the treatment branch use the URL from the experiment.
|
||||
try {
|
||||
let ohttpURI = lazy.NimbusFeatures.dooh.getVariable("ohttpUri");
|
||||
if (ohttpURI) {
|
||||
uri = ohttpURI;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(`Error getting dooh.ohttpURI: ${e.message}`);
|
||||
}
|
||||
|
||||
lazy.Preferences.set(ROLLOUT_URI_PREF, uri);
|
||||
}
|
||||
this.runHeuristicsThrottled("startup");
|
||||
Services.obs.addObserver(this, kLinkStatusChangedTopic);
|
||||
|
@ -359,7 +373,12 @@ export const DoHController = {
|
|||
networkID: getHashedNetworkID(),
|
||||
};
|
||||
|
||||
if (results.steeredProvider) {
|
||||
const oHTTPexperiment = lazy.ExperimentAPI.getExperimentMetaData({
|
||||
featureId: "dooh",
|
||||
});
|
||||
|
||||
// When the OHTTP experiment is active we don't want to enable steering.
|
||||
if (results.steeredProvider && !oHTTPexperiment) {
|
||||
Services.dns.setDetectedTrrURI(results.steeredProvider.uri);
|
||||
resultsForTelemetry.steeredProvider = results.steeredProvider.id;
|
||||
}
|
||||
|
|
|
@ -984,6 +984,12 @@ dohPrefs:
|
|||
description: Same as trrUri, but set by the DoHController module.
|
||||
type: string
|
||||
setPref: "doh-rollout.uri"
|
||||
|
||||
dooh:
|
||||
description: "DNS over Oblivious HTTP"
|
||||
owner: vgosu@mozilla.com
|
||||
hasExposure: false
|
||||
variables:
|
||||
ohttpEnabled:
|
||||
description: Whether to use Oblivious HTTP for the resolution
|
||||
type: boolean
|
||||
|
@ -996,6 +1002,10 @@ dohPrefs:
|
|||
description: The URL used to fetch the configuration of the Oblivious HTTP gateway
|
||||
type: string
|
||||
setPref: "network.trr.ohttp.config_uri"
|
||||
ohttpUri:
|
||||
description: The URL of the Oblivious DNS over HTTPS target resource
|
||||
type: string
|
||||
setPref: "network.trr.ohttp.uri"
|
||||
|
||||
pingsender:
|
||||
description: "In-product usage of the pingsender telemetry reporter."
|
||||
|
|
Загрузка…
Ссылка в новой задаче