Merge autoland to mozilla-central a=merge

This commit is contained in:
Sandor Molnar 2024-10-15 19:17:33 +03:00
commit 8a5b9d3639
47 changed files with 736 additions and 613 deletions

View File

@ -130,6 +130,7 @@
orient="vertical"
type="autocomplete-richlistbox"
role="menu"
consumeoutsideclicks="false"
aria-labelledby="searchmode-switcher-popup-description">
<label data-l10n-id="urlbar-searchmode-popup-description" id="searchmode-switcher-popup-description" />
<toolbarseparator />

View File

@ -1781,22 +1781,22 @@
? tabs[this.#maxTabsPerRow - 1]
: tabs.at(-1);
}
let firstMovingTabScreenX = movingTabs.at(-1).screenX;
let firstMovingTabScreenY = movingTabs.at(-1).screenY;
let lastMovingTabScreenX = movingTabs[0].screenX;
let lastMovingTabScreenY = movingTabs[0].screenY;
let lastMovingTabScreenX = movingTabs.at(-1).screenX;
let lastMovingTabScreenY = movingTabs.at(-1).screenY;
let firstMovingTabScreenX = movingTabs[0].screenX;
let firstMovingTabScreenY = movingTabs[0].screenY;
let translateX = screenX - draggedTab._dragData.screenX;
let translateY = screenY - draggedTab._dragData.screenY;
let firstBoundX = firstTabInRow.screenX - lastMovingTabScreenX;
let firstBoundY = firstTabInRow.screenY - lastMovingTabScreenY;
let firstBoundX = firstTabInRow.screenX - firstMovingTabScreenX;
let firstBoundY = firstTabInRow.screenY - firstMovingTabScreenY;
let lastBoundX =
lastTabInRow.screenX +
lastTabInRow.getBoundingClientRect().width -
(firstMovingTabScreenX + tabWidth);
(lastMovingTabScreenX + tabWidth);
let lastBoundY =
tabs.at(-1).screenY +
lastTabInRow.getBoundingClientRect().height -
(firstMovingTabScreenY + tabHeight);
(lastMovingTabScreenY + tabHeight);
translateX = Math.min(Math.max(translateX, firstBoundX), lastBoundX);
translateY = Math.min(Math.max(translateY, firstBoundY), lastBoundY);
@ -1820,11 +1820,11 @@
// tabs we need to check.
tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab);
let firstTabCenterX = lastMovingTabScreenX + translateX + tabWidth / 2;
let lastTabCenterX = firstMovingTabScreenX + translateX + tabWidth / 2;
let firstTabCenterX = firstMovingTabScreenX + translateX + tabWidth / 2;
let lastTabCenterX = lastMovingTabScreenX + translateX + tabWidth / 2;
let tabCenterX = directionX ? lastTabCenterX : firstTabCenterX;
let firstTabCenterY = lastMovingTabScreenY + translateY + tabWidth / 2;
let lastTabCenterY = firstMovingTabScreenY + translateY + tabWidth / 2;
let firstTabCenterY = firstMovingTabScreenY + translateY + tabWidth / 2;
let lastTabCenterY = lastMovingTabScreenY + translateY + tabWidth / 2;
let tabCenterY = directionY ? lastTabCenterY : firstTabCenterY;
let newIndex = -1;
@ -1962,8 +1962,6 @@
let scrollDirection = this.verticalMode ? "scrollTop" : "scrollLeft";
let tabWidth = draggedTab.getBoundingClientRect().width;
let tabHeight = draggedTab.getBoundingClientRect().height;
let tabSize = this.verticalMode ? tabHeight : tabWidth;
let shiftSize = tabSize * movingTabs.length;
let translateX = event.screenX - draggedTab._dragData.screenX;
let translateY = event.screenY - draggedTab._dragData.screenY;
@ -1975,19 +1973,21 @@
// Move the dragged tab based on the mouse position.
let firstTab = tabs[0];
let lastTab = tabs.at(-1);
let firstMovingTabScreen = movingTabs.at(-1)[screenAxis];
let lastMovingTabScreen = movingTabs[0][screenAxis];
let lastMovingTabScreen = movingTabs.at(-1)[screenAxis];
let firstMovingTabScreen = movingTabs[0][screenAxis];
let tabSize = this.verticalMode ? tabHeight : tabWidth;
let shiftSize = lastMovingTabScreen + tabSize - firstMovingTabScreen;
let translate = screen - draggedTab._dragData[screenAxis];
if (!pinned) {
translate +=
this.arrowScrollbox.scrollbox[scrollDirection] -
draggedTab._dragData.scrollPos;
}
let firstBound = firstTab[screenAxis] - lastMovingTabScreen;
let firstBound = firstTab[screenAxis] - firstMovingTabScreen;
let lastBound =
lastTab[screenAxis] +
lastTab.getBoundingClientRect()[size] -
(firstMovingTabScreen + tabSize);
(lastMovingTabScreen + tabSize);
translate = Math.min(Math.max(translate, firstBound), lastBound);
for (let tab of movingTabs) {
@ -2009,8 +2009,8 @@
// tabs we need to check.
tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab);
let firstTabCenter = lastMovingTabScreen + translate + tabSize / 2;
let lastTabCenter = firstMovingTabScreen + translate + tabSize / 2;
let firstTabCenter = firstMovingTabScreen + translate + tabSize / 2;
let lastTabCenter = lastMovingTabScreen + translate + tabSize / 2;
let tabCenter = directionMove ? lastTabCenter : firstTabCenter;
let newIndex = -1;
let oldIndex =

View File

@ -73,37 +73,40 @@ export class SearchModeSwitcher {
await this.#rebuildSearchModeList(this.#input.window);
this.#engineListNeedsRebuild = false;
}
if (anchor.getAttribute("open") != "true") {
this.#input.view.hideTemporarily();
if (anchor.getAttribute("open") == "true") {
lazy.PanelMultiView.hidePopup(this.#popup);
return;
}
this.#input.view.hideTemporarily();
this.#popup.addEventListener(
"popuphidden",
() => {
anchor.removeAttribute("open");
anchor.setAttribute("aria-expanded", false);
this.#input.view.restoreVisibility();
},
{ once: true }
);
anchor.setAttribute("open", true);
anchor.setAttribute("aria-expanded", true);
if (event.type == "keypress") {
// Focus the first item when opened by keypress only.
this.#popup.addEventListener(
"popuphidden",
"popupshown",
() => {
anchor.removeAttribute("open");
anchor.setAttribute("aria-expanded", false);
this.#input.view.restoreVisibility();
this.#popup.querySelector("toolbarbutton").focus();
},
{ once: true }
);
anchor.setAttribute("open", true);
anchor.setAttribute("aria-expanded", true);
if (event.type == "keypress") {
// Focus the first item when opened by keypress only.
this.#popup.addEventListener(
"popupshown",
() => {
this.#popup.querySelector("toolbarbutton").focus();
},
{ once: true }
);
}
lazy.PanelMultiView.openPopup(this.#popup, anchor, {
position: "bottomleft topleft",
triggerEvent: event,
}).catch(console.error);
}
lazy.PanelMultiView.openPopup(this.#popup, anchor, {
position: "bottomleft topleft",
triggerEvent: event,
}).catch(console.error);
}
#openPreferences(event) {
@ -392,19 +395,19 @@ export class SearchModeSwitcher {
#enableObservers() {
Services.obs.addObserver(this, "browser-search-engine-modified", true);
this.#toolbarbutton.addEventListener("mousedown", this);
this.#toolbarbutton.addEventListener("command", this);
this.#toolbarbutton.addEventListener("keypress", this);
let closebutton = this.#input.document.querySelector(
"#searchmode-switcher-close"
);
closebutton.addEventListener("mousedown", this);
closebutton.addEventListener("command", this);
closebutton.addEventListener("keypress", this);
let prefsbutton = this.#input.document.querySelector(
"#searchmode-switcher-popup-search-settings-button"
);
prefsbutton.addEventListener("mousedown", this);
prefsbutton.addEventListener("command", this);
prefsbutton.addEventListener("keypress", this);
this.#input.window.addEventListener(
@ -417,19 +420,19 @@ export class SearchModeSwitcher {
#disableObservers() {
Services.obs.removeObserver(this, "browser-search-engine-modified");
this.#toolbarbutton.removeEventListener("mousedown", this);
this.#toolbarbutton.removeEventListener("command", this);
this.#toolbarbutton.removeEventListener("keypress", this);
let closebutton = this.#input.document.querySelector(
"#searchmode-switcher-close"
);
closebutton.removeEventListener("mousedown", this);
closebutton.removeEventListener("command", this);
closebutton.removeEventListener("keypress", this);
let prefsbutton = this.#input.document.querySelector(
"#searchmode-switcher-popup-search-settings-button"
);
prefsbutton.removeEventListener("mousedown", this);
prefsbutton.removeEventListener("command", this);
prefsbutton.removeEventListener("keypress", this);
}
}

View File

@ -720,6 +720,23 @@ add_task(async function nimbusLogEnabled() {
await SpecialPowers.popPrefEnv();
});
add_task(async function test_button_stuck() {
let win = await BrowserTestUtils.openNewBrowserWindow();
let popup = win.document.getElementById("searchmode-switcher-popup");
let button = win.document.getElementById("urlbar-searchmode-switcher");
info("Show the SearchModeSwitcher");
let promiseMenuOpen = BrowserTestUtils.waitForEvent(popup, "popupshown");
EventUtils.synthesizeMouseAtCenter(button, {}, win);
await promiseMenuOpen;
info("Hide the SearchModeSwitcher");
let promiseMenuClosed = BrowserTestUtils.waitForEvent(popup, "popuphidden");
EventUtils.synthesizeMouseAtCenter(button, {}, win);
await promiseMenuClosed;
await BrowserTestUtils.closeWindow(win);
});
add_task(async function test_readonly() {
let popupOpened = BrowserTestUtils.waitForNewWindow({ url: "about:blank" });
BrowserTestUtils.openNewForegroundTab(

View File

@ -16,7 +16,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"af": {
"pin": false,
@ -35,7 +35,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"an": {
"pin": false,
@ -54,7 +54,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ar": {
"pin": false,
@ -73,7 +73,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ast": {
"pin": false,
@ -92,7 +92,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"az": {
"pin": false,
@ -111,7 +111,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"be": {
"pin": false,
@ -130,7 +130,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"bg": {
"pin": false,
@ -149,7 +149,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"bn": {
"pin": false,
@ -168,7 +168,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"bo": {
"pin": false,
@ -187,7 +187,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"br": {
"pin": false,
@ -206,7 +206,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"brx": {
"pin": false,
@ -225,7 +225,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"bs": {
"pin": false,
@ -244,7 +244,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ca": {
"pin": false,
@ -263,7 +263,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ca-valencia": {
"pin": false,
@ -282,7 +282,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"cak": {
"pin": false,
@ -301,7 +301,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ckb": {
"pin": false,
@ -320,7 +320,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"cs": {
"pin": false,
@ -339,7 +339,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"cy": {
"pin": false,
@ -358,7 +358,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"da": {
"pin": false,
@ -377,7 +377,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"de": {
"pin": false,
@ -396,7 +396,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"dsb": {
"pin": false,
@ -415,7 +415,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"el": {
"pin": false,
@ -434,7 +434,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"en-CA": {
"pin": false,
@ -453,7 +453,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"en-GB": {
"pin": false,
@ -472,7 +472,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"eo": {
"pin": false,
@ -491,7 +491,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-AR": {
"pin": false,
@ -510,7 +510,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-CL": {
"pin": false,
@ -529,7 +529,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-ES": {
"pin": false,
@ -548,7 +548,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-MX": {
"pin": false,
@ -567,7 +567,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"et": {
"pin": false,
@ -586,7 +586,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"eu": {
"pin": false,
@ -605,7 +605,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fa": {
"pin": false,
@ -624,7 +624,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ff": {
"pin": false,
@ -643,7 +643,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fi": {
"pin": false,
@ -662,7 +662,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fr": {
"pin": false,
@ -681,7 +681,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fur": {
"pin": false,
@ -700,7 +700,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fy-NL": {
"pin": false,
@ -719,7 +719,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ga-IE": {
"pin": false,
@ -738,7 +738,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gd": {
"pin": false,
@ -757,7 +757,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gl": {
"pin": false,
@ -776,7 +776,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gn": {
"pin": false,
@ -795,7 +795,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gu-IN": {
"pin": false,
@ -814,7 +814,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"he": {
"pin": false,
@ -833,7 +833,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hi-IN": {
"pin": false,
@ -852,7 +852,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hr": {
"pin": false,
@ -871,7 +871,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hsb": {
"pin": false,
@ -890,7 +890,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hu": {
"pin": false,
@ -909,7 +909,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hy-AM": {
"pin": false,
@ -928,7 +928,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hye": {
"pin": false,
@ -947,7 +947,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ia": {
"pin": false,
@ -966,7 +966,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"id": {
"pin": false,
@ -985,7 +985,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"is": {
"pin": false,
@ -1004,7 +1004,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"it": {
"pin": false,
@ -1023,7 +1023,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ja": {
"pin": false,
@ -1040,7 +1040,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ja-JP-mac": {
"pin": false,
@ -1048,7 +1048,7 @@
"macosx64",
"macosx64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ka": {
"pin": false,
@ -1067,7 +1067,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"kab": {
"pin": false,
@ -1086,7 +1086,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"kk": {
"pin": false,
@ -1105,7 +1105,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"km": {
"pin": false,
@ -1124,7 +1124,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"kn": {
"pin": false,
@ -1143,7 +1143,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ko": {
"pin": false,
@ -1162,7 +1162,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lij": {
"pin": false,
@ -1181,7 +1181,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lo": {
"pin": false,
@ -1200,7 +1200,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lt": {
"pin": false,
@ -1219,7 +1219,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ltg": {
"pin": false,
@ -1238,7 +1238,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lv": {
"pin": false,
@ -1257,7 +1257,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"meh": {
"pin": false,
@ -1276,7 +1276,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"mk": {
"pin": false,
@ -1295,7 +1295,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"mr": {
"pin": false,
@ -1314,7 +1314,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ms": {
"pin": false,
@ -1333,7 +1333,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"my": {
"pin": false,
@ -1352,7 +1352,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"nb-NO": {
"pin": false,
@ -1371,7 +1371,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ne-NP": {
"pin": false,
@ -1390,7 +1390,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"nl": {
"pin": false,
@ -1409,7 +1409,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"nn-NO": {
"pin": false,
@ -1428,7 +1428,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"oc": {
"pin": false,
@ -1447,7 +1447,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pa-IN": {
"pin": false,
@ -1466,7 +1466,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pl": {
"pin": false,
@ -1485,7 +1485,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pt-BR": {
"pin": false,
@ -1504,7 +1504,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pt-PT": {
"pin": false,
@ -1523,7 +1523,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"rm": {
"pin": false,
@ -1542,7 +1542,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ro": {
"pin": false,
@ -1561,7 +1561,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ru": {
"pin": false,
@ -1580,7 +1580,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sat": {
"pin": false,
@ -1599,7 +1599,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sc": {
"pin": false,
@ -1618,7 +1618,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"scn": {
"pin": false,
@ -1637,7 +1637,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sco": {
"pin": false,
@ -1656,7 +1656,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"si": {
"pin": false,
@ -1675,7 +1675,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sk": {
"pin": false,
@ -1694,7 +1694,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"skr": {
"pin": false,
@ -1713,7 +1713,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sl": {
"pin": false,
@ -1732,7 +1732,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"son": {
"pin": false,
@ -1751,7 +1751,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sq": {
"pin": false,
@ -1770,7 +1770,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sr": {
"pin": false,
@ -1789,7 +1789,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sv-SE": {
"pin": false,
@ -1808,7 +1808,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"szl": {
"pin": false,
@ -1827,7 +1827,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ta": {
"pin": false,
@ -1846,7 +1846,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"te": {
"pin": false,
@ -1865,7 +1865,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"tg": {
"pin": false,
@ -1884,7 +1884,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"th": {
"pin": false,
@ -1903,7 +1903,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"tl": {
"pin": false,
@ -1922,7 +1922,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"tr": {
"pin": false,
@ -1941,7 +1941,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"trs": {
"pin": false,
@ -1960,7 +1960,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"uk": {
"pin": false,
@ -1979,7 +1979,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ur": {
"pin": false,
@ -1998,7 +1998,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"uz": {
"pin": false,
@ -2017,7 +2017,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"vi": {
"pin": false,
@ -2036,7 +2036,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"wo": {
"pin": false,
@ -2055,7 +2055,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"xh": {
"pin": false,
@ -2074,7 +2074,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"zh-CN": {
"pin": false,
@ -2093,7 +2093,7 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"zh-TW": {
"pin": false,
@ -2112,6 +2112,6 @@
"win64-aarch64-devedition",
"win64-devedition"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
}
}

View File

@ -218,8 +218,6 @@ already_AddRefed<nsIDocShell> nsObjectLoadingContent::SetupDocShell(
return nullptr;
}
MaybeStoreCrossOriginFeaturePolicy();
return docShell.forget();
}
@ -1554,6 +1552,7 @@ void nsObjectLoadingContent::Destroy() {
void nsObjectLoadingContent::Traverse(nsObjectLoadingContent* tmp,
nsCycleCollectionTraversalCallback& cb) {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFrameLoader);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFeaturePolicy);
}
/* static */
@ -1562,6 +1561,7 @@ void nsObjectLoadingContent::Unlink(nsObjectLoadingContent* tmp) {
tmp->mFrameLoader->Destroy();
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFrameLoader);
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFeaturePolicy);
}
void nsObjectLoadingContent::UnloadObject(bool aResetState) {
@ -1720,6 +1720,13 @@ nsObjectLoadingContent::UpgradeLoadToDocument(
return NS_ERROR_FAILURE;
}
// At this point we know that we have a browsing context, so it's time to make
// sure that that browsing context gets the correct container feature policy.
// This is needed for `DocumentLoadListener::MaybeTriggerProcessSwitch` to be
// able to start loading the document with the correct container feature
// policy in the load info.
RefreshFeaturePolicy();
bc.forget(aBrowsingContext);
return NS_OK;
}
@ -1818,6 +1825,9 @@ void nsObjectLoadingContent::SubdocumentImageLoadComplete(nsresult aResult) {
void nsObjectLoadingContent::MaybeStoreCrossOriginFeaturePolicy() {
MOZ_DIAGNOSTIC_ASSERT(mFrameLoader);
if (!mFrameLoader) {
return;
}
// If the browsingContext is not ready (because docshell is dead), don't try
// to create one.
@ -1831,15 +1841,54 @@ void nsObjectLoadingContent::MaybeStoreCrossOriginFeaturePolicy() {
return;
}
Element* el = AsElement();
auto* el = nsGenericHTMLElement::FromNode(AsElement());
if (!el->IsInComposedDoc()) {
return;
}
FeaturePolicy* featurePolicy = el->OwnerDoc()->FeaturePolicy();
if (ContentChild* cc = ContentChild::GetSingleton(); cc && featurePolicy) {
if (ContentChild* cc = ContentChild::GetSingleton()) {
Unused << cc->SendSetContainerFeaturePolicy(
browsingContext, Some(featurePolicy->ToFeaturePolicyInfo()));
browsingContext, Some(mFeaturePolicy->ToFeaturePolicyInfo()));
}
}
/* static */ already_AddRefed<nsIPrincipal>
nsObjectLoadingContent::GetFeaturePolicyDefaultOrigin(nsINode* aNode) {
auto* el = nsGenericHTMLElement::FromNode(aNode);
nsCOMPtr<nsIURI> nodeURI;
// Different elements keep this in various locations
if (el->NodeInfo()->Equals(nsGkAtoms::object)) {
el->GetURIAttr(nsGkAtoms::data, nullptr, getter_AddRefs(nodeURI));
} else if (el->NodeInfo()->Equals(nsGkAtoms::embed)) {
el->GetURIAttr(nsGkAtoms::src, nullptr, getter_AddRefs(nodeURI));
}
nsCOMPtr<nsIPrincipal> principal;
if (nodeURI) {
principal = BasePrincipal::CreateContentPrincipal(
nodeURI,
BasePrincipal::Cast(el->NodePrincipal())->OriginAttributesRef());
} else {
principal = el->NodePrincipal();
}
return principal.forget();
}
void nsObjectLoadingContent::RefreshFeaturePolicy() {
if (mType != ObjectType::Document) {
return;
}
if (!mFeaturePolicy) {
mFeaturePolicy = MakeAndAddRef<FeaturePolicy>(AsElement());
}
// The origin can change if 'src' or 'data' attributes change.
nsCOMPtr<nsIPrincipal> origin = GetFeaturePolicyDefaultOrigin(AsElement());
MOZ_ASSERT(origin);
mFeaturePolicy->SetDefaultOrigin(origin);
mFeaturePolicy->InheritPolicy(AsElement()->OwnerDoc()->FeaturePolicy());
MaybeStoreCrossOriginFeaturePolicy();
}

View File

@ -27,6 +27,7 @@ class nsFrameLoader;
namespace mozilla::dom {
struct BindContext;
class FeaturePolicy;
template <typename T>
class Sequence;
class HTMLIFrameElement;
@ -213,6 +214,14 @@ class nsObjectLoadingContent : public nsIStreamListener,
*/
bool BlockEmbedOrObjectContentLoading();
/**
* Updates and stores the container's feature policy in its canonical browsing
* context. This gets called whenever the feature policy has changed, which
* can happen when this element is upgraded to a container or when the URI of
* the element has changed.
*/
void RefreshFeaturePolicy();
private:
// Object parameter changes returned by UpdateObjectParameters
enum ParameterUpdateFlags {
@ -393,6 +402,14 @@ class nsObjectLoadingContent : public nsIStreamListener,
*/
void MaybeStoreCrossOriginFeaturePolicy();
/**
* Return the value of either `data` or `src`, depending on element type,
* parsed as a URL. If URL is invalid or the attribute is missing this returns
* the document's origin.
*/
static already_AddRefed<nsIPrincipal> GetFeaturePolicyDefaultOrigin(
nsINode* aNode);
// The final listener for mChannel (uriloader, pluginstreamlistener, etc.)
nsCOMPtr<nsIStreamListener> mFinalListener;
@ -464,6 +481,14 @@ class nsObjectLoadingContent : public nsIStreamListener,
// our own frame.
mozilla::Maybe<mozilla::IntrinsicSize> mSubdocumentIntrinsicSize;
mozilla::Maybe<mozilla::AspectRatio> mSubdocumentIntrinsicRatio;
// This gets created on the first call of `RefreshFeaturePolicy`, and will be
// kept after that. Navigations of this element will use this if they're
// targetting documents, which is how iframe element works. If it's a
// non-document the feature policy isn't used, but it doesn't hurt to keep it
// around, and a subsequent document load will continue using it after
// refreshing it.
RefPtr<mozilla::dom::FeaturePolicy> mFeaturePolicy;
};
#endif

View File

@ -79,6 +79,10 @@ void HTMLEmbedElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
}
if (aName == nsGkAtoms::src) {
RefreshFeaturePolicy();
}
if (aNamespaceID == kNameSpaceID_None &&
aName == nsGkAtoms::allowfullscreen && mFrameLoader) {
if (auto* bc = mFrameLoader->GetExtantBrowsingContext()) {

View File

@ -100,6 +100,11 @@ void HTMLObjectElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
nsIPrincipal* aSubjectPrincipal,
bool aNotify) {
AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
if (aName == nsGkAtoms::data) {
RefreshFeaturePolicy();
}
return nsGenericHTMLFormControlElement::AfterSetAttr(
aNamespaceID, aName, aValue, aOldValue, aSubjectPrincipal, aNotify);
}
@ -126,6 +131,7 @@ void HTMLObjectElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
BlockEmbedOrObjectContentLoading()) {
return;
}
nsContentUtils::AddScriptRunner(NS_NewRunnableFunction(
"HTMLObjectElement::LoadObject",
[self = RefPtr<HTMLObjectElement>(this), aNotify]() {

View File

@ -5065,7 +5065,7 @@ class Maintenance final : public Runnable {
nsTHashMap<nsStringHashKey, DatabaseMaintenance*> mDatabaseMaintenances;
nsresult mResultCode;
Atomic<bool> mAborted;
bool mInitializeOriginsFailed;
bool mOpenStorageForAllRepositoriesFailed;
State mState;
public:
@ -5075,7 +5075,7 @@ class Maintenance final : public Runnable {
mStartTime(PR_Now()),
mResultCode(NS_OK),
mAborted(false),
mInitializeOriginsFailed(false),
mOpenStorageForAllRepositoriesFailed(false),
mState(State::Initial) {
AssertIsOnBackgroundThread();
MOZ_ASSERT(aQuotaClient);
@ -5144,7 +5144,7 @@ class Maintenance final : public Runnable {
nsresult CreateIndexedDatabaseManager();
RefPtr<UniversalDirectoryLockPromise> OpenStorageDirectory(
bool aInitializeOrigins);
const PersistenceScope& aPersistenceScope, bool aInitializeOrigins);
// Runs on the PBackground thread. Once QuotaManager has given a lock it will
// call DirectoryOpen().
@ -13077,7 +13077,7 @@ nsresult Maintenance::CreateIndexedDatabaseManager() {
}
RefPtr<UniversalDirectoryLockPromise> Maintenance::OpenStorageDirectory(
bool aInitializeOrigins) {
const PersistenceScope& aPersistenceScope, bool aInitializeOrigins) {
AssertIsOnBackgroundThread();
MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
MOZ_ASSERT(!mDirectoryLock);
@ -13089,7 +13089,7 @@ RefPtr<UniversalDirectoryLockPromise> Maintenance::OpenStorageDirectory(
// Return a shared lock for <profile>/storage/*/*/idb
return quotaManager->OpenStorageDirectory(
PersistenceScope::CreateFromNull(), OriginScope::FromNull(),
aPersistenceScope, OriginScope::FromNull(),
Nullable<Client::Type>(Client::IDB),
/* aExclusive */ false, aInitializeOrigins, DirectoryLockCategory::None,
SomeRef(mPendingDirectoryLock));
@ -13113,7 +13113,8 @@ nsresult Maintenance::OpenDirectory() {
// make sure it's initialized here (all non-persistent origins need to be
// cleaned up and quota info needs to be loaded for them).
OpenStorageDirectory(/* aInitializeOrigins */ true)
OpenStorageDirectory(PersistenceScope::CreateFromNull(),
/* aInitializeOrigins */ true)
->Then(
GetCurrentSerialEventTarget(), __func__,
[self = RefPtr(this)](
@ -13128,7 +13129,7 @@ nsresult Maintenance::OpenDirectory() {
// persistent repository can still be processed.
self->mPendingDirectoryLock = nullptr;
self->mInitializeOriginsFailed = true;
self->mOpenStorageForAllRepositoriesFailed = true;
if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
self->IsAborted()) {
@ -13136,7 +13137,9 @@ nsresult Maintenance::OpenDirectory() {
return;
}
self->OpenStorageDirectory(/* aInitializeOrigins */ false)
self->OpenStorageDirectory(PersistenceScope::CreateFromValue(
PERSISTENCE_TYPE_PERSISTENT),
/* aInitializeOrigins */ true)
->Then(GetCurrentSerialEventTarget(), __func__,
[self](const UniversalDirectoryLockPromise::
ResolveOrRejectValue& aValue) {
@ -13241,7 +13244,7 @@ nsresult Maintenance::DirectoryWork() {
const bool persistent = persistenceType == PERSISTENCE_TYPE_PERSISTENT;
if (!persistent && mInitializeOriginsFailed) {
if (!persistent && mOpenStorageForAllRepositoriesFailed) {
// Non-persistent (best effort) repositories can't be processed if
// temporary storage initialization failed.
continue;

View File

@ -5168,17 +5168,34 @@ RefPtr<UniversalDirectoryLockPromise> QuotaManager::OpenStorageDirectory(
mStorageInitialized, IsDirectoryLockBlockedByUninitStorageOperation,
MakeBackInserter(promises));
RefPtr<UniversalDirectoryLock> persistentStorageDirectoryLock;
RefPtr<UniversalDirectoryLock> temporaryStorageDirectoryLock;
if (aInitializeOrigins &&
MatchesBestEffortPersistenceScope(aPersistenceScope)) {
temporaryStorageDirectoryLock = CreateDirectoryLockForInitialization(
*this,
PersistenceScope::CreateFromSet(PERSISTENCE_TYPE_TEMPORARY,
PERSISTENCE_TYPE_DEFAULT),
OriginScope::FromNull(), mTemporaryStorageInitialized,
IsDirectoryLockBlockedByUninitStorageOperation,
MakeBackInserter(promises));
if (aInitializeOrigins) {
if (MatchesPersistentPersistenceScope(aPersistenceScope)) {
persistentStorageDirectoryLock = CreateDirectoryLockForInitialization(
*this, PersistenceScope::CreateFromValue(PERSISTENCE_TYPE_PERSISTENT),
OriginScope::FromNull(), mPersistentStorageInitialized,
IsDirectoryLockBlockedByUninitStorageOperation,
MakeBackInserter(promises));
}
// We match all best effort persistence types, but the persistence scope is
// created only for the temporary and default persistence type because the
// repository for the private persistence type is never initialized as part
// of temporary initialization. However, some other steps of the temporary
// storage initialization need to be done even for the private persistence
// type. For example, the initialization of mTemporaryStorageLimit.
if (MatchesBestEffortPersistenceScope(aPersistenceScope)) {
temporaryStorageDirectoryLock = CreateDirectoryLockForInitialization(
*this,
PersistenceScope::CreateFromSet(PERSISTENCE_TYPE_TEMPORARY,
PERSISTENCE_TYPE_DEFAULT),
OriginScope::FromNull(), mTemporaryStorageInitialized,
IsDirectoryLockBlockedByUninitStorageOperation,
MakeBackInserter(promises));
}
}
RefPtr<UniversalDirectoryLock> universalDirectoryLock =
@ -5204,6 +5221,9 @@ RefPtr<UniversalDirectoryLockPromise> QuotaManager::OpenStorageDirectory(
->Then(GetCurrentSerialEventTarget(), __func__,
MaybeInitialize(std::move(storageDirectoryLock), this,
&QuotaManager::InitializeStorage))
->Then(GetCurrentSerialEventTarget(), __func__,
MaybeInitialize(std::move(persistentStorageDirectoryLock), this,
&QuotaManager::InitializePersistentStorage))
->Then(GetCurrentSerialEventTarget(), __func__,
MaybeInitialize(std::move(temporaryStorageDirectoryLock), this,
&QuotaManager::InitializeTemporaryStorage))

View File

@ -549,9 +549,16 @@ Arena* ArenaChunk::fetchNextFreeArena(GCRuntime* gc) {
// /////////// System -> ArenaChunk Allocator ////////////////////////////////
ArenaChunk* GCRuntime::takeOrAllocChunk(AutoLockGCBgAlloc& lock) {
ArenaChunk* chunk = getOrAllocChunk(lock);
emptyChunks(lock).remove(chunk);
return chunk;
}
ArenaChunk* GCRuntime::getOrAllocChunk(AutoLockGCBgAlloc& lock) {
ArenaChunk* chunk = emptyChunks(lock).pop();
if (chunk) {
ArenaChunk* chunk;
if (!emptyChunks(lock).empty()) {
chunk = emptyChunks(lock).head();
// Reinitialize ChunkBase; arenas are all free and may or may not be
// committed.
SetMemCheckKind(chunk, sizeof(ChunkBase), MemCheckKind::MakeUndefined);
@ -564,7 +571,8 @@ ArenaChunk* GCRuntime::getOrAllocChunk(AutoLockGCBgAlloc& lock) {
}
chunk = ArenaChunk::emplace(ptr, this, /* allMemoryCommitted = */ true);
MOZ_ASSERT(chunk->info.numArenasFree == ArenasPerChunk);
MOZ_ASSERT(chunk->unused());
emptyChunks(lock).push(chunk);
}
if (wantBackgroundAllocation(lock)) {
@ -600,12 +608,9 @@ ArenaChunk* GCRuntime::pickChunk(AutoLockGCBgAlloc& lock) {
#ifdef DEBUG
chunk->verify();
MOZ_ASSERT(chunk->unused());
MOZ_ASSERT(!fullChunks(lock).contains(chunk));
MOZ_ASSERT(!availableChunks(lock).contains(chunk));
MOZ_ASSERT(emptyChunks(lock).contains(chunk));
#endif
availableChunks(lock).push(chunk);
return chunk;
}
@ -675,6 +680,7 @@ ArenaChunk* ArenaChunk::emplace(void* ptr, GCRuntime* gc,
chunk->initAsCommitted();
}
MOZ_ASSERT(chunk->unused());
chunk->verify();
return chunk;

View File

@ -2191,6 +2191,14 @@ void GCRuntime::decommitFreeArenas(const bool& cancel, AutoLockGC& lock) {
}
for (ArenaChunk* chunk : chunksToDecommit) {
MOZ_ASSERT(chunk->getKind() == ChunkKind::TenuredArenas);
MOZ_ASSERT(!chunk->unused());
if (!chunk->hasAvailableArenas()) {
// Chunk has become full while lock was released.
continue;
}
MOZ_ASSERT(availableChunks(lock).contains(chunk));
chunk->decommitFreeArenas(this, cancel, lock);
}
}

View File

@ -570,7 +570,13 @@ class GCRuntime {
void verifyAllChunks();
#endif
// Get a free chunk or allocate one if needed. The chunk is left in the empty
// chunks pool.
ArenaChunk* getOrAllocChunk(AutoLockGCBgAlloc& lock);
// Get or allocate a free chunk, removing it from the empty chunks pool.
ArenaChunk* takeOrAllocChunk(AutoLockGCBgAlloc& lock);
void recycleChunk(ArenaChunk* chunk, const AutoLockGC& lock);
#ifdef JS_GC_ZEAL

View File

@ -442,6 +442,12 @@ void ArenaChunk::decommitFreeArenasWithoutUnlocking(const AutoLockGC& lock) {
void ArenaChunk::updateChunkListAfterAlloc(GCRuntime* gc,
const AutoLockGC& lock) {
if (MOZ_UNLIKELY(info.numArenasFree == ArenasPerChunk - 1)) {
gc->emptyChunks(lock).remove(this);
gc->availableChunks(lock).push(this);
return;
}
if (MOZ_UNLIKELY(!hasAvailableArenas())) {
gc->availableChunks(lock).remove(this);
gc->fullChunks(lock).push(this);

View File

@ -2115,13 +2115,13 @@ bool js::Nursery::allocateNextChunk(AutoLockGCBgAlloc& lock) {
return false;
}
ArenaChunk* toSpaceChunk = gc->getOrAllocChunk(lock);
ArenaChunk* toSpaceChunk = gc->takeOrAllocChunk(lock);
if (!toSpaceChunk) {
return false;
}
ArenaChunk* fromSpaceChunk = nullptr;
if (semispaceEnabled_ && !(fromSpaceChunk = gc->getOrAllocChunk(lock))) {
if (semispaceEnabled_ && !(fromSpaceChunk = gc->takeOrAllocChunk(lock))) {
gc->recycleChunk(toSpaceChunk, lock);
return false;
}

View File

@ -527,7 +527,10 @@ static double MakeDay(double year, double month, double date) {
// Step 5.
double ym = y + floor(m / 12);
// Step 6. (Implicit)
// Step 6.
if (!std::isfinite(ym)) {
return GenericNaN();
}
// Step 7.
int mn = int(PositiveModulo(m, 12));

View File

@ -0,0 +1,13 @@
// MakeDay: Adding finite |year| and |month| can result in non-finite intermediate result.
assertEq(Date.UTC(Number.MAX_VALUE, Number.MAX_VALUE), NaN);
assertEq(new Date(Number.MAX_VALUE, Number.MAX_VALUE).getTime(), NaN);
// https://github.com/tc39/ecma262/issues/1087
var d = new Date(0);
d.setUTCFullYear(Number.MAX_VALUE, Number.MAX_VALUE);
assertEq(d.getTime(), NaN);
if (typeof reportCompare === "function")
reportCompare(true, true);

View File

@ -275,7 +275,7 @@ abstract class BaseBrowserFragment :
internal val browserToolbarView: BrowserToolbarView
get() = _browserToolbarView!!
@VisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
@Suppress("VariableNaming")
internal var _bottomToolbarContainerView: BottomToolbarContainerView? = null
protected val bottomToolbarContainerView: BottomToolbarContainerView

View File

@ -39,7 +39,6 @@ import org.mozilla.fenix.components.toolbar.BrowserToolbarView
import org.mozilla.fenix.components.toolbar.ToolbarMenu
import org.mozilla.fenix.components.toolbar.ToolbarPosition
import org.mozilla.fenix.components.toolbar.navbar.CustomTabNavBar
import org.mozilla.fenix.components.toolbar.navbar.shouldAddNavigationBar
import org.mozilla.fenix.compose.Divider
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.nav
@ -62,8 +61,6 @@ class ExternalAppBrowserFragment : BaseBrowserFragment() {
private val isNavBarEnabled
get() = requireContext().settings().navigationToolbarEnabled
private val isNavbarVisible
get() = requireContext().shouldAddNavigationBar()
@Suppress("LongMethod", "ComplexMethod")
override fun initializeUI(view: View, tab: SessionState) {
@ -77,12 +74,7 @@ class ExternalAppBrowserFragment : BaseBrowserFragment() {
requireComponents.core.webAppManifestStorage.getManifestCache(url)
}
// Updating the contents of the bottomToolbarContainer with CustomTabNavBar. The container gets initialized
// during the super.initializeUI call with BrowserNavBar.
// A follow up: https://bugzilla.mozilla.org/show_bug.cgi?id=1888300
if (isNavbarVisible) {
initializeNavBar()
}
initializeNavBar()
customTabsIntegration.set(
feature = CustomTabsIntegration(
@ -185,9 +177,7 @@ class ExternalAppBrowserFragment : BaseBrowserFragment() {
override fun onUpdateToolbarForConfigurationChange(toolbar: BrowserToolbarView) {
super.onUpdateToolbarForConfigurationChange(toolbar)
if (isNavbarVisible) {
initializeNavBar()
}
initializeNavBar()
}
override fun removeSessionIfNeeded(): Boolean {
@ -235,6 +225,11 @@ class ExternalAppBrowserFragment : BaseBrowserFragment() {
)
private fun initializeNavBar() {
// Update the contents of the bottomToolbarContainer with the CustomTabNavBar configuration
// only if the container was initialized in the parent - we know a navbar should be used.
// Follow up: https://bugzilla.mozilla.org/show_bug.cgi?id=1888300
_bottomToolbarContainerView ?: return
val customTabSessionId = customTabSessionId ?: return
val navbarIntegration = CustomTabsNavigationBarIntegration(

View File

@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Card
import androidx.compose.material.Text
@ -62,7 +63,11 @@ fun MicrosurveyContent(
.fillMaxWidth()
.padding(horizontal = 16.dp),
) {
Column(modifier = Modifier.wrapContentHeight()) {
Column(
modifier = Modifier
.wrapContentHeight()
.selectableGroup(),
) {
Header(icon, question)
answers.forEach {

View File

@ -6,7 +6,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"an": {
"pin": false,
@ -15,7 +15,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ar": {
"pin": false,
@ -24,7 +24,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ast": {
"pin": false,
@ -33,7 +33,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"az": {
"pin": false,
@ -42,7 +42,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"be": {
"pin": false,
@ -51,7 +51,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"bg": {
"pin": false,
@ -60,7 +60,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"bn": {
"pin": false,
@ -69,7 +69,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"br": {
"pin": false,
@ -78,7 +78,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"bs": {
"pin": false,
@ -87,7 +87,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ca": {
"pin": false,
@ -96,7 +96,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"cak": {
"pin": false,
@ -105,7 +105,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"cs": {
"pin": false,
@ -114,7 +114,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"cy": {
"pin": false,
@ -123,7 +123,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"da": {
"pin": false,
@ -132,7 +132,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"de": {
"pin": false,
@ -141,7 +141,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"dsb": {
"pin": false,
@ -150,7 +150,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"el": {
"pin": false,
@ -159,7 +159,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"en-CA": {
"pin": false,
@ -168,7 +168,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"en-GB": {
"pin": false,
@ -177,7 +177,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"eo": {
"pin": false,
@ -186,7 +186,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-AR": {
"pin": false,
@ -195,7 +195,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-CL": {
"pin": false,
@ -204,7 +204,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-ES": {
"pin": false,
@ -213,7 +213,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"es-MX": {
"pin": false,
@ -222,7 +222,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"et": {
"pin": false,
@ -231,7 +231,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"eu": {
"pin": false,
@ -240,7 +240,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fa": {
"pin": false,
@ -249,7 +249,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ff": {
"pin": false,
@ -258,7 +258,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fi": {
"pin": false,
@ -267,7 +267,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fr": {
"pin": false,
@ -276,7 +276,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"fy-NL": {
"pin": false,
@ -285,7 +285,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ga-IE": {
"pin": false,
@ -294,7 +294,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gd": {
"pin": false,
@ -303,7 +303,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gl": {
"pin": false,
@ -312,7 +312,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gn": {
"pin": false,
@ -321,7 +321,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"gu-IN": {
"pin": false,
@ -330,7 +330,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"he": {
"pin": false,
@ -339,7 +339,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hi-IN": {
"pin": false,
@ -348,7 +348,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hr": {
"pin": false,
@ -357,7 +357,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hsb": {
"pin": false,
@ -366,7 +366,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hu": {
"pin": false,
@ -375,7 +375,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"hy-AM": {
"pin": false,
@ -384,7 +384,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ia": {
"pin": false,
@ -393,7 +393,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"id": {
"pin": false,
@ -402,7 +402,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"is": {
"pin": false,
@ -411,7 +411,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"it": {
"pin": false,
@ -420,7 +420,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ja": {
"pin": false,
@ -429,7 +429,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ka": {
"pin": false,
@ -438,7 +438,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"kab": {
"pin": false,
@ -447,7 +447,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"kk": {
"pin": false,
@ -456,7 +456,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"km": {
"pin": false,
@ -465,7 +465,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"kn": {
"pin": false,
@ -474,7 +474,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ko": {
"pin": false,
@ -483,7 +483,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lij": {
"pin": false,
@ -492,7 +492,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lo": {
"pin": false,
@ -501,7 +501,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lt": {
"pin": false,
@ -510,7 +510,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ltg": {
"pin": false,
@ -519,7 +519,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"lv": {
"pin": false,
@ -528,7 +528,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"meh": {
"pin": false,
@ -537,7 +537,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"mix": {
"pin": false,
@ -546,7 +546,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ml": {
"pin": false,
@ -555,7 +555,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"mr": {
"pin": false,
@ -564,7 +564,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ms": {
"pin": false,
@ -573,7 +573,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"my": {
"pin": false,
@ -582,7 +582,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"nb-NO": {
"pin": false,
@ -591,7 +591,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ne-NP": {
"pin": false,
@ -600,7 +600,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"nl": {
"pin": false,
@ -609,7 +609,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"nn-NO": {
"pin": false,
@ -618,7 +618,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"oc": {
"pin": false,
@ -627,7 +627,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pa-IN": {
"pin": false,
@ -636,7 +636,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pl": {
"pin": false,
@ -645,7 +645,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pt-BR": {
"pin": false,
@ -654,7 +654,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"pt-PT": {
"pin": false,
@ -663,7 +663,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"rm": {
"pin": false,
@ -672,7 +672,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ro": {
"pin": false,
@ -681,7 +681,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ru": {
"pin": false,
@ -690,7 +690,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sk": {
"pin": false,
@ -699,7 +699,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sl": {
"pin": false,
@ -708,7 +708,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"son": {
"pin": false,
@ -717,7 +717,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sq": {
"pin": false,
@ -726,7 +726,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sr": {
"pin": false,
@ -735,7 +735,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"sv-SE": {
"pin": false,
@ -744,7 +744,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ta": {
"pin": false,
@ -753,7 +753,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"te": {
"pin": false,
@ -762,7 +762,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"th": {
"pin": false,
@ -771,7 +771,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"tl": {
"pin": false,
@ -780,7 +780,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"tr": {
"pin": false,
@ -789,7 +789,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"trs": {
"pin": false,
@ -798,7 +798,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"uk": {
"pin": false,
@ -807,7 +807,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"ur": {
"pin": false,
@ -816,7 +816,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"uz": {
"pin": false,
@ -825,7 +825,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"vi": {
"pin": false,
@ -834,7 +834,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"wo": {
"pin": false,
@ -843,7 +843,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"xh": {
"pin": false,
@ -852,7 +852,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"zam": {
"pin": false,
@ -861,7 +861,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"zh-CN": {
"pin": false,
@ -870,7 +870,7 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
},
"zh-TW": {
"pin": false,
@ -879,6 +879,6 @@
"android-arm",
"android-multilocale"
],
"revision": "cf9261c4cd6c05d3ec88e4cda74c8631b2243a44"
"revision": "02c2cd99e2ec40e8c32e05544829ff02a29cda45"
}
}

View File

@ -2728,13 +2728,13 @@
# The maximum number of pending fetch keepalive requests per browser instance
- name: dom.fetchKeepalive.total_request_limit
type: RelaxedAtomicUint32
value: 100
value: 500
mirror: always
# The maximum number of pending fetch keepalive requests per origin
- name: dom.fetchKeepalive.request_limit_per_origin
type: RelaxedAtomicUint32
value: 30
value: 250
mirror: always
- name: dom.fetchObserver.enabled

View File

@ -2048,6 +2048,15 @@ bool DocumentLoadListener::MaybeTriggerProcessSwitch(
return;
}
// At this point the element has stored the container feature policy in
// the new browsing context, but we need to make sure that we copy it
// over to the load info.
nsCOMPtr<nsILoadInfo> loadInfo = self->mChannel->LoadInfo();
if (aBrowsingContext->GetContainerFeaturePolicy()) {
loadInfo->SetContainerFeaturePolicyInfo(
*aBrowsingContext->GetContainerFeaturePolicy());
}
MOZ_LOG(gProcessIsolationLog, LogLevel::Verbose,
("Process Switch: Upgraded Object to Document Load"));
self->TriggerProcessSwitch(aBrowsingContext, options);

View File

@ -187,7 +187,7 @@ export class MessageHandler extends EventEmitter {
* @typedef {object} CommandDestination
* @property {string} type
* One of MessageHandler.type.
* @property {string=} id
* @property {string | number=} id
* Unique context identifier. The format depends on the type.
* For WINDOW_GLOBAL destinations, this is a browsing context id.
* Optional, should only be provided if `contextDescriptor` is missing.

View File

@ -17,6 +17,7 @@ ChromeUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
export class Module {
#messageHandler;
#moduleName;
/**
* Create a new module instance.
@ -132,4 +133,12 @@ export class Module {
static supportsMethod(methodName) {
return typeof this.prototype[methodName] === "function";
}
get moduleName() {
return this.#moduleName;
}
set moduleName(name) {
this.#moduleName = name;
}
}

View File

@ -168,6 +168,7 @@ export class ModuleCache {
let module = null;
if (ModuleClass) {
module = new ModuleClass(this.#messageHandler);
module.moduleName = moduleName;
}
this.#modules.set(key, module);

View File

@ -51,4 +51,33 @@ export class RootBiDiModule extends Module {
contextInfo
);
}
/**
* Forwards a command to the windowglobal module corresponding to the provided
* browsing context id, using the same module name as the current one.
*
* @param {string} commandName
* The name of the command to execute.
* @param {number} browsingContextID
* The debuggable context ID.
* @param {object} params
* Any command parameters to pass.
* @param {object=} args
* Any additional command arguments to pass.
* @returns {Promise}
* A Promise that will resolve with the return value of the
* command once it has been executed.
*/
_forwardToWindowGlobal(commandName, browsingContextID, params, args = {}) {
return this.messageHandler.forwardCommand({
moduleName: this.moduleName,
commandName,
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: browsingContextID,
},
...args,
params,
});
}
}

View File

@ -1024,21 +1024,17 @@ class BrowsingContextModule extends RootBiDiModule {
);
}
const result = await this.messageHandler.forwardCommand({
moduleName: "browsingContext",
commandName: "_locateNodes",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: {
const result = await this._forwardToWindowGlobal(
"_locateNodes",
context.id,
{
locator,
maxNodeCount,
serializationOptions: serializationOptionsWithDefaults,
startNodes,
},
retryOnAbort: true,
});
{ retryOnAbort: true }
);
return {
nodes: result.serializedNodes,
@ -1461,19 +1457,15 @@ class BrowsingContextModule extends RootBiDiModule {
);
}
// Wait until the viewport has been resized
await this.messageHandler.forwardCommand({
moduleName: "browsingContext",
commandName: "_awaitViewportDimensions",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: {
await this._forwardToWindowGlobal(
"_awaitViewportDimensions",
context.id,
{
height: targetHeight,
width: targetWidth,
},
retryOnAbort: true,
});
{ retryOnAbort: true }
);
}
}
@ -2003,18 +1995,12 @@ class BrowsingContextModule extends RootBiDiModule {
}
#waitForVisibilityChange(browsingContext) {
return this.messageHandler.forwardCommand({
moduleName: "browsingContext",
commandName: "_awaitVisibilityState",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: browsingContext.id,
},
params: {
value: "hidden",
},
retryOnAbort: true,
});
return this._forwardToWindowGlobal(
"_awaitVisibilityState",
browsingContext.id,
{ value: "hidden" },
{ retryOnAbort: true }
);
}
/**

View File

@ -12,8 +12,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
pprint: "chrome://remote/content/shared/Format.sys.mjs",
TabManager: "chrome://remote/content/shared/TabManager.sys.mjs",
WindowGlobalMessageHandler:
"chrome://remote/content/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs",
});
ChromeUtils.defineLazyGetter(lazy, "prefAsyncEventsEnabled", () =>
@ -63,14 +61,8 @@ class InputModule extends RootBiDiModule {
* If target is outside the viewport.
*/
#assertInViewPort(target, context) {
return this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "_assertInViewPort",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: { target },
return this._forwardToWindowGlobal("_assertInViewPort", context.id, {
target,
});
}
@ -88,14 +80,9 @@ class InputModule extends RootBiDiModule {
* Promise that resolves once the event is dispatched.
*/
#dispatchEvent(eventName, context, details) {
return this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "_dispatchEvent",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: { eventName, details },
return this._forwardToWindowGlobal("_dispatchEvent", context.id, {
eventName,
details,
});
}
@ -109,14 +96,7 @@ class InputModule extends RootBiDiModule {
* Promise that resolves when the finalization is done.
*/
#finalizeAction(context) {
return this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "_finalizeAction",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
});
return this._forwardToWindowGlobal("_finalizeAction", context.id);
}
/**
@ -131,14 +111,8 @@ class InputModule extends RootBiDiModule {
* Promise that resolves to a list of DOMRect-like objects.
*/
#getClientRects(node, context) {
return this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "_getClientRects",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: { element: node },
return this._forwardToWindowGlobal("_getClientRects", context.id, {
element: node,
});
}
@ -154,14 +128,8 @@ class InputModule extends RootBiDiModule {
* Promise that resolves to the shared reference.
*/
#getElementOrigin(origin, context) {
return this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "_getElementOrigin",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: { origin },
return this._forwardToWindowGlobal("_getElementOrigin", context.id, {
origin,
});
}
@ -199,14 +167,8 @@ class InputModule extends RootBiDiModule {
* `rect`.
*/
#getInViewCentrePoint(rect, context) {
return this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "_getInViewCentrePoint",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: { rect },
return this._forwardToWindowGlobal("_getInViewCentrePoint", context.id, {
rect,
});
}
@ -255,16 +217,8 @@ class InputModule extends RootBiDiModule {
if (!lazy.prefAsyncEventsEnabled) {
// Bug 1920959: Remove if we no longer need to dispatch in content.
await this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "performActions",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: {
actions,
},
await this._forwardToWindowGlobal("performActions", context.id, {
actions,
});
return;
@ -318,15 +272,7 @@ class InputModule extends RootBiDiModule {
if (!lazy.prefAsyncEventsEnabled) {
// Bug 1920959: Remove if we no longer need to dispatch in content.
await this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "releaseActions",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: {},
});
await this._forwardToWindowGlobal("releaseActions", context.id);
return;
}
@ -396,14 +342,9 @@ class InputModule extends RootBiDiModule {
);
}
await this.messageHandler.forwardCommand({
moduleName: "input",
commandName: "setFiles",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: { element, files },
await this._forwardToWindowGlobal("setFiles", context.id, {
element,
files,
});
}

View File

@ -361,14 +361,10 @@ class ScriptModule extends RootBiDiModule {
const context = await this.#getContextFromTarget({ contextId, realmId });
const serializationOptionsWithDefaults =
lazy.setDefaultAndAssertSerializationOptions(serializationOptions);
const evaluationResult = await this.messageHandler.forwardCommand({
moduleName: "script",
commandName: "callFunctionDeclaration",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: {
const evaluationResult = await this._forwardToWindowGlobal(
"callFunctionDeclaration",
context.id,
{
awaitPromise,
commandArguments,
functionDeclaration,
@ -378,8 +374,8 @@ class ScriptModule extends RootBiDiModule {
serializationOptions: serializationOptionsWithDefaults,
thisParameter,
userActivation,
},
});
}
);
return this.#buildReturnValue(evaluationResult);
}
@ -412,18 +408,10 @@ class ScriptModule extends RootBiDiModule {
const { contextId, realmId, sandbox } = this.#assertTarget(target);
const context = await this.#getContextFromTarget({ contextId, realmId });
await this.messageHandler.forwardCommand({
moduleName: "script",
commandName: "disownHandles",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: {
handles,
realmId,
sandbox,
},
await this._forwardToWindowGlobal("disownHandles", context.id, {
handles,
realmId,
sandbox,
});
}
@ -488,14 +476,10 @@ class ScriptModule extends RootBiDiModule {
const context = await this.#getContextFromTarget({ contextId, realmId });
const serializationOptionsWithDefaults =
lazy.setDefaultAndAssertSerializationOptions(serializationOptions);
const evaluationResult = await this.messageHandler.forwardCommand({
moduleName: "script",
commandName: "evaluateExpression",
destination: {
type: lazy.WindowGlobalMessageHandler.type,
id: context.id,
},
params: {
const evaluationResult = await this._forwardToWindowGlobal(
"evaluateExpression",
context.id,
{
awaitPromise,
expression: source,
realmId,
@ -503,8 +487,8 @@ class ScriptModule extends RootBiDiModule {
sandbox,
serializationOptions: serializationOptionsWithDefaults,
userActivation,
},
});
}
);
return this.#buildReturnValue(evaluationResult);
}

View File

@ -26,6 +26,7 @@
#include <cassert>
#include <pthread.h>
#include <sched.h>
#include <fstream>
#include "wayland-proxy.h"

View File

@ -182,8 +182,9 @@ export class MLEngineChild extends JSWindowActorChild {
*
* @returns {Promise<object>}
*/
getInferenceOptions(taskName) {
getInferenceOptions(featureId, taskName) {
return this.sendQuery("MLEngine:GetInferenceOptions", {
featureId,
taskName,
});
}
@ -265,6 +266,9 @@ class EngineDispatcher {
/** @type {string} */
#taskName;
/** @type {string} */
#featureId;
/** @type {string} */
#engineId;
@ -293,6 +297,7 @@ class EngineDispatcher {
const wasm = await this.mlEngineChild.getWasmArrayBuffer();
let remoteSettingsOptions = await this.mlEngineChild.getInferenceOptions(
this.#featureId,
this.#taskName
);
@ -323,6 +328,7 @@ class EngineDispatcher {
constructor(mlEngineChild, port, pipelineOptions) {
this.#status = "CREATED";
this.mlEngineChild = mlEngineChild;
this.#featureId = pipelineOptions.featureId;
this.#taskName = pipelineOptions.taskName;
this.timeoutMS = pipelineOptions.timeoutMS;
this.#engineId = pipelineOptions.engineId;

View File

@ -221,7 +221,6 @@ export class MLEngineParent extends JSWindowActorParent {
return this.getModelFile(message.data);
case "MLEngine:GetInferenceProcessInfo":
lazy.console.log("GetInferenceProcessInfo called");
return lazy.getInferenceProcessInfo();
case "MLEngine:DestroyEngineProcess":
@ -231,7 +230,10 @@ export class MLEngineParent extends JSWindowActorParent {
break;
case "MLEngine:GetInferenceOptions":
this.checkTaskName(message.json.taskName);
return MLEngineParent.getInferenceOptions(message.json.taskName);
return MLEngineParent.getInferenceOptions(
message.json.featureId,
message.json.taskName
);
case "MLEngine:Removed":
if (!message.json.replacement) {
// when receiving this message from the child, we know it's not a replacement.
@ -371,21 +373,44 @@ export class MLEngineParent extends JSWindowActorParent {
return record;
}
/** Gets the inference options from remote settings given a task name.
/**
* Gets the inference options from remote settings given a feature id or task name.
*
* @param {string} taskName - name of the inference :wtask
* Each feature can store default options in Remote Settings.
*
* We fallback to taskName if there is no featureId provided.
*
* @param {string} featureId - id of the feature
* @param {string} taskName - name of the inference task
* @returns {Promise<ModelRevisionRecord>}
*/
static async getInferenceOptions(taskName) {
static async getInferenceOptions(featureId, taskName) {
const client = MLEngineParent.#getRemoteClient(
RS_INFERENCE_OPTIONS_COLLECTION
);
const records = await client.get({
let records = await client.get({
filters: {
taskName,
featureId,
},
});
// if the featureId is not in our settings, we fallback to the task name
if (records.length === 0) {
records = await client.get({
filters: {
taskName,
},
});
}
// if we get more than one entry we error out
if (records.length > 1) {
throw new Error(
`Found more than one inference options record for ${featureId} and ${taskName}`
);
}
// if the task name is not in our settings, we just set the onnx runtime filename.
if (records.length === 0) {
return {
@ -586,9 +611,7 @@ class MLEngine {
const engineId = pipelineOptions.engineId;
this.events = {};
this.engineId = engineId;
lazy.console.log("MLEngine constructor, adding engine", engineId);
MLEngine.#instances.set(engineId, this);
lazy.console.log("Instances", MLEngine.#instances);
this.mlEngineParent = mlEngineParent;
this.pipelineOptions = pipelineOptions;
this.notificationsCallback = notificationsCallback;
@ -821,7 +844,7 @@ class MLEngine {
return new Promise((resolve, reject) => {
// Initial check in case the status is already the desired one
if (this.engineStatus === desiredStatus) {
resolve(`Engine status is now ${desiredStatus}`);
resolve(`Engine status is now ${desiredStatus} `);
}
let onStatusChanged;
@ -830,7 +853,7 @@ class MLEngine {
const timeoutId = lazy.setTimeout(() => {
this.off("statusChanged", onStatusChanged);
reject(
`Timeout after ${TERMINATE_TIMEOUT}ms: Engine status did not reach ${desiredStatus}`
`Timeout after ${TERMINATE_TIMEOUT} ms: Engine status did not reach ${desiredStatus} `
);
}, TERMINATE_TIMEOUT);
@ -838,7 +861,7 @@ class MLEngine {
if (status === desiredStatus) {
this.off("statusChanged", onStatusChanged);
lazy.clearTimeout(timeoutId);
resolve(`Engine status is now ${desiredStatus}`);
resolve(`Engine status is now ${desiredStatus} `);
}
};

View File

@ -31,6 +31,16 @@ export class PipelineOptions {
*/
engineId = "default-engine";
/**
* The name of the feature to be used by the pipeline.
*
* This field can be used to uniquely identify an inference and
* overwrite taskName when doing lookups in Remote Settings.
*
* @type {?string}
*/
featureId = null;
/**
* The name of the task the pipeline is configured for.
*
@ -165,6 +175,7 @@ export class PipelineOptions {
updateOptions(options) {
const allowedKeys = [
"engineId",
"featureId",
"taskName",
"modelHubRootUrl",
"modelHubUrlTemplate",
@ -206,6 +217,7 @@ export class PipelineOptions {
getOptions() {
return {
engineId: this.engineId,
featureId: this.featureId,
taskName: this.taskName,
modelHubRootUrl: this.modelHubRootUrl,
modelHubUrlTemplate: this.modelHubUrlTemplate,

View File

@ -54,6 +54,7 @@ Options passed to the `createEngine` function are verified and converted into a
Below are the options available:
- **taskName**: The name of the task the pipeline is configured for.
- **featureId**: The identifier for the feature to be used by the pipeline.
- **engineId**: The identifier for the engine to be used by the pipeline.
- **timeoutMS**: The maximum amount of time in milliseconds the pipeline should wait for a response.
- **modelHubRootUrl**: The root URL of the model hub where models are hosted.
@ -73,6 +74,9 @@ using values pulled from Remote Settings when the task id is recognized.
To learn about the different inference tasks, refer to this Hugging Face
documentation: `Tasks <https://huggingface.co/tasks>`_
**featureId** is used to uniquely identify the feature that will be used by the pipeline
and store corresponding options in Remote Settings -- :ref:`See the ml-inference-options collection <inference-remote-settings>`.
**engineId** is used to manage the lifecycle of the engine. When not provided, it defaults to
`default-engine`. Everytime a new engine is created using `createEngine` the API will ensure that
there's a single engine with the given id. If the options of the existing engine are not different,

View File

@ -43,6 +43,7 @@ When Firefox uses a model, it will
2. download model files from our hub
3. store the files in IndexDB
.. _inference-remote-settings:
1. Remote Settings
------------------
@ -54,12 +55,14 @@ We have two collections in Remote Settings:
Running the inference API will download the WASM files if needed, and then see
if there's an entry for the task in `ml-inference-options`, to grab the options.
That allows us to set the default running options for each task.
This is also how we can update a model without changing Firefox's code:
setting a new revision for a model in Remote Settings will trigger a new download for our users.
Records in `ml-inference-options` are uniquely identified by `featureId`. When not provided,
it falls back to `taskName`.
2. Model Hub
------------

View File

@ -7,9 +7,10 @@
requestLongerTimeout(2);
async function setup({ disabled = false, prefs = [] } = {}) {
async function setup({ disabled = false, prefs = [], records = null } = {}) {
const { removeMocks, remoteClients } = await createAndMockMLRemoteSettings({
autoDownloadFromRemoteSettings: false,
records,
});
await SpecialPowers.pushPrefEnv({
@ -82,6 +83,73 @@ add_task(async function test_ml_engine_basics() {
await cleanup();
});
add_task(async function test_ml_engine_pick_feature_id() {
// one record sent back from RS contains featureId
const records = [
{
taskName: "moz-echo",
modelId: "mozilla/distilvit",
processorId: "mozilla/distilvit",
tokenizerId: "mozilla/distilvit",
modelRevision: "main",
processorRevision: "main",
tokenizerRevision: "main",
dtype: "q8",
id: "74a71cfd-1734-44e6-85c0-69cf3e874138",
},
{
featureId: "myCoolFeature",
taskName: "moz-echo",
modelId: "mozilla/distilvit",
processorId: "mozilla/distilvit",
tokenizerId: "mozilla/distilvit",
modelRevision: "v1.0",
processorRevision: "v1.0",
tokenizerRevision: "v1.0",
dtype: "fp16",
id: "74a71cfd-1734-44e6-85c0-69cf3e874138",
},
];
const { cleanup, remoteClients } = await setup({ records });
info("Get the engine");
const engineInstance = await createEngine({
featureId: "myCoolFeature",
taskName: "moz-echo",
});
info("Check the inference process is running");
Assert.equal(await checkForRemoteType("inference"), true);
info("Run the inference");
const inferencePromise = engineInstance.run({ data: "This gets echoed." });
info("Wait for the pending downloads.");
await remoteClients["ml-onnx-runtime"].resolvePendingDownloads(1);
const res = await inferencePromise;
Assert.equal(
res.output.echo,
"This gets echoed.",
"The text get echoed exercising the whole flow."
);
Assert.equal(
res.output.dtype,
"fp16",
"The config was enriched by RS - using a feature Id"
);
ok(
!EngineProcess.areAllEnginesTerminated(),
"The engine process is still active."
);
await EngineProcess.destroyMLEngine();
await cleanup();
});
add_task(async function test_ml_engine_wasm_rejection() {
const { cleanup, remoteClients } = await setup();
@ -626,6 +694,7 @@ add_task(async function test_ml_engine_get_status() {
status: "IDLING",
options: {
engineId: "default-engine",
featureId: null,
taskName: "moz-echo",
timeoutMS: 1000,
modelHubRootUrl:

View File

@ -38,11 +38,12 @@ function getDefaultWasmRecords() {
async function createAndMockMLRemoteSettings({
autoDownloadFromRemoteSettings = false,
records = null,
} = {}) {
const runtime = await createMLWasmRemoteClient(
autoDownloadFromRemoteSettings
);
const options = await createOptionsRemoteClient();
const options = await createOptionsRemoteClient(records);
const remoteClients = {
"ml-onnx-runtime": runtime,
@ -105,7 +106,7 @@ async function createMLWasmRemoteClient(autoDownloadFromRemoteSettings) {
*
* @returns {RemoteSettings}
*/
async function createOptionsRemoteClient(record = null) {
async function createOptionsRemoteClient(records = null) {
const { RemoteSettings } = ChromeUtils.importESModule(
"resource://services-settings/remote-settings.sys.mjs"
);
@ -114,21 +115,23 @@ async function createOptionsRemoteClient(record = null) {
`${mockedCollectionName}-${_remoteSettingsMockId++}`
);
if (!record) {
record = {
taskName: "moz-echo",
modelId: "mozilla/distilvit",
processorId: "mozilla/distilvit",
tokenizerId: "mozilla/distilvit",
modelRevision: "main",
processorRevision: "main",
tokenizerRevision: "main",
dtype: "q8",
id: "74a71cfd-1734-44e6-85c0-69cf3e874138",
};
if (!records) {
records = [
{
taskName: "moz-echo",
modelId: "mozilla/distilvit",
processorId: "mozilla/distilvit",
tokenizerId: "mozilla/distilvit",
modelRevision: "main",
processorRevision: "main",
tokenizerRevision: "main",
dtype: "q8",
id: "74a71cfd-1734-44e6-85c0-69cf3e874138",
},
];
}
await client.db.clear();
await client.db.importChanges({}, Date.now(), [record]);
await client.db.importChanges({}, Date.now(), records);
return client;
}

View File

@ -1081,80 +1081,6 @@ nsresult Classifier::CleanToDelete() {
return NS_OK;
}
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
already_AddRefed<nsIFile> Classifier::GetFailedUpdateDirectroy() {
nsCString failedUpdatekDirName = STORE_DIRECTORY + nsCString("-failedupdate");
nsCOMPtr<nsIFile> failedUpdatekDirectory;
if (NS_FAILED(
mCacheDirectory->Clone(getter_AddRefs(failedUpdatekDirectory))) ||
NS_FAILED(failedUpdatekDirectory->AppendNative(failedUpdatekDirName))) {
LOG(("Failed to init failedUpdatekDirectory."));
return nullptr;
}
return failedUpdatekDirectory.forget();
}
nsresult Classifier::DumpRawTableUpdates(const nsACString& aRawUpdates) {
LOG(("Dumping raw table updates..."));
DumpFailedUpdate();
nsCOMPtr<nsIFile> failedUpdatekDirectory = GetFailedUpdateDirectroy();
// Create tableupdate.bin and dump raw table update data.
nsCOMPtr<nsIFile> rawTableUpdatesFile;
nsCOMPtr<nsIOutputStream> outputStream;
if (NS_FAILED(
failedUpdatekDirectory->Clone(getter_AddRefs(rawTableUpdatesFile))) ||
NS_FAILED(
rawTableUpdatesFile->AppendNative(nsCString("tableupdates.bin"))) ||
NS_FAILED(NS_NewLocalFileOutputStream(
getter_AddRefs(outputStream), rawTableUpdatesFile,
PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE))) {
LOG(("Failed to create file to dump raw table updates."));
return NS_ERROR_FAILURE;
}
// Write out the data.
uint32_t written;
nsresult rv = outputStream->Write(aRawUpdates.BeginReading(),
aRawUpdates.Length(), &written);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(written == aRawUpdates.Length(), NS_ERROR_FAILURE);
return rv;
}
nsresult Classifier::DumpFailedUpdate() {
LOG(("Dumping failed update..."));
nsCOMPtr<nsIFile> failedUpdatekDirectory = GetFailedUpdateDirectroy();
// Remove the "failed update" directory no matter it exists or not.
// Failure is fine because the directory may not exist.
failedUpdatekDirectory->Remove(true);
nsCString failedUpdatekDirName;
nsresult rv = failedUpdatekDirectory->GetNativeLeafName(failedUpdatekDirName);
NS_ENSURE_SUCCESS(rv, rv);
// Copy the in-use directory to a clean "failed update" directory.
nsCOMPtr<nsIFile> inUseDirectory;
if (NS_FAILED(mRootStoreDirectory->Clone(getter_AddRefs(inUseDirectory))) ||
NS_FAILED(inUseDirectory->CopyToNative(nullptr, failedUpdatekDirName))) {
LOG(("Failed to move in-use to the \"failed update\" directory %s",
failedUpdatekDirName.get()));
return NS_ERROR_FAILURE;
}
return rv;
}
#endif // MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
/**
* This function copies the files one by one to the destination folder.
* Before copying a file, it checks ::ShouldAbort and returns

View File

@ -93,10 +93,6 @@ class Classifier {
nsresult ReadNoiseEntries(const Prefix& aPrefix, const nsACString& aTableName,
uint32_t aCount, PrefixArray& aNoiseEntries);
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
nsresult DumpRawTableUpdates(const nsACString& aRawUpdates);
#endif
static void SplitTables(const nsACString& str, nsTArray<nsCString>& tables);
// Given a root store directory, return a private store directory
@ -149,11 +145,6 @@ class Classifier {
// and on-disk data.
void RemoveUpdateIntermediaries();
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
already_AddRefed<nsIFile> GetFailedUpdateDirectroy();
nsresult DumpFailedUpdate();
#endif
nsresult ScanStoreDir(nsIFile* aDirectory,
const nsTArray<nsCString>& aExtensions,
nsTArray<nsCString>& aTables);

View File

@ -124,9 +124,6 @@ nsresult ProtocolParserV2::AppendStream(const nsACString& aData) {
if (!mPending.Append(aData, mozilla::fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
mRawUpdate.Append(aData);
#endif
bool done = false;
while (!done) {

View File

@ -27,10 +27,6 @@ class ProtocolParser {
nsresult Status() const { return mUpdateStatus; }
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
virtual nsCString GetRawTableUpdates() const { return mPending; }
#endif
virtual void SetCurrentTable(const nsACString& aTable) = 0;
void SetRequestedTables(const nsTArray<nsCString>& aRequestTables) {
@ -100,12 +96,6 @@ class ProtocolParserV2 final : public ProtocolParser {
return mForwards;
}
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
// Unfortunately we have to override to return mRawUpdate which
// will not be modified during the parsing, unlike mPending.
virtual nsCString GetRawTableUpdates() const override { return mRawUpdate; }
#endif
private:
virtual RefPtr<TableUpdate> CreateTableUpdate(
const nsACString& aTableName) const override;
@ -163,10 +153,6 @@ class ProtocolParserV2 final : public ProtocolParser {
// Updates to apply to the current table being parsed.
RefPtr<TableUpdateV2> mTableUpdate;
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
nsCString mRawUpdate; // Keep a copy of mPending before it's processed.
#endif
};
// Helpers to parse the "proto" list format.

View File

@ -734,11 +734,6 @@ nsUrlClassifierDBServiceWorker::FinishStream() {
mTableUpdates.AppendElements(mProtocolParser->GetTableUpdates());
mProtocolParser->ForgetTableUpdates();
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
// The assignment involves no string copy since the source string is
// sharable.
mRawTableUpdates = mProtocolParser->GetRawTableUpdates();
#endif
} else {
LOG(
("nsUrlClassifierDBService::FinishStream Failed to parse the stream "
@ -795,18 +790,8 @@ nsUrlClassifierDBServiceWorker::FinishUpdate() {
RefPtr<nsUrlClassifierDBServiceWorker> self = this;
nsresult rv = mClassifier->AsyncApplyUpdates(
mTableUpdates, [self](nsresult aRv) -> void {
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
if (NS_FAILED(aRv) && NS_ERROR_OUT_OF_MEMORY != aRv &&
NS_ERROR_UC_UPDATE_SHUTDOWNING != aRv) {
self->mClassifier->DumpRawTableUpdates(self->mRawTableUpdates);
}
// Invalidate the raw table updates.
self->mRawTableUpdates.Truncate();
#endif
self->NotifyUpdateObserver(aRv);
});
mTableUpdates,
[self](nsresult aRv) -> void { self->NotifyUpdateObserver(aRv); });
mTableUpdates.Clear(); // Classifier is working on its copy.
if (NS_FAILED(rv)) {

View File

@ -271,11 +271,6 @@ class nsUrlClassifierDBServiceWorker final : public nsIUrlClassifierDBService {
// list of pending lookups
nsTArray<PendingLookup> mPendingLookups;
#ifdef MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES
// The raw update response for debugging.
nsCString mRawTableUpdates;
#endif
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsUrlClassifierDBService,

View File

@ -1140,13 +1140,6 @@ def telemetry_on_by_default(reporting, is_nightly):
set_define("MOZ_TELEMETRY_ON_BY_DEFAULT", True, when=telemetry_on_by_default)
# Safe browing
# ==============================================================
set_define(
"MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES", True, when=milestone.is_nightly | moz_debug
)
# Miscellaneous programs
# ==============================================================

View File

@ -1021,7 +1021,7 @@ class nsWindow final : public nsBaseWidget {
LayoutDeviceIntRect mLastLoggedBoundSize;
int mLastLoggedScale = -1;
#endif
mozilla::Sides mResizableEdges;
mozilla::Sides mResizableEdges{mozilla::SideBits::eAll};
// Running in kiosk mode and requested to stay on specified monitor.
// If monitor is removed minimize the window.
mozilla::Maybe<int> mKioskMonitor;