Skip to content

Commit 1627ed7

Browse files
committed
Bug 1844665 - rename RPMSetBoolPref so it's more obvious you can use it for int/char prefs, r=jhirsch
Differential Revision: https://phabricator.services.mozilla.com/D184742
1 parent 931bbe3 commit 1627ed7

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

browser/components/protections/content/protections.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ document.addEventListener("DOMContentLoaded", e => {
390390
let exitIcon = document.querySelector("#mobile-hanger .exit-icon");
391391
// hide the mobile promotion and keep hidden with a pref.
392392
exitIcon.addEventListener("click", () => {
393-
RPMSetBoolPref("browser.contentblocking.report.show_mobile_app", false);
393+
RPMSetPref("browser.contentblocking.report.show_mobile_app", false);
394394
document.getElementById("mobile-hanger").classList.add("hidden");
395395
});
396396

browser/components/protections/content/vpn-card.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default class VPNCard {
7474
);
7575

7676
// hide the promo banner if the user is already subscribed to vpn
77-
await RPMSetBoolPref(
77+
await RPMSetPref(
7878
"browser.contentblocking.report.hide_vpn_banner",
7979
true
8080
);
@@ -98,6 +98,6 @@ export default class VPNCard {
9898
vpnBanner.classList.remove("hidden");
9999
this.doc.sendTelemetryEvent("show", "vpn_banner");
100100
// VPN banner only shows on the first visit, flip a pref so it does not show again.
101-
RPMSetBoolPref("browser.contentblocking.report.hide_vpn_banner", true);
101+
RPMSetPref("browser.contentblocking.report.hide_vpn_banner", true);
102102
}
103103
}

toolkit/actors/RemotePageChild.sys.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class RemotePageChild extends JSWindowActorChild {
3333
"RPMGetIntPref",
3434
"RPMGetStringPref",
3535
"RPMGetBoolPref",
36-
"RPMSetBoolPref",
36+
"RPMSetPref",
3737
"RPMGetFormatURLPref",
3838
"RPMIsWindowPrivate",
3939
];
@@ -205,7 +205,7 @@ export class RemotePageChild extends JSWindowActorChild {
205205
return Services.prefs.getBoolPref(aPref);
206206
}
207207

208-
RPMSetBoolPref(aPref, aVal) {
208+
RPMSetPref(aPref, aVal) {
209209
return this.wrapPromise(lazy.AsyncPrefs.set(aPref, aVal));
210210
}
211211

toolkit/content/aboutNetError.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ function showNativeFallbackWarning() {
634634
"nativeFallbackIgnoreButton"
635635
);
636636
nativeFallbackIgnoreButton.addEventListener("click", () => {
637-
RPMSetBoolPref("network.trr.display_fallback_warning", false);
637+
RPMSetPref("network.trr.display_fallback_warning", false);
638638
retryThis(nativeFallbackIgnoreButton);
639639
});
640640

@@ -876,7 +876,7 @@ function setupBlockingReportingUI() {
876876
checkbox.checked = !!reportingAutomatic;
877877

878878
checkbox.addEventListener("change", function ({ target: { checked } }) {
879-
RPMSetBoolPref("security.xfocsp.errorReporting.automatic", checked);
879+
RPMSetPref("security.xfocsp.errorReporting.automatic", checked);
880880

881881
// If we're enabling reports, send a report for this failure.
882882
if (checked) {

toolkit/modules/RemotePageAccessManager.sys.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export let RemotePageAccessManager = {
101101
"security.xfocsp.errorReporting.enabled",
102102
"network.trr.display_fallback_warning",
103103
],
104-
RPMSetBoolPref: [
104+
RPMSetPref: [
105105
"security.xfocsp.errorReporting.automatic",
106106
"network.trr.display_fallback_warning",
107107
],
@@ -190,7 +190,7 @@ export let RemotePageAccessManager = {
190190
],
191191
RPMAddMessageListener: ["*"],
192192
RPMRemoveMessageListener: ["*"],
193-
RPMSetBoolPref: [
193+
RPMSetPref: [
194194
"browser.contentblocking.report.show_mobile_app",
195195
"browser.contentblocking.report.hide_vpn_banner",
196196
],

tools/lint/eslint/eslint-plugin-mozilla/lib/environments/remote-page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
RPMGetIntPref: false,
1919
RPMGetStringPref: false,
2020
RPMGetBoolPref: false,
21-
RPMSetBoolPref: false,
21+
RPMSetPref: false,
2222
RPMGetFormatURLPref: false,
2323
RPMIsTRROnlyFailure: false,
2424
RPMIsFirefox: false,

0 commit comments

Comments
 (0)