Skip to content

Commit 1f830c9

Browse files
author
Victor Porof
committed
Bug 1561435 - Format browser/components/, a=automatic-formatting
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36042 --HG-- extra : source : d3afcafdce650a6f36cebbc126ee93b17f13cf52
1 parent f9f5914 commit 1f830c9

File tree

1,654 files changed

+130459
-62198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,654 files changed

+130459
-62198
lines changed

browser/components/BrowserContentHandler.jsm

Lines changed: 305 additions & 144 deletions
Large diffs are not rendered by default.

browser/components/BrowserGlue.jsm

Lines changed: 1309 additions & 633 deletions
Large diffs are not rendered by default.

browser/components/about/AboutNetErrorHandler.jsm

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66

77
var EXPORTED_SYMBOLS = ["AboutNetErrorHandler"];
88

9-
const {RemotePages} = ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm");
10-
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
11-
ChromeUtils.defineModuleGetter(this, "BrowserUtils", "resource://gre/modules/BrowserUtils.jsm");
9+
const { RemotePages } = ChromeUtils.import(
10+
"resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm"
11+
);
12+
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
13+
ChromeUtils.defineModuleGetter(
14+
this,
15+
"BrowserUtils",
16+
"resource://gre/modules/BrowserUtils.jsm"
17+
);
1218

1319
var AboutNetErrorHandler = {
1420
_inited: false,
@@ -52,28 +58,34 @@ var AboutNetErrorHandler = {
5258
// Send a message to the content when a captive portal is freed
5359
// so that error pages can refresh themselves.
5460
this.pageListener.sendAsyncMessage("AboutNetErrorCaptivePortalFreed");
55-
break;
61+
break;
5662
}
5763
},
5864

5965
receiveMessage(msg) {
6066
switch (msg.name) {
6167
case "Browser:OpenCaptivePortalPage":
6268
Services.obs.notifyObservers(null, "ensure-captive-portal-tab");
63-
break;
69+
break;
6470
case "Browser:PrimeMitm":
6571
this.primeMitm(msg.target.browser);
66-
break;
72+
break;
6773
case "Browser:ResetEnterpriseRootsPref":
6874
Services.prefs.clearUserPref("security.enterprise_roots.enabled");
6975
Services.prefs.clearUserPref("security.enterprise_roots.auto-enabled");
70-
break;
76+
break;
7177
case "RecordCertErrorLoad":
72-
Services.telemetry.recordEvent("security.ui.certerror", "load", "aboutcerterror", msg.data.errorCode, {
73-
has_sts: msg.data.has_sts.toString(),
74-
is_frame: msg.data.is_frame.toString(),
75-
});
76-
break;
78+
Services.telemetry.recordEvent(
79+
"security.ui.certerror",
80+
"load",
81+
"aboutcerterror",
82+
msg.data.errorCode,
83+
{
84+
has_sts: msg.data.has_sts.toString(),
85+
is_frame: msg.data.is_frame.toString(),
86+
}
87+
);
88+
break;
7789
}
7890
},
7991

@@ -88,8 +100,10 @@ var AboutNetErrorHandler = {
88100
return;
89101
}
90102

91-
let url = Services.prefs.getStringPref("security.certerrors.mitm.priming.endpoint");
92-
let request = new XMLHttpRequest({mozAnon: true});
103+
let url = Services.prefs.getStringPref(
104+
"security.certerrors.mitm.priming.endpoint"
105+
);
106+
let request = new XMLHttpRequest({ mozAnon: true });
93107
request.open("HEAD", url);
94108
request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
95109
request.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
@@ -100,7 +114,9 @@ var AboutNetErrorHandler = {
100114
return;
101115
}
102116

103-
let secInfo = request.channel.securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
117+
let secInfo = request.channel.securityInfo.QueryInterface(
118+
Ci.nsITransportSecurityInfo
119+
);
104120
if (secInfo.errorCodeString != "SEC_ERROR_UNKNOWN_ISSUER") {
105121
return;
106122
}
@@ -110,22 +126,39 @@ var AboutNetErrorHandler = {
110126
if (secInfo.serverCert && secInfo.serverCert.issuerName) {
111127
// Grab the issuer of the certificate used in the exchange and store it so that our
112128
// network-level MitM detection code has a comparison baseline.
113-
Services.prefs.setStringPref("security.pki.mitm_canary_issuer", secInfo.serverCert.issuerName);
129+
Services.prefs.setStringPref(
130+
"security.pki.mitm_canary_issuer",
131+
secInfo.serverCert.issuerName
132+
);
114133

115134
// MitM issues are sometimes caused by software not registering their root certs in the
116135
// Firefox root store. We might opt for using third party roots from the system root store.
117-
if (Services.prefs.getBoolPref("security.certerrors.mitm.auto_enable_enterprise_roots")) {
118-
if (!Services.prefs.getBoolPref("security.enterprise_roots.enabled")) {
136+
if (
137+
Services.prefs.getBoolPref(
138+
"security.certerrors.mitm.auto_enable_enterprise_roots"
139+
)
140+
) {
141+
if (
142+
!Services.prefs.getBoolPref("security.enterprise_roots.enabled")
143+
) {
119144
// Loading enterprise roots happens on a background thread, so wait for import to finish.
120-
BrowserUtils.promiseObserved("psm:enterprise-certs-imported").then(() => {
121-
if (browser.documentURI.spec.startsWith("about:certerror")) {
122-
browser.reload();
145+
BrowserUtils.promiseObserved("psm:enterprise-certs-imported").then(
146+
() => {
147+
if (browser.documentURI.spec.startsWith("about:certerror")) {
148+
browser.reload();
149+
}
123150
}
124-
});
151+
);
125152

126-
Services.prefs.setBoolPref("security.enterprise_roots.enabled", true);
153+
Services.prefs.setBoolPref(
154+
"security.enterprise_roots.enabled",
155+
true
156+
);
127157
// Record that this pref was automatically set.
128-
Services.prefs.setBoolPref("security.enterprise_roots.auto-enabled", true);
158+
Services.prefs.setBoolPref(
159+
"security.enterprise_roots.auto-enabled",
160+
true
161+
);
129162
}
130163
} else {
131164
// Need to reload the page to make sure network code picks up the canary issuer pref.

browser/components/about/AboutPrivateBrowsingHandler.jsm

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66

77
var EXPORTED_SYMBOLS = ["AboutPrivateBrowsingHandler"];
88

9-
const {RemotePages} = ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm");
10-
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
9+
const { RemotePages } = ChromeUtils.import(
10+
"resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm"
11+
);
12+
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
1113

1214
var AboutPrivateBrowsingHandler = {
1315
_inited: false,
14-
_topics: [
15-
"OpenPrivateWindow",
16-
"SearchHandoff",
17-
],
16+
_topics: ["OpenPrivateWindow", "SearchHandoff"],
1817

1918
init() {
2019
this.pageListener = new RemotePages("about:privatebrowsing");
2120
for (let topic of this._topics) {
22-
this.pageListener.addMessageListener(topic, this.receiveMessage.bind(this));
21+
this.pageListener.addMessageListener(
22+
topic,
23+
this.receiveMessage.bind(this)
24+
);
2325
}
2426
this._inited = true;
2527
},
@@ -38,12 +40,13 @@ var AboutPrivateBrowsingHandler = {
3840
switch (aMessage.name) {
3941
case "OpenPrivateWindow": {
4042
let win = aMessage.target.browser.ownerGlobal;
41-
win.OpenBrowserWindow({private: true});
43+
win.OpenBrowserWindow({ private: true });
4244
break;
4345
}
4446
case "SearchHandoff": {
4547
let searchAlias = "";
46-
let searchAliases = Services.search.defaultEngine.wrappedJSObject.__internalAliases;
48+
let searchAliases =
49+
Services.search.defaultEngine.wrappedJSObject.__internalAliases;
4750
if (searchAliases && searchAliases.length > 0) {
4851
searchAlias = `${searchAliases[0]} `;
4952
}

browser/components/about/AboutProtectionsHandler.jsm

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
var EXPORTED_SYMBOLS = ["AboutProtectionsHandler"];
88

9-
const {RemotePages} = ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm");
9+
const { RemotePages } = ChromeUtils.import(
10+
"resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm"
11+
);
1012

1113
var AboutProtectionsHandler = {
1214
_inited: false,
13-
_topics: [
14-
"openContentBlockingPreferences",
15-
],
15+
_topics: ["openContentBlockingPreferences"],
1616

1717
init() {
1818
this.pageListener = new RemotePages("about:protections");
@@ -36,7 +36,9 @@ var AboutProtectionsHandler = {
3636
let win = aMessage.target.browser.ownerGlobal;
3737
switch (aMessage.name) {
3838
case "openContentBlockingPreferences":
39-
win.openPreferences("privacy-trackingprotection", {origin: "about-protections"});
39+
win.openPreferences("privacy-trackingprotection", {
40+
origin: "about-protections",
41+
});
4042
break;
4143
}
4244
},

browser/components/about/test/unit/test_getURIFlags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
1+
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
22

33
const contract = "@mozilla.org/network/protocol/about;1?what=newtab";
44
const am = Cc[contract].getService(Ci.nsIAboutModule);

0 commit comments

Comments
 (0)