Merge mozilla-central to inbound. a=merge CLOSED TREE

This commit is contained in:
Oana Pop Rus 2019-07-19 01:06:05 +03:00
Родитель 4503ade360 8526799100
Коммит f52133cc3d
179 изменённых файлов: 4003 добавлений и 2441 удалений

Просмотреть файл

@ -450,6 +450,17 @@ class ContextMenuChild extends JSWindowActorChild {
return node instanceof this.contentWindow.HTMLTextAreaElement;
}
/**
* Check if we are in the parent process and the current iframe is the RDM iframe.
*/
_isTargetRDMFrame(node) {
return (
Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_DEFAULT &&
node.tagName === "iframe" &&
node.hasAttribute("mozbrowser")
);
}
_isSpellCheckEnabled(aNode) {
// We can always force-enable spellchecking on textboxes
if (this._isTargetATextBox(aNode)) {
@ -524,6 +535,12 @@ class ContextMenuChild extends JSWindowActorChild {
return;
}
if (this._isTargetRDMFrame(aEvent.composedTarget)) {
// The target is in the DevTools RDM iframe, a proper context menu event
// will be created from the RDM browser.
return;
}
let doc = aEvent.composedTarget.ownerDocument;
let {
mozDocumentURIIfNotForErrorPages: docLocation,

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<blocklist lastupdate="1563186751969" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist lastupdate="1563367115113" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
<prefs/>
@ -3309,6 +3309,14 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="59cf2549-3930-4a60-a212-af84facbee32" id="/^((\{7e9c2e2c-8d2d-4406-bb3d-993176f59b34\})|(\{f743e1bf-9a1c-43ab-b8ab-57972761b919\})|(\{b8274b35-eeaf-4d98-8a6a-cc4fd56603ed\})|(\{fd90393d-6ac6-4245-a048-9d423baacbd1\})|(\{3f7b376e-23ad-4296-8fd1-77fb254610bc\})|(\{fd918017-a23c-40f0-88e1-798ed6fc51f7\})|(\{bac48192-5c1f-4dae-aa1c-2fa9ca65dbe0\}))$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="1f35915e-2de0-4973-adf4-4e77073e0b42" id="/^((\{e656b354-3c95-4a63-a271-fe301b294da0\})|(\{f5ab4224-43ca-4654-b189-23aa9c960803\})|(\{fb68ec9f-d02a-48c9-a356-3020bd1d3e21\})|(\{2eabd9de-b8bc-43f2-9e77-624a0e04e38d\})|(\{426fe5e4-5da1-41b3-81d4-28bd59724f84\})|(\{4b1d9906-5cc4-44a6-ad64-a6c7b0e2ebba\})|(\{bbe2e2b3-4a77-4108-9183-e0b02676c09d\})|(\{01aef979-833c-4f7d-85a0-6be87462c05e\})|(\{9b51394e-a1a9-4864-9876-cc1d6f1a47d5\})|(\{7c4f0798-6edc-417b-8702-d97ca1c894c6\})|(\{ad93f537-5824-4057-a44f-cef1f97c2d68\})|(\{ff62fb9d-c5b7-414d-8c2b-bc5d796475e8\})|(\{46998928-4162-46e0-b4c7-260a8520aad9\})|(\{731367f8-f5e8-4ade-b8cf-5aaf8c2a455b\})|(\{eb6b098d-7811-4a20-a94f-ca91721d4aab\})|(\{6ddb9deb-d435-4ec2-be8b-ca65900e43e9\})|(\{288e4bb9-454e-4374-8734-1069241d618e\}))$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p332">
@ -3344,12 +3352,12 @@
<pluginItem blockID="832dc9ff-3314-4df2-abcf-7bd65a645371">
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="32.0.0.192" minVersion="0" severity="0" vulnerabilitystatus="1"/>
<versionRange maxVersion="32.0.0.207" minVersion="0" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
<pluginItem blockID="49b843cc-a8fc-4ede-be0c-a0da56d0214f" os="Linux">
<match exp="libflashplayer\.so" name="filename"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="32.0.0.192" minVersion="0" severity="0" vulnerabilitystatus="1"/>
<versionRange maxVersion="32.0.0.207" minVersion="0" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
</pluginItems>
<gfxItems>

Просмотреть файл

@ -1610,6 +1610,9 @@ pref("browser.contentblocking.reportBreakage.url", "https://tracking-protection-
// Enable Protections report's Lockwise card by default.
pref("browser.contentblocking.report.lockwise.enabled", true);
// Enable Protections report's Monitor card by default.
pref("browser.contentblocking.report.monitor.enabled", true);
// Enables the new Protections Panel.
#ifdef NIGHTLY_BUILD
pref("browser.protections_panel.enabled", true);
@ -1744,7 +1747,13 @@ pref("signon.generation.enabled", true);
pref("signon.schemeUpgrades", true);
pref("signon.privateBrowsingCapture.enabled", true);
pref("signon.showAutoCompleteFooter", true);
#ifdef NIGHTLY_BUILD
pref("signon.management.page.enabled", true);
pref("signon.management.overrideURI", "about:logins?filter=%DOMAIN%");
#else
pref("signon.management.page.enabled", false);
#endif
pref("signon.management.page.breach-alerts.enabled", false);
#ifdef NIGHTLY_BUILD
// Bug 1563330 tracks shipping this by default.
pref("signon.showAutoCompleteOrigins", true);

Просмотреть файл

@ -0,0 +1 @@
<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientTransform="matrix(1 0 0 -1 0 66)" gradientUnits="userSpaceOnUse" x1="44.39" x2="17.83" y1="55.11" y2="9.1"><stop offset="0" stop-color="#ff980e"/><stop offset=".21" stop-color="#ff7139"/><stop offset=".36" stop-color="#ff5854"/><stop offset=".46" stop-color="#ff4f5e"/><stop offset=".69" stop-color="#ff3750"/><stop offset=".86" stop-color="#f92261"/><stop offset="1" stop-color="#f5156c"/></linearGradient><linearGradient id="b" gradientTransform="matrix(1 0 0 -1 0 66)" gradientUnits="userSpaceOnUse" x1="44.39" x2="17.83" y1="55.11" y2="9.1"><stop offset="0" stop-color="#fff44f" stop-opacity=".8"/><stop offset=".75" stop-color="#fff44f" stop-opacity="0"/></linearGradient><linearGradient id="c" gradientTransform="matrix(1 0 0 -1 0 66)" gradientUnits="userSpaceOnUse" x1="44.49" x2="44.49" y1="3.82" y2="58.55"><stop offset="0" stop-color="#3a8ee6"/><stop offset=".24" stop-color="#5c79f0"/><stop offset=".63" stop-color="#9059ff"/><stop offset="1" stop-color="#c139e6"/></linearGradient><linearGradient id="d" gradientTransform="matrix(1 0 0 -1 0 66)" gradientUnits="userSpaceOnUse" x1="35.2" x2="59.52" y1="60.58" y2="36.25"><stop offset="0" stop-color="#6e008b" stop-opacity=".5"/><stop offset=".5" stop-color="#c846cb" stop-opacity="0"/></linearGradient><linearGradient id="e" gradientTransform="matrix(1 0 0 -1 0 66)" gradientUnits="userSpaceOnUse" x1="59.67" x2="45.66" y1="30.62" y2="16.61"><stop offset=".14" stop-color="#6a2bea" stop-opacity="0"/><stop offset=".3" stop-color="#662ce6" stop-opacity=".09"/><stop offset=".47" stop-color="#592fdb" stop-opacity=".19"/><stop offset=".64" stop-color="#4534c9" stop-opacity=".29"/><stop offset=".81" stop-color="#283baf" stop-opacity=".39"/><stop offset=".99" stop-color="#03448d" stop-opacity=".49"/><stop offset="1" stop-color="#00458b" stop-opacity=".5"/></linearGradient><linearGradient id="f" gradientTransform="matrix(1 0 0 -1 0 66)" gradientUnits="userSpaceOnUse" x1="38.67" x2="41.95" y1="21.69" y2="17.77"><stop offset="0" stop-color="#960e18" stop-opacity=".6"/><stop offset=".17" stop-color="#a91522" stop-opacity=".47"/><stop offset=".51" stop-color="#d9283c" stop-opacity=".19"/><stop offset=".75" stop-color="#ff3750" stop-opacity="0"/></linearGradient><path d="m54.55 15.53-5.71-3.26-13-7.46-.41-.23a6.88 6.88 0 0 0 -6.88 0l-.42.23-18.28 10.48-.41.24a6.83 6.83 0 0 0 -3.44 5.92v21.89a6.86 6.86 0 0 0 3.44 5.92l18.7 10.74a2.75 2.75 0 0 0 1.44.38 2.91 2.91 0 0 0 2.49-1.42 2.83 2.83 0 0 0 -1.07-3.96l-18.29-10.44a2 2 0 0 1 -1-1.69v-20.95a2 2 0 0 1 1-1.69l3.29-1.85 15-8.63a2 2 0 0 1 2 0l18.27 10.48a2 2 0 0 1 1 1.69v20.95a1.94 1.94 0 0 1 -1 1.69l-6.18 3.54-3.09-4.71a15 15 0 1 0 -5 2.92l4.75 7.15a1.91 1.91 0 0 0 .24.32 3.18 3.18 0 0 0 .33.3.27.27 0 0 0 .08.07l.41.25h.1a1.3 1.3 0 0 0 .39.14.14.14 0 0 0 .09 0 2.34 2.34 0 0 0 .45.07.3.3 0 0 1 .13 0h.39a.23.23 0 0 0 .11 0 2.57 2.57 0 0 0 .48-.11.26.26 0 0 0 .12 0l.37-.16h.08l8.94-5.13a6.83 6.83 0 0 0 3.54-5.9v-21.86a6.75 6.75 0 0 0 -3.45-5.92zm-31.74 16.85a9.18 9.18 0 1 1 9.19 9.11 9.15 9.15 0 0 1 -9.19-9.11z" fill="url(#a)"/><path d="m54.55 15.53-5.71-3.26-13-7.46-.41-.23a6.88 6.88 0 0 0 -6.88 0l-.42.23-18.28 10.48-.41.24a6.83 6.83 0 0 0 -3.44 5.92v21.89a6.86 6.86 0 0 0 3.44 5.92l18.7 10.74a2.75 2.75 0 0 0 1.44.38 2.91 2.91 0 0 0 2.49-1.42 2.83 2.83 0 0 0 -1.07-3.96l-18.29-10.44a2 2 0 0 1 -1-1.69v-20.95a2 2 0 0 1 1-1.69l3.29-1.85 15-8.63a2 2 0 0 1 2 0l18.27 10.48a2 2 0 0 1 1 1.69v20.95a1.94 1.94 0 0 1 -1 1.69l-6.18 3.54-3.09-4.71a15 15 0 1 0 -5 2.92l4.75 7.15a1.91 1.91 0 0 0 .24.32 3.18 3.18 0 0 0 .33.3.27.27 0 0 0 .08.07l.41.25h.1a1.3 1.3 0 0 0 .39.14.14.14 0 0 0 .09 0 2.34 2.34 0 0 0 .45.07.3.3 0 0 1 .13 0h.39a.23.23 0 0 0 .11 0 2.57 2.57 0 0 0 .48-.11.26.26 0 0 0 .12 0l.37-.16h.08l8.94-5.13a6.83 6.83 0 0 0 3.54-5.9v-21.86a6.75 6.75 0 0 0 -3.45-5.92zm-31.74 16.85a9.18 9.18 0 1 1 9.19 9.11 9.15 9.15 0 0 1 -9.19-9.11z" fill="url(#b)"/><path d="m54.55 15.53-5.71-3.26-7.94-4.55a6.11 6.11 0 0 0 -5.9-.08l-4 2.11a2 2 0 0 1 2 0l18.3 10.48a1.94 1.94 0 0 1 1 1.69v20.95a1.93 1.93 0 0 1 -1 1.69l-6.23 3.54 1 1.55a4.05 4.05 0 0 0 5.41 1.35l3.06-1.75a6.82 6.82 0 0 0 3.46-5.91v-21.9a6.75 6.75 0 0 0 -3.45-5.91z" fill="url(#c)"/><path d="m52.26 21.92v10.16h5.74v-10.64a6.83 6.83 0 0 0 -3.44-5.92l-5.7-3.26-8-4.55a6.14 6.14 0 0 0 -5.86-.09l-4 2.12a2 2 0 0 1 2 0l18.27 10.48a2 2 0 0 1 .99 1.7z" fill="url(#d)"/><path d="m52.26 33.72v9.14a2 2 0 0 1 -1 1.69l-6.19 3.54 1 1.55a4.06 4.06 0 0 0 5.42 1.36l3.06-1.75a6.84 6.84 0 0 0 3.45-5.92v-9.63h-5.74z" fill="url(#e)" opacity=".9"/><path d="m41.17 32.38a9.18 9.18 0 1 0 -9.17 9.11 9.14 9.14 0 0 0 9.17-9.11z" fill="none"/><path d="m44.64 47.43-2.68-4a15 15 0 0 1 -4.96 2.88l2.86 4.31c1.63-1.02 3.22-2.08 4.78-3.19z" fill="url(#f)" opacity=".9"/></svg>

После

Ширина:  |  Высота:  |  Размер: 4.8 KiB

Просмотреть файл

@ -20,6 +20,7 @@ const kESModuleList = new Set([
/browser\/aboutlogins\/.*\.js$/,
/browser\/protections.js$/,
/browser\/lockwise-card.js$/,
/browser\/monitor-card.js$/,
/toolkit\/content\/global\/certviewer\/components\/.*\.js$/,
/toolkit\/content\/global\/certviewer\/.*\.js$/,
]);

Просмотреть файл

@ -21,6 +21,7 @@ browser.jar:
content/browser/illustrations/blue-berror.svg (content/illustrations/blue-berror.svg)
content/browser/logos/lockwise.svg (content/logos/lockwise.svg)
content/browser/logos/lockwise-mobile-app.svg (content/logos/lockwise-mobile-app.svg)
content/browser/logos/monitor.svg (content/logos/monitor.svg)
content/browser/aboutNetError.xhtml (content/aboutNetError.xhtml)
content/browser/aboutNetError.js (content/aboutNetError.js)
content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)

Просмотреть файл

@ -56,8 +56,8 @@
!define INSTALL_PROGRESS_BAR_WIDTH "150u"
!define INSTALL_PROGRESS_BAR_HEIGHT "12u"
!define PROFILE_CLEANUP_CHECKBOX_TOP_MARGIN "20u"
!define PROFILE_CLEANUP_BUTTON_TOP_MARGIN "20u"
!define PROFILE_CLEANUP_CHECKBOX_TOP_MARGIN "12u"
!define PROFILE_CLEANUP_BUTTON_TOP_MARGIN "12u"
!define PROFILE_CLEANUP_BUTTON_X_PADDING "80u"
!define PROFILE_CLEANUP_BUTTON_Y_PADDING "8u"
!define INSTALL_BODY_TOP_MARGIN "20u"

Просмотреть файл

@ -41,12 +41,15 @@ var AboutProtectionsHandler = {
"OpenSyncPreferences",
// Fetching data
"FetchContentBlockingEvents",
"FetchMonitorData",
"FetchUserLoginsData",
// Getting prefs
"GetEnabledLockwiseCard",
"GetEnabledPrefs",
],
PREF_LOCKWISE_CARD_ENABLED: "browser.contentblocking.report.lockwise.enabled",
_prefs: {
LockwiseCard: "browser.contentblocking.report.lockwise.enabled",
MonitorCard: "browser.contentblocking.report.monitor.enabled",
},
init() {
this.receiveMessage = this.receiveMessage.bind(this);
@ -70,24 +73,43 @@ var AboutProtectionsHandler = {
/**
* Retrieves login data for the user.
*
* @return {{ isLoggedIn: Boolean,
* numberOfLogins: Number,
* numberOfSyncedDevices: Number }}
* @return {{ hasFxa: Boolean,
* numLogins: Number,
* numSyncedDevices: Number }}
* The login data.
*/
async getLoginData() {
const loginCount = Services.logins.countLogins("", "", "");
let syncedDevices = [];
const isLoggedWithFxa = await fxAccounts.accountStatus();
const hasFxa = await fxAccounts.accountStatus();
if (isLoggedWithFxa) {
if (hasFxa) {
syncedDevices = await fxAccounts.getDeviceList();
}
return {
isLoggedIn: loginCount > 0 || syncedDevices.length > 0,
numberOfLogins: loginCount,
numberOfSyncedDevices: syncedDevices.length,
hasFxa,
numLogins: Services.logins.countLogins("", "", ""),
numSyncedDevices: syncedDevices.length,
};
},
/**
* Retrieves monitor data for the user.
*
* @return {{ monitoredEmails: Number,
* numBreaches: Number,
* passwords: Number,
* error: Boolean }}
* Monitor data.
*/
async getMonitorData() {
// TODO: Fetch real data for endpoints in Bug 1559424.
return {
monitoredEmails: 1,
numBreaches: 11,
passwords: 8,
lockwisePasswords: 2,
error: false,
};
},
@ -154,6 +176,13 @@ var AboutProtectionsHandler = {
dataToSend
);
break;
case "FetchMonitorData":
this.sendMessage(
aMessage.target,
"SendMonitorData",
await this.getMonitorData()
);
break;
case "FetchUserLoginsData":
this.sendMessage(
aMessage.target,
@ -161,13 +190,17 @@ var AboutProtectionsHandler = {
await this.getLoginData()
);
break;
case "GetEnabledLockwiseCard":
const enabled = Services.prefs.getBoolPref(
this.PREF_LOCKWISE_CARD_ENABLED
);
this.sendMessage(aMessage.target, "SendEnabledLockWiseCardPref", {
isEnabled: enabled,
});
case "GetEnabledPrefs":
const prefs = Object.keys(this._prefs);
// Get all the enabled prefs and send separate messages depending on their names.
for (let name of prefs) {
const message = `SendEnabled${name}Pref`;
const isEnabled = Services.prefs.getBoolPref(this._prefs[name]);
this.sendMessage(aMessage.target, message, {
isEnabled,
});
}
break;
}
},

Просмотреть файл

@ -38,6 +38,12 @@ ChromeUtils.defineModuleGetter(
XPCOMUtils.defineLazyGetter(this, "log", () => {
return LoginHelper.createLogger("AboutLoginsParent");
});
XPCOMUtils.defineLazyPreferenceGetter(
this,
"BREACH_ALERTS_ENABLED",
"signon.management.page.breach-alerts.enabled",
false
);
const ABOUT_LOGINS_ORIGIN = "about:logins";
const MASTER_PASSWORD_NOTIFICATION_ID = "master-password-login-required";
@ -182,17 +188,22 @@ var AboutLoginsParent = {
this._subscribers.add(message.target);
let messageManager = message.target.messageManager;
const logins = await this.getAllLogins();
messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins);
const breaches = await RemoteSettings("fxmonitor-breaches").get();
const breachesByLoginGUID = await this.getBreachesForLogins(
logins,
breaches
);
messageManager.sendAsyncMessage(
"AboutLogins:UpdateBreaches",
breachesByLoginGUID
);
this.getAllLogins().then(async logins => {
messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins);
if (!BREACH_ALERTS_ENABLED) {
return;
}
const breaches = await RemoteSettings("fxmonitor-breaches").get();
const breachesByLoginGUID = await this.getBreachesForLogins(
logins,
breaches
);
messageManager.sendAsyncMessage(
"AboutLogins:UpdateBreaches",
breachesByLoginGUID
);
});
break;
}
case "AboutLogins:UpdateLogin": {

Просмотреть файл

@ -7,14 +7,17 @@
ChromeUtils.defineModuleGetter(
this,
"gDevTools",
"resource://devtools/client/framework/gDevTools.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"devtools",
"loader",
"resource://devtools/shared/Loader.jsm"
);
XPCOMUtils.defineLazyGetter(this, "gDevTools", () => {
const { gDevTools } = loader.require("devtools/client/framework/devtools");
return gDevTools;
});
XPCOMUtils.defineLazyGetter(this, "TargetFactory", () => {
const { TargetFactory } = loader.require("devtools/client/framework/target");
return TargetFactory;
});
const TOOLBOX_BLANK_PANEL_ID = "testBlankPanel";
@ -48,7 +51,7 @@ async function registerBlankToolboxPanel() {
}
function getToolboxTargetForTab(tab) {
return devtools.TargetFactory.forTab(tab);
return TargetFactory.forTab(tab);
}
async function openToolboxForTab(tab, panelId = TOOLBOX_BLANK_PANEL_ID) {

Просмотреть файл

@ -608,9 +608,12 @@ var paymentDialogWrapper = {
);
return;
}
let { gDevToolsBrowser } = ChromeUtils.import(
"resource://devtools/client/framework/gDevTools.jsm"
const { require } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const {
gDevToolsBrowser,
} = require("devtools/client/framework/devtools-browser");
gDevToolsBrowser.openContentProcessToolbox({
selectedBrowser: this.frameWeakRef.get(),
});

Просмотреть файл

@ -9,6 +9,7 @@ var passwordsDialog;
add_task(async function test_setup() {
Services.logins.removeAllLogins();
Services.prefs.setCharPref(PREF_MANAGEMENT_URI, "");
// add login data
let nsLoginInfo = new Components.Constructor(

Просмотреть файл

@ -36,13 +36,11 @@ export default class LockwiseCard {
);
lockwiseCard.classList.remove("hidden");
});
// Dispatch messages to retrieve data for the Lockwise card.
RPMSendAsyncMessage("FetchUserLoginsData");
}
buildContent(data) {
const { isLoggedIn, numberOfLogins, numberOfSyncedDevices } = data;
const { hasFxa, numLogins, numSyncedDevices } = data;
const isLoggedIn = numLogins > 0 || hasFxa;
const title = this.doc.getElementById("lockwise-title");
const headerContent = this.doc.getElementById("lockwise-header-content");
const lockwiseBodyContent = this.doc.getElementById(
@ -60,11 +58,7 @@ export default class LockwiseCard {
title.textContent = "Firefox Lockwise";
headerContent.textContent =
"Securely store and sync your passwords to all your devices.";
this.renderContentForLoggedInUser(
container,
numberOfLogins,
numberOfSyncedDevices
);
this.renderContentForLoggedInUser(container, numLogins, numSyncedDevices);
} else {
title.textContent = "Never forget a password again";
headerContent.textContent =

Просмотреть файл

@ -0,0 +1,91 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/frame-script */
export default class MonitorClass {
constructor(document) {
this.doc = document;
}
init() {
const signUpForMonitorButton = this.doc.getElementById(
"sign-up-for-monitor-button"
);
signUpForMonitorButton.addEventListener("click", () => {
console.log("TODO: Where is this link supposed to go.");
});
RPMAddMessageListener("SendUserLoginsData", ({ data }) => {
// Wait for monitor data and display the card.
this.getMonitorData(data);
RPMSendAsyncMessage("FetchMonitorData");
});
}
/**
* Adds a listener for receiving the monitor data. Once received then display this data
* in the card.
*
* @param {Object} loginData
* Login data received from the Logins service.
*/
getMonitorData(loginData) {
RPMAddMessageListener("SendMonitorData", ({ data: monitorData }) => {
// Once data for the user is retrieved, display the monitor card.
this.buildContent(loginData, monitorData);
// Show the Monitor card.
const monitorCard = this.doc.querySelector(
".report-card.monitor-card.hidden"
);
monitorCard.classList.remove("hidden");
});
}
buildContent(loginData, monitorData) {
const { hasFxa, numLogins } = loginData;
const isLoggedIn = numLogins > 0 || hasFxa;
const headerContent = this.doc.querySelector(
"#monitor-header-content span"
);
const monitorCard = this.doc.querySelector(".report-card.monitor-card");
if (isLoggedIn && !monitorData.error) {
monitorCard.classList.add("has-logins");
headerContent.textContent =
"Firefox Monitor warns you if your info has appeared in a known data breach";
this.renderContentForUserWithLogins(monitorData);
} else {
monitorCard.classList.add("no-logins");
const signUpForMonitorButton = this.doc.getElementById(
"sign-up-for-monitor-button"
);
signUpForMonitorButton.textContent = hasFxa
? "Turn on Monitor"
: "Sign up for Monitor";
headerContent.textContent =
"Check Firefox Monitor to see if you've been part of a data breach and get alerts about new breaches.";
}
}
renderContentForUserWithLogins(monitorData) {
const storedEmail = this.doc.querySelector(
"span[data-type='stored-emails']"
);
const knownBreaches = this.doc.querySelector(
"span[data-type='known-breaches']"
);
const exposedPasswords = this.doc.querySelector(
"span[data-type='exposed-passwords']"
);
const exposedLockwisePasswords = this.doc.querySelector(
".number-of-breaches.block"
);
storedEmail.textContent = monitorData.monitoredEmails;
knownBreaches.textContent = monitorData.numBreaches;
exposedPasswords.textContent = monitorData.passwords;
exposedLockwisePasswords.textContent = monitorData.lockwisePasswords;
}
}

Просмотреть файл

@ -97,10 +97,26 @@ body[focuseddatatype=cryptominer] {
background-color: var(--blue-80);
}
.report-card.lockwise-card .card-header {
.report-card.lockwise-card .card-header,
.report-card.monitor-card.no-logins .card-header {
grid-template-columns: 2fr 6fr 7fr;
}
/* We want to hide certain components depending on its state. */
a.hidden,
.card-body.hidden,
.lockwise-card.hidden,
#lockwise-body-content .has-logins.hidden,
#lockwise-body-content .no-logins.hidden,
.monitor-card.hidden,
.monitor-card.no-logins .card-body,
.monitor-card.no-logins #monitor-header-content a,
.monitor-card.no-logins .inline-text-icon.monitor-scanned-text,
.monitor-card.has-logins #sign-up-for-monitor-button {
display: none;
}
.icon {
width: 60px;
height: 60px;
@ -116,6 +132,10 @@ body[focuseddatatype=cryptominer] {
background: url("chrome://browser/content/logos/lockwise.svg") no-repeat center/cover;
}
.monitor-card .icon {
background: url("chrome://browser/content/logos/monitor.svg") no-repeat center/cover;
}
.report-card {
display: grid;
grid-template-columns: 100%;
@ -389,13 +409,6 @@ label:hover {
grid-gap: 10px;
}
a.hidden,
.lockwise-card.hidden,
#lockwise-body-content .has-logins.hidden,
#lockwise-body-content .no-logins.hidden {
display: none;
}
.number-of-logins {
background-color: var(--dark-grey);
}
@ -404,7 +417,7 @@ a.hidden,
background-color: var(--orange);
}
.lockwise-text-icon {
.inline-text-icon {
background-size: 16px 16px;
background-repeat: no-repeat;
background-position-x: 3px;
@ -427,10 +440,6 @@ a.hidden,
background-image: url("chrome://browser/skin/sync.svg");
}
.non-logged-in-user-content {
grid-column: 2;
}
.block {
border-radius: 4px;
text-align: center;
@ -443,3 +452,108 @@ a.hidden,
#lockwise-body-content .has-logins a {
margin-inline-start: 10px;
}
/* Monitor card */
#monitor-body-content .monitor-breached-passwords {
grid: 1fr / minmax(70px, auto) 1fr;
grid-row: 3;
grid-column: span 3;
display: grid;
align-items: center;
font-size: 0.85rem;
border-top: var(--card-divider);
padding-top: 20px;
line-height: 18px;
grid-column-gap: 10px;
}
.monitor-scanned-text {
background-image: url("chrome://browser/skin/reload.svg");
font-size: 0.85rem;
}
.monitor-card #monitor-header-content > a {
display: block;
margin-block-start: 5px;
}
.monitor-card.has-logins #monitor-body-content {
display: grid;
grid: 2fr 1fr auto / repeat(3, 160px);
grid-column-gap: 12px;
align-items: center;
}
.monitor-block {
display: flex;
flex-direction: column;
border-radius: 4px;
color: #FFFFFF;
text-align: center;
padding: 25px 5px 25px 5px;
}
.email {
background: linear-gradient(162.33deg, #AB71FF 0%, #9059FF 100%);
}
.email .monitor-icon {
background-image: url(chrome://browser/skin/mail.svg);
}
.breaches {
background: linear-gradient(162.33deg, #9059FF 0%, #7542E5 100%);
}
.breaches .monitor-icon {
background-image: url(chrome://browser/skin/fxa/avatar.svg);
}
.passwords {
background: linear-gradient(162.33deg, #7542E5 0%, #592ACB 100%);
}
.passwords .monitor-icon {
background-image: url(chrome://browser/skin/login.svg);
}
.monitor-view-full-report {
grid-row: 2;
grid-column: span 2;
font-size: 0.85rem;
}
.monitor-stat {
display: flex;
font-size: 1.75rem;
font-weight: bold;
margin-block-end: 5px;
word-break: break-all;
justify-content: center;
flex-wrap: wrap;
}
.monitor-stat .monitor-icon {
background-size: 24px 24px;
background-repeat: no-repeat;
-moz-context-properties: fill,fill-opacity;
fill: white;
fill-opacity: 0.65;
width: 24px;
height: 24px;
display: block;
padding: 5px;
background-position-y: center;
}
.info-text {
font-size: .69rem;
line-height: 13px;
margin-block-start: 5px;
}
.number-of-breaches.block {
background-color: var(--orange);
padding: 15px;
}

Просмотреть файл

@ -14,6 +14,7 @@
<link rel="icon" href="chrome://global/skin/icons/warning.svg">
<script type="module" src="chrome://browser/content/protections.js"></script>
<script type="module" src="chrome://browser/content/lockwise-card.js"></script>
<script type="module" src="chrome://browser/content/monitor-card.js"></script>
<title>Protection Report</title>
</head>
@ -82,6 +83,75 @@
</div>
</div>
</div>
<!-- Markup for Monitor card. -->
<section class="report-card monitor-card hidden">
<div class="card-header">
<div class="icon"></div>
<div class="wrapper">
<h3 id="monitor-title" class="card-title">
Look out for data breaches
</h3>
<p id="monitor-header-content" class="content">
<span>
<!-- Insert Monitor header content here. -->
</span>
<a href="">How it works</a>
</p>
<span class="inline-text-icon monitor-scanned-text">
Automatically scanned today
</span>
</div>
<button id="sign-up-for-monitor-button">
<!-- Insert Monitor button content here. -->
</button>
</div>
<div class="card-body">
<div class="body-wrapper">
<div id="monitor-body-content">
<div class="monitor-block email">
<span class="monitor-stat">
<span class="monitor-icon"></span>
<span data-type="stored-emails">
<!-- Display number of stored emails here. -->
</span>
</span>
<span class="info-text">Email address being monitored</span>
</div>
<div class="monitor-block breaches">
<span class="monitor-stat">
<span class="monitor-icon"></span>
<span data-type="known-breaches">
<!-- Display number of known breaches here. -->
</span>
</span>
<span class="info-text">Known data breaches have exposed your information</span>
</div>
<div class="monitor-block passwords">
<span class="monitor-stat">
<span class="monitor-icon"></span>
<span data-type="exposed-passwords">
<!-- Display number of exposed passwords here. -->
</span>
</span>
<span class="info-text">Passwords exposed across all breaches</span>
</div>
<div class="monitor-view-full-report">
<span>View full report on</span>
<a href="">Firefox Monitor</a>
</div>
<div class="monitor-breached-passwords">
<span class="number-of-breaches block">
<!-- Display number of exposed stored passwords here. -->
</span>
<span class="">
Saved passwords have appeared in known data breaches. Change these passwords to protect your accounts.
<a href="">Open Lockwise</a>
</span>
</div>
</div>
</div>
</div>
</section>
<!-- Markup for Lockwise card. -->
<section class="report-card lockwise-card hidden">
<div class="card-header">
@ -109,14 +179,14 @@
<span class="number-of-logins block">
<!-- Display number of stored logins here. -->
</span>
<span class="lockwise-text-icon passwords-stored-text">
<span class="inline-text-icon passwords-stored-text">
Passwords stored securely.
<a href="">How it works</a>
</span>
<span class="number-of-synced-devices block">
<!-- Display number of synced devices here. -->
</span>
<span class="lockwise-text-icon synced-devices-text">
<span class="inline-text-icon synced-devices-text">
<span>
<!-- Display message for status of synced devices here. -->
</span>

Просмотреть файл

@ -5,6 +5,7 @@
/* eslint-env mozilla/frame-script */
import LockwiseCard from "./lockwise-card.js";
import MonitorCard from "./monitor-card.js";
document.addEventListener("DOMContentLoaded", e => {
let todayInMs = Date.now();
@ -28,8 +29,8 @@ document.addEventListener("DOMContentLoaded", e => {
RPMSendAsyncMessage("OpenContentBlockingPreferences");
});
// Check to see if displaying the Lockwise card pref is enabled.
RPMSendAsyncMessage("GetEnabledLockwiseCard");
// Get the display prefs for each component
RPMSendAsyncMessage("GetEnabledPrefs");
let createGraph = data => {
let dateInMS = data.earliestDate
@ -149,8 +150,20 @@ document.addEventListener("DOMContentLoaded", e => {
createGraph(message.data);
});
// Display Monitor card
RPMAddMessageListener("SendEnabledMonitorCardPref", message => {
if (message.data.isEnabled) {
const monitorCard = new MonitorCard(document);
monitorCard.init();
}
// For tests
const monitorUI = document.querySelector(".monitor-card");
monitorUI.dataset.enabled = message.data.isEnabled;
});
// Display Lockwise card
RPMAddMessageListener("SendEnabledLockWiseCardPref", message => {
RPMAddMessageListener("SendEnabledLockwiseCardPref", message => {
if (message.data.isEnabled) {
const lockwiseCard = new LockwiseCard(document);
lockwiseCard.init();
@ -160,4 +173,8 @@ document.addEventListener("DOMContentLoaded", e => {
const lockwiseUI = document.querySelector(".lockwise-card");
lockwiseUI.dataset.enabled = message.data.isEnabled;
});
// Dispatch messages to retrieve data for the Lockwise & Monitor
// cards.
RPMSendAsyncMessage("FetchUserLoginsData");
});

Просмотреть файл

@ -4,6 +4,7 @@
browser.jar:
content/browser/lockwise-card.js (content/lockwise-card.js)
content/browser/monitor-card.js (content/monitor-card.js)
content/browser/protections.css (content/protections.css)
content/browser/protections.html (content/protections.html)
content/browser/protections.js (content/protections.js)

Просмотреть файл

@ -4,4 +4,5 @@ support-files =
!/browser/base/content/test/trackingUI/trackingPage.html
[browser_protections_lockwise.js]
[browser_protections_monitor.js]
[browser_protections_report_ui.js]

Просмотреть файл

@ -37,12 +37,10 @@ const TEST_LOGIN2 = new nsLoginInfo(
// Modify AboutProtectionsHandler's getLoginData method to fake returning a specified
// number of devices.
const mockGetLoginDataWithSyncedDevices = deviceCount => async () => {
const loginCount = Services.logins.countLogins("", "", "");
return {
isLoggedIn: loginCount > 0 || deviceCount > 0,
numberOfLogins: loginCount,
numberOfSyncedDevices: deviceCount,
hasFxa: true,
numLogins: Services.logins.countLogins("", "", ""),
numSyncedDevices: deviceCount,
};
};
@ -56,7 +54,9 @@ add_task(async function() {
info("Check that the correct content is displayed for non-logged in users.");
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
await ContentTaskUtils.waitForCondition(() => {
const noLogins = content.document.querySelector(".no-logins");
const noLogins = content.document.querySelector(
"#lockwise-body-content .no-logins"
);
return ContentTaskUtils.is_visible(noLogins);
}, "Lockwise card for user with no logins is shown.");
@ -83,7 +83,9 @@ add_task(async function() {
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
await ContentTaskUtils.waitForCondition(() => {
const hasLogins = content.document.querySelector(".has-logins");
const hasLogins = content.document.querySelector(
"#lockwise-body-content .has-logins"
);
return ContentTaskUtils.is_visible(hasLogins);
}, "Lockwise card for user with logins is shown.");
@ -149,7 +151,9 @@ add_task(async function() {
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
await ContentTaskUtils.waitForCondition(() => {
const hasLogins = content.document.querySelector(".has-logins");
const hasLogins = content.document.querySelector(
"#lockwise-body-content .has-logins"
);
return ContentTaskUtils.is_visible(hasLogins);
}, "Lockwise card for user with logins is shown.");

Просмотреть файл

@ -0,0 +1,194 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { AboutProtectionsHandler } = ChromeUtils.import(
"resource:///modules/aboutpages/AboutProtectionsHandler.jsm"
);
const nsLoginInfo = new Components.Constructor(
"@mozilla.org/login-manager/loginInfo;1",
Ci.nsILoginInfo,
"init"
);
const TEST_LOGIN1 = new nsLoginInfo(
"https://example.com/",
"https://example.com/",
null,
"user1",
"pass1",
"username",
"password"
);
let fakeDataWithNoError = {
monitoredEmails: 1,
numBreaches: 11,
passwords: 8,
lockwisePasswords: 2,
error: false,
};
let fakeDataWithError = {
monitoredEmails: null,
numBreaches: null,
passwords: null,
lockwisePasswords: null,
error: true,
};
// Modify AboutProtectionsHandler's getMonitorData method to fake returning a specified
// number of devices.
const mockGetMonitorData = data => async () => data;
// Modify AboutProtectionsHandler's getLoginData method to fake being logged in with Fxa.
const mockGetLoginData = async () => {
return {
hasFxa: true,
numLogins: Services.logins.countLogins("", "", ""),
numSyncedDevices: 0,
};
};
add_task(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab({
url: "about:protections",
gBrowser,
});
const { getLoginData } = AboutProtectionsHandler;
const { getMonitorData } = AboutProtectionsHandler;
await reloadTab(tab);
info("Check that the correct content is displayed for users with no logins.");
await checkNoLoginsContentIsDisplayed(tab, "Sign up for Monitor");
info(
"Check that the correct content is displayed for users with monitor data."
);
Services.logins.addLogin(TEST_LOGIN1);
AboutProtectionsHandler.getMonitorData = mockGetMonitorData(
fakeDataWithNoError
);
await reloadTab(tab);
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
await ContentTaskUtils.waitForCondition(() => {
const noLogins = content.document.querySelector(
".monitor-card.has-logins"
);
return ContentTaskUtils.is_visible(noLogins);
}, "Monitor card for user with stored logins is shown.");
const hasLoginsHeaderContent = content.document.querySelector(
"#monitor-header-content span"
);
const cardBody = content.document.querySelector(".monitor-card .card-body");
ok(
ContentTaskUtils.is_visible(cardBody),
"Card body is shown for users monitor data."
);
is(
hasLoginsHeaderContent.textContent,
"Firefox Monitor warns you if your info has appeared in a known data breach",
"Header content for user with monitor data is correct"
);
info("Make sure correct numbers for monitor stats are displayed.");
const emails = content.document.querySelector(
".monitor-stat span[data-type='stored-emails']"
);
const passwords = content.document.querySelector(
".monitor-stat span[data-type='exposed-passwords']"
);
const breaches = content.document.querySelector(
".monitor-stat span[data-type='known-breaches']"
);
is(emails.textContent, 1, "1 monitored email is displayed");
is(passwords.textContent, 8, "8 exposed stored passwords is displayed");
is(breaches.textContent, 11, "11 known data breaches is displayed.");
});
info(
"Check that correct content is displayed when monitor data contains an error message."
);
AboutProtectionsHandler.getMonitorData = mockGetMonitorData(
fakeDataWithError
);
AboutProtectionsHandler.getLoginData = mockGetLoginData;
await reloadTab(tab);
await checkNoLoginsContentIsDisplayed(tab, "Turn on Monitor");
info("Disable showing the Monitor card.");
Services.prefs.setBoolPref(
"browser.contentblocking.report.monitor.enabled",
false
);
await reloadTab(tab);
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
await ContentTaskUtils.waitForCondition(() => {
const monitorCard = content.document.querySelector(".monitor-card");
return !monitorCard["data-enabled"];
}, "Monitor card is not enabled.");
const monitorCard = content.document.querySelector(".monitor-card");
ok(ContentTaskUtils.is_hidden(monitorCard), "Lockwise card is hidden.");
});
// set the pref back to displaying the card.
Services.prefs.setBoolPref(
"browser.contentblocking.report.monitor.enabled",
true
);
// remove logins
Services.logins.removeLogin(TEST_LOGIN1);
// restore original getLoginData & getMonitorData methods to AboutProtectionsHandler
AboutProtectionsHandler.getLoginData = getLoginData;
AboutProtectionsHandler.getMonitorData = getMonitorData;
await BrowserTestUtils.removeTab(tab);
});
async function checkNoLoginsContentIsDisplayed(tab, expectedButtonContent) {
await ContentTask.spawn(
tab.linkedBrowser,
{ buttonText: expectedButtonContent },
async function({ buttonText }) {
await ContentTaskUtils.waitForCondition(() => {
const noLogins = content.document.querySelector(
".monitor-card.no-logins"
);
return ContentTaskUtils.is_visible(noLogins);
}, "Monitor card for user with no logins is shown.");
const noLoginsHeaderContent = content.document.querySelector(
"#monitor-header-content span"
);
const cardBody = content.document.querySelector(
".monitor-card .card-body"
);
const button = content.document.getElementById(
"sign-up-for-monitor-button"
);
ok(
ContentTaskUtils.is_hidden(cardBody),
"Card body is hidden for users with no logins."
);
is(
noLoginsHeaderContent.textContent,
"Check Firefox Monitor to see if you've been part of a data breach and get alerts about new breaches.",
"Header content for user with no logins is correct"
);
is(button.textContent, buttonText, "Text content for button is correct");
}
);
}

Просмотреть файл

@ -59,8 +59,6 @@ class UrlbarInput {
// In the future this may be moved to the view, so it can customize
// the container element.
let MozXULElement = this.window.MozXULElement;
// TODO Bug 1535659: urlbarView-body-inner possibly doesn't need the
// role="combobox" once bug 1513337 is fixed.
this.document.getElementById("mainPopupSet").appendChild(
MozXULElement.parseXULToFragment(`
<panel id="urlbar-results"
@ -74,8 +72,7 @@ class UrlbarInput {
rolluponmousewheel="true"
level="parent">
<html:div class="urlbarView-body-outer">
<html:div class="urlbarView-body-inner"
role="combobox">
<html:div class="urlbarView-body-inner">
<html:div id="urlbarView-results"
role="listbox"/>
</html:div>

Просмотреть файл

@ -16,6 +16,10 @@ XPCOMUtils.defineLazyModuleGetters(this, {
AppConstants: "resource://gre/modules/AppConstants.jsm",
});
// Stale rows are removed on a timer with this timeout. Tests can override this
// by setting UrlbarView.removeStaleRowsTimeout.
const DEFAULT_REMOVE_STALE_ROWS_TIMEOUT = 400;
/**
* Receives and displays address bar autocomplete results.
*/
@ -719,7 +723,7 @@ class UrlbarView {
this._removeStaleRowsTimer = this.window.setTimeout(() => {
this._removeStaleRowsTimer = null;
this._removeStaleRows();
}, 400);
}, UrlbarView.removeStaleRowsTimeout);
}
_cancelRemoveStaleRowsTimer() {
@ -949,3 +953,5 @@ class UrlbarView {
this.close();
}
}
UrlbarView.removeStaleRowsTimeout = DEFAULT_REMOVE_STALE_ROWS_TIMEOUT;

Просмотреть файл

@ -95,6 +95,9 @@ support-files =
searchSuggestionEngine.sjs
[browser_selectionKeyNavigation.js]
[browser_selectStaleResults.js]
support-files =
searchSuggestionEngineSlow.xml
searchSuggestionEngine.sjs
[browser_stop_pending.js]
skip-if = fission
support-files =

Просмотреть файл

@ -7,6 +7,20 @@
"use strict";
XPCOMUtils.defineLazyModuleGetters(this, {
UrlbarView: "resource:///modules/UrlbarView.jsm",
});
add_task(async function init() {
// Increase the timeout of the remove-stale-rows timer so that it doesn't
// interfere with the tests.
let originalRemoveStaleRowsTimeout = UrlbarView.removeStaleRowsTimeout;
UrlbarView.removeStaleRowsTimeout = 1000;
registerCleanupFunction(() => {
UrlbarView.removeStaleRowsTimeout = originalRemoveStaleRowsTimeout;
});
});
// This tests the case where queryContext.results.length < the number of rows in
// the view, i.e., the view contains stale rows.
add_task(async function viewContainsStaleRows() {
@ -62,6 +76,7 @@ add_task(async function viewContainsStaleRows() {
// Type another "x" so that we search for "xx", but don't wait for the search
// to finish. Instead, wait for the row's stale attribute to be removed.
EventUtils.synthesizeKey("x");
info("Waiting for 'stale' attribute to be removed... ");
await mutationPromise;
// Now arrow down. The search, which is still ongoing, will now stop and the
@ -69,6 +84,7 @@ add_task(async function viewContainsStaleRows() {
EventUtils.synthesizeKey("KEY_ArrowDown");
// Wait for the search to stop.
info("Waiting for the search to stop... ");
await gURLBar.lastQueryContextPromise;
// The query context for the last search ("xx") should contain only
@ -130,8 +146,8 @@ add_task(async function staleReplacedWithFresh() {
//
// NB: If this test ends up failing, it may be because the remove-stale-rows
// timer fires before the history results are added. i.e., steps 2 and 3
// above happen out of order. If that happens, we'll need a way to force the
// timer not to fire until we want it to.
// above happen out of order. If that happens, try increasing
// UrlbarView.removeStaleRowsTimeout above.
await PlacesUtils.history.clear();
await PlacesUtils.bookmarks.eraseEverything();
@ -227,6 +243,7 @@ add_task(async function staleReplacedWithFresh() {
// Now type a "t" so that we search for "test", but only wait for history
// results to be added, as described above.
EventUtils.synthesizeKey("t");
info("Waiting for the 'test2' row... ");
await mutationPromise;
// Now arrow down. The search, which is still ongoing, will now stop and the
@ -234,6 +251,7 @@ add_task(async function staleReplacedWithFresh() {
EventUtils.synthesizeKey("KEY_ArrowDown");
// Wait for the search to stop.
info("Waiting for the search to stop... ");
await gURLBar.lastQueryContextPromise;
// Sanity check the results. They should be as described above.

Просмотреть файл

@ -14,6 +14,13 @@ function getInfoFrameScript(messageName) {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const PREVIEW_MAX_ITEMS = 10;
const LOG_LEVEL_MAP = {
0: "debug",
1: "info",
2: "warn",
3: "error",
};
function getInnerWindowId(window) {
return window.windowUtils.currentInnerWindowID;
@ -40,6 +47,70 @@ function getInfoFrameScript(messageName) {
.map(m => m.message);
}
function getPreview(value) {
switch (typeof value) {
case "function":
return "function ()";
case "object":
if (value === null) {
return null;
}
if (Array.isArray(value)) {
return `(${value.length})[...]`;
}
return "{...}";
case "undefined":
return "undefined";
default:
return value;
}
}
function getArrayPreview(arr) {
const preview = [];
for (const value of arr) {
preview.push(getPreview(value));
if (preview.length === PREVIEW_MAX_ITEMS) {
break;
}
}
return preview;
}
function getObjectPreview(obj) {
const preview = {};
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
preview[key] = getPreview(obj[key]);
}
if (Object.keys(preview).length === PREVIEW_MAX_ITEMS) {
break;
}
}
return preview;
}
function getArgs(value) {
if (typeof value === "object" && value !== null) {
if (Array.isArray(value)) {
return getArrayPreview(value);
}
return getObjectPreview(value);
}
return getPreview(value);
}
function getConsoleMessages(windowIds) {
const ConsoleAPIStorage = Cc[
"@mozilla.org/consoleAPI-storage;1"
@ -50,12 +121,15 @@ function getInfoFrameScript(messageName) {
}
return messages.map(evt => {
const { columnNumber, filename, level, lineNumber, timeStamp } = evt;
const args = evt.arguments
.map(arg => {
return "" + arg;
})
.join(", ");
const message = `[console.${level}(${args}) ${filename}:${lineNumber}:${columnNumber}]`;
const args = evt.arguments.map(getArgs);
const message = {
level,
log: args,
uri: filename,
pos: `${lineNumber}:${columnNumber}`,
};
return { timeStamp, message };
});
}
@ -81,7 +155,21 @@ function getInfoFrameScript(messageName) {
return false;
})
.map(error => {
const { timeStamp, message } = error;
const {
timeStamp,
errorMessage,
sourceName,
lineNumber,
columnNumber,
logLevel,
} = error;
const message = {
level: LOG_LEVEL_MAP[logLevel],
log: [errorMessage],
uri: sourceName,
pos: `${lineNumber}:${columnNumber}`,
};
return { timeStamp, message };
});
}

Просмотреть файл

@ -75,6 +75,8 @@ add_task(async function test_opened_page() {
let doc = content.document;
let urlParam = doc.getElementById("url").innerText;
let preview = doc.getElementById("screenshot-preview");
const URL =
"http://example.com/browser/browser/extensions/report-site-issue/test/browser/test.html";
is(
urlParam,
args.TEST_PAGE,
@ -105,24 +107,66 @@ add_task(async function test_opened_page() {
"Details param is a stringified JSON object."
);
ok(Array.isArray(details.consoleLog), "Details has a consoleLog array.");
ok(
details.consoleLog[0].match(
/console\.log\(null\)[\s\S]*test.html:\d+:\d+/m
),
"Can handle degenerate console logs"
const log1 = details.consoleLog[0];
ok(log1.log[0] === null, "Can handle degenerate console logs");
ok(log1.level === "log", "Reports correct log level");
ok(log1.uri === URL, "Reports correct url");
ok(log1.pos === "7:13", "Reports correct line and column");
const log2 = details.consoleLog[1];
ok(log2.log[0] === "colored message", "Can handle fancy console logs");
ok(log2.level === "error", "Reports correct log level");
ok(log2.uri === URL, "Reports correct url");
ok(log2.pos === "8:13", "Reports correct line and column");
const log3 = details.consoleLog[2];
const loggedObject = log3.log[0];
is(loggedObject.testobj, "{...}", "Reports object inside object");
is(loggedObject.testnumber, 1, "Reports number inside object");
is(loggedObject.testArray, "(4)[...]", "Reports array inside object");
is(loggedObject.testUndf, "undefined", "Reports undefined inside object");
is(loggedObject.testNull, null, "Reports null inside object");
is(
loggedObject.testFunc,
undefined,
"Reports function inside object as undefined due to security reasons"
);
ok(
details.consoleLog[1].match(
/console\.error\(colored message\)[\s\S]*test.html:\d+:\d+/m
),
"Can handle fancy console logs"
is(loggedObject.testString, "string", "Reports string inside object");
is(loggedObject.c, "{...}", "Reports circular reference inside object");
is(
Object.keys(loggedObject).length,
10,
"Preview has 10 keys inside object"
);
ok(log3.level === "log", "Reports correct log level");
ok(log3.uri === URL, "Reports correct url");
ok(log3.pos === "23:13", "Reports correct line and column");
const log4 = details.consoleLog[3];
const loggedArray = log4.log[0];
is(loggedArray[0], "string", "Reports string inside array");
is(loggedArray[1], "{...}", "Reports object inside array");
is(loggedArray[2], null, "Reports null inside array");
is(loggedArray[3], 90, "Reports number inside array");
is(loggedArray[4], "undefined", "Reports undefined inside array");
is(
loggedArray[5],
"undefined",
"Reports function inside array as undefined due to security reasons"
);
is(loggedArray[6], "(4)[...]", "Reports array inside array");
is(loggedArray[7], "(8)[...]", "Reports circular array inside array");
const log5 = details.consoleLog[4];
ok(
details.consoleLog[2].match(
/document\.access is undefined[\s\S]*test.html:\d+:\d+/m
),
log5.log[0] === "TypeError: document.access is undefined",
"Script errors are logged"
);
ok(log5.level === "error", "Reports correct log level");
ok(log5.uri === URL, "Reports correct url");
ok(log5.pos === "35:5", "Reports correct line and column");
ok(typeof details.buildID == "string", "Details has a buildID string.");
ok(typeof details.channel == "string", "Details has a channel string.");
ok(

Просмотреть файл

@ -1,12 +1,38 @@
<!DOCTYPE html>
<meta charset="utf-8">
<script>
/* eslint-disable no-console */
/* eslint-disable no-unused-expressions */
"use strict";
console.log(null);
console.error("%ccolored message", "background:green; color:white");
document.access.non.existent.property.to.trigger.error;
/* eslint-disable no-console */
/* eslint-disable no-unused-expressions */
"use strict";
console.log(null);
console.error("%ccolored message", "background:green; color:white");
const obj = {
testobj: {},
testnumber: 1,
testArray: [1, {}, 2, 555],
testUndf: undefined,
testNull: null,
testFunc() {},
testString: 'string',
prop1: 'prop1',
prop2: 'prop2'
};
obj.c = obj;
obj.prop3 = 'prop3';
obj.prop4 = 'prop4';
console.log(obj);
const arr = [
'string',
{test: 'obj'},
null,
90,
undefined,
function() {},
[1, {}, 2, 555]
];
arr.push(arr);
console.log(arr);
document.access.non.existent.property.to.trigger.error;
</script>
<style>
body {background: rgb(0, 128, 0);}

Просмотреть файл

@ -62,12 +62,6 @@ browser/chrome/devtools/skin/images/tool-storage.svg
browser/chrome/devtools/skin/images/tool-styleeditor.svg
browser/chrome/devtools/skin/promisedebugger.css
browser/chrome/devtools/skin/variables.css
modules/devtools/Console.jsm
modules/devtools/Loader.jsm
modules/devtools/shared/Console.jsm
modules/devtools/shared/Loader.jsm
browser/modules/devtools/client/framework/gDevTools.jsm
browser/modules/devtools/gDevTools.jsm
browser/chrome/icons/default/default16.png
browser/chrome/icons/default/default32.png
browser/chrome/icons/default/default48.png

Просмотреть файл

@ -6,12 +6,9 @@
"use strict";
const { gDevTools } = ChromeUtils.import(
"resource://devtools/client/framework/gDevTools.jsm"
);
const {
devtools: { TargetFactory },
} = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
const { TargetFactory } = require("devtools/client/framework/target");
const { gDevTools } = require("devtools/client/framework/devtools");
add_task(async function capture() {
if (!shouldCapture()) {

Просмотреть файл

@ -6,15 +6,12 @@
var EXPORTED_SYMBOLS = ["DevTools"];
const { gDevTools } = ChromeUtils.import(
"resource://devtools/client/framework/gDevTools.jsm"
);
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
const { TargetFactory } = require("devtools/client/framework/target");
const { gDevTools } = require("devtools/client/framework/devtools");
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm");
let { devtools } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
let TargetFactory = devtools.TargetFactory;
async function getTargetForSelectedTab() {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
let target = await TargetFactory.forTab(browserWindow.gBrowser.selectedTab);

Просмотреть файл

@ -290,6 +290,7 @@ WIN32_EXE_LDFLAGS += $(WIN32_CONSOLE_EXE_LDFLAGS)
endif
endif # WINNT
ifeq ($(OS_ARCH),WINNT)
ifneq (,$(filter msvc clang-cl,$(CC_TYPE)))
ifneq ($(CPU_ARCH),x86)
# Normal operation on 64-bit Windows needs 2 MB of stack. (Bug 582910)
@ -309,6 +310,13 @@ else
# layout/base/crashtests/507119.html (Bug 256180)
WIN32_EXE_LDFLAGS += -STACK:1572864
endif
else
ifneq ($(CPU_ARCH),x86)
MOZ_PROGRAM_LDFLAGS += -Wl,-Xlink=-STACK:8388608
else
MOZ_PROGRAM_LDFLAGS += -Wl,-Xlink=-STACK:1572864
endif
endif
endif
-include $(topsrcdir)/$(MOZ_BUILD_APP)/app-config.mk

Просмотреть файл

@ -934,21 +934,6 @@ endif
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
# MSYS has its own special path form, but javac expects the source and class
# paths to be in the DOS form (i.e. e:/builds/...). This function does the
# appropriate conversion on Windows, but is a noop on other systems.
ifeq ($(HOST_OS_ARCH),WINNT)
# We use 'pwd -W' to get DOS form of the path. However, since the given path
# could be a file or a non-existent path, we cannot call 'pwd -W' directly
# on the path. Instead, we extract the root path (i.e. "c:/"), call 'pwd -W'
# on it, then merge with the rest of the path.
root-path = $(shell echo $(1) | sed -e 's|\(/[^/]*\)/\?\(.*\)|\1|')
non-root-path = $(shell echo $(1) | sed -e 's|\(/[^/]*\)/\?\(.*\)|\2|')
normalizepath = $(foreach p,$(1),$(if $(filter /%,$(1)),$(patsubst %/,%,$(shell cd $(call root-path,$(1)) && pwd -W))/$(call non-root-path,$(1)),$(1)))
else
normalizepath = $(1)
endif
###############################################################################
# Bunch of things that extend the 'export' rule (in order):
###############################################################################

Просмотреть файл

@ -36,6 +36,17 @@ function recordEvent(method, details) {
// Add the session id to the event details.
const eventDetails = Object.assign({}, details, { session_id: sessionId });
telemetry.recordEvent(method, "aboutdebugging", null, eventDetails);
// For close and open events, also ping the regular telemetry helpers used
// for all DevTools UIs.
if (method === "open_adbg") {
telemetry.toolOpened("aboutdebugging", sessionId, window.AboutDebugging);
} else if (method === "close_adbg") {
// XXX: Note that aboutdebugging has no histogram created for
// TIME_ACTIVE_SECOND, so calling toolClosed will not actually
// record anything.
telemetry.toolClosed("aboutdebugging", sessionId, window.AboutDebugging);
}
}
const telemetryRuntimeIds = new Map();

Просмотреть файл

@ -15,7 +15,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -36,7 +36,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -57,7 +57,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -78,7 +78,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -99,7 +99,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -120,7 +120,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}
@ -141,7 +141,7 @@
"byName": {},
"byBlocks": {},
"usedIds": {
"0": 0
"1": 1
}
}
}

100
devtools/client/debugger/dist/parser-worker.js поставляемый
Просмотреть файл

@ -6597,27 +6597,27 @@ module.exports = {
/* 15 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
@ -7004,28 +7004,28 @@ module.exports = isObject;
/* 22 */
/***/ (function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
@ -17425,8 +17425,8 @@ function getFramework(symbols) {
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
function isReactComponent({ imports, classes, callExpressions }) {
return importsReact(imports) || requiresReact(callExpressions) || extendsReactComponent(classes);
function isReactComponent({ imports, classes, callExpressions, identifiers }) {
return importsReact(imports) || requiresReact(callExpressions) || extendsReactComponent(classes) || isReact(identifiers) || isRedux(identifiers);
}
function importsReact(imports) {
@ -17449,6 +17449,16 @@ function isVueComponent({ identifiers }) {
return identifiers.some(identifier => identifier.name == "Vue");
}
/* This identifies the react lib file */
function isReact(identifiers) {
return identifiers.some(identifier => identifier.name == "isReactComponent");
}
/* This identifies the redux lib file */
function isRedux(identifiers) {
return identifiers.some(identifier => identifier.name == "Redux");
}
/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {

Просмотреть файл

@ -17,7 +17,11 @@ module.exports = {
"package.json",
"<rootDir>/packages",
],
modulePathIgnorePatterns: ["test/mochitest", "firefox/"],
modulePathIgnorePatterns: [
"test/mochitest",
"<rootDir>/firefox/",
"<rootDir>/src/client/firefox/",
],
collectCoverageFrom: [
"src/**/*.js",
"!src/**/fixtures/*.js",

Просмотреть файл

@ -20,11 +20,13 @@ export function getFramework(symbols: SymbolDeclarations): ?string {
}
}
function isReactComponent({ imports, classes, callExpressions }) {
function isReactComponent({ imports, classes, callExpressions, identifiers }) {
return (
importsReact(imports) ||
requiresReact(callExpressions) ||
extendsReactComponent(classes)
extendsReactComponent(classes) ||
isReact(identifiers) ||
isRedux(identifiers)
);
}
@ -65,3 +67,13 @@ function isAngularComponent({ memberExpressions }) {
function isVueComponent({ identifiers }) {
return identifiers.some(identifier => identifier.name == "Vue");
}
/* This identifies the react lib file */
function isReact(identifiers) {
return identifiers.some(identifier => identifier.name == "isReactComponent");
}
/* This identifies the redux lib file */
function isRedux(identifiers) {
return identifiers.some(identifier => identifier.name == "Redux");
}

Просмотреть файл

@ -0,0 +1,19 @@
/**
* Base class helpers for the updating state of a component.
*/
function Component(props, context, updater) {
this.props = props;
this.context = context;
// If a component has string refs, we will assign a different object later.
this.refs = emptyObject;
// We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = updater || ReactNoopUpdateQueue;
}
Component.prototype.isReactComponent = {};
Component.prototype.setState = function (partialState, callback) {
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)
? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
this.updater.enqueueSetState(this, partialState, callback, 'setState');
};

Просмотреть файл

@ -0,0 +1,39 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.Redux = {})));
}(this, (function (exports) { 'use strict';
function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
}
/* global window */
var root;
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global !== 'undefined') {
root = global;
} else if (typeof module !== 'undefined') {
root = module;
} else {
root = Function('return this')();
}

Просмотреть файл

@ -51,5 +51,15 @@ cases(
file: "frameworks/vueFileComponent",
value: "Vue",
},
{
name: "recognizes the react library file",
file: "framework/reactLibrary",
value: "React",
},
{
name: "recognizes the redux library file",
file: "framework/reduxLibrary",
value: "React",
},
]
);

Просмотреть файл

@ -3,678 +3,12 @@ tags = devtools
subsuite = devtools
skip-if = (os == 'linux' && debug && bits == 32)
support-files =
examples/*
head.js
helpers.js
helpers/context.js
!/devtools/client/shared/test/shared-head.js
!/devtools/client/shared/test/telemetry-test-helpers.js
## START-SOURCEMAPPED-FIXTURES - Generated by examples/sourcemapped/build.js
examples/sourcemapped/polyfill-bundle.js
examples/sourcemapped/output/parcel/babel-bindings-with-flow.js
examples/sourcemapped/output/parcel/babel-bindings-with-flow.map
examples/sourcemapped/output/parcel/babel-classes.js
examples/sourcemapped/output/parcel/babel-classes.map
examples/sourcemapped/output/parcel/babel-flowtype-bindings.js
examples/sourcemapped/output/parcel/babel-flowtype-bindings.map
examples/sourcemapped/output/parcel/classes.js
examples/sourcemapped/output/parcel/classes.map
examples/sourcemapped/output/parcel/esmodules.js
examples/sourcemapped/output/parcel/esmodules.map
examples/sourcemapped/output/parcel/esmodules-cjs.js
examples/sourcemapped/output/parcel/esmodules-cjs.map
examples/sourcemapped/output/parcel/esmodules-es6.js
examples/sourcemapped/output/parcel/esmodules-es6.map
examples/sourcemapped/output/parcel/eval-maps.js
examples/sourcemapped/output/parcel/eval-maps.map
examples/sourcemapped/output/parcel/for-loops.js
examples/sourcemapped/output/parcel/for-loops.map
examples/sourcemapped/output/parcel/for-of.js
examples/sourcemapped/output/parcel/for-of.map
examples/sourcemapped/output/parcel/functions.js
examples/sourcemapped/output/parcel/functions.map
examples/sourcemapped/output/parcel/lex-and-nonlex.js
examples/sourcemapped/output/parcel/lex-and-nonlex.map
examples/sourcemapped/output/parcel/line-start-bindings-es6.js
examples/sourcemapped/output/parcel/line-start-bindings-es6.map
examples/sourcemapped/output/parcel/modules-cjs.js
examples/sourcemapped/output/parcel/modules-cjs.map
examples/sourcemapped/output/parcel/out-of-order-declarations-cjs.js
examples/sourcemapped/output/parcel/out-of-order-declarations-cjs.map
examples/sourcemapped/output/parcel/shadowed-vars.js
examples/sourcemapped/output/parcel/shadowed-vars.map
examples/sourcemapped/output/parcel/step-over-for-of.js
examples/sourcemapped/output/parcel/step-over-for-of.map
examples/sourcemapped/output/parcel/step-over-for-of-array.js
examples/sourcemapped/output/parcel/step-over-for-of-array.map
examples/sourcemapped/output/parcel/step-over-for-of-array-closure.js
examples/sourcemapped/output/parcel/step-over-for-of-array-closure.map
examples/sourcemapped/output/parcel/step-over-for-of-closure.js
examples/sourcemapped/output/parcel/step-over-for-of-closure.map
examples/sourcemapped/output/parcel/step-over-function-params.js
examples/sourcemapped/output/parcel/step-over-function-params.map
examples/sourcemapped/output/parcel/step-over-regenerator-await.js
examples/sourcemapped/output/parcel/step-over-regenerator-await.map
examples/sourcemapped/output/parcel/switches.js
examples/sourcemapped/output/parcel/switches.map
examples/sourcemapped/output/parcel/this-arguments-bindings.js
examples/sourcemapped/output/parcel/this-arguments-bindings.map
examples/sourcemapped/output/parcel/try-catches.js
examples/sourcemapped/output/parcel/try-catches.map
examples/sourcemapped/output/parcel/type-module.js
examples/sourcemapped/output/parcel/type-module.map
examples/sourcemapped/output/parcel/type-script-cjs.js
examples/sourcemapped/output/parcel/type-script-cjs.map
examples/sourcemapped/output/parcel/typescript-classes.js
examples/sourcemapped/output/parcel/typescript-classes.map
examples/sourcemapped/output/parcel/webpack-functions.js
examples/sourcemapped/output/parcel/webpack-functions.map
examples/sourcemapped/output/parcel/webpack-line-mappings.js
examples/sourcemapped/output/parcel/webpack-line-mappings.map
examples/sourcemapped/output/webpack3/classes.js
examples/sourcemapped/output/webpack3/classes.js.map
examples/sourcemapped/output/webpack3/esmodules.js
examples/sourcemapped/output/webpack3/esmodules.js.map
examples/sourcemapped/output/webpack3/esmodules-cjs.js
examples/sourcemapped/output/webpack3/esmodules-cjs.js.map
examples/sourcemapped/output/webpack3/esmodules-es6.js
examples/sourcemapped/output/webpack3/esmodules-es6.js.map
examples/sourcemapped/output/webpack3/eval-maps.js
examples/sourcemapped/output/webpack3/eval-maps.js.map
examples/sourcemapped/output/webpack3/for-loops.js
examples/sourcemapped/output/webpack3/for-loops.js.map
examples/sourcemapped/output/webpack3/for-of.js
examples/sourcemapped/output/webpack3/for-of.js.map
examples/sourcemapped/output/webpack3/functions.js
examples/sourcemapped/output/webpack3/functions.js.map
examples/sourcemapped/output/webpack3/lex-and-nonlex.js
examples/sourcemapped/output/webpack3/lex-and-nonlex.js.map
examples/sourcemapped/output/webpack3/line-start-bindings-es6.js
examples/sourcemapped/output/webpack3/line-start-bindings-es6.js.map
examples/sourcemapped/output/webpack3/modules-cjs.js
examples/sourcemapped/output/webpack3/modules-cjs.js.map
examples/sourcemapped/output/webpack3/out-of-order-declarations-cjs.js
examples/sourcemapped/output/webpack3/out-of-order-declarations-cjs.js.map
examples/sourcemapped/output/webpack3/shadowed-vars.js
examples/sourcemapped/output/webpack3/shadowed-vars.js.map
examples/sourcemapped/output/webpack3/step-over-for-of.js
examples/sourcemapped/output/webpack3/step-over-for-of.js.map
examples/sourcemapped/output/webpack3/step-over-for-of-array.js
examples/sourcemapped/output/webpack3/step-over-for-of-array.js.map
examples/sourcemapped/output/webpack3/step-over-for-of-array-closure.js
examples/sourcemapped/output/webpack3/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/webpack3/step-over-for-of-closure.js
examples/sourcemapped/output/webpack3/step-over-for-of-closure.js.map
examples/sourcemapped/output/webpack3/step-over-function-params.js
examples/sourcemapped/output/webpack3/step-over-function-params.js.map
examples/sourcemapped/output/webpack3/step-over-regenerator-await.js
examples/sourcemapped/output/webpack3/step-over-regenerator-await.js.map
examples/sourcemapped/output/webpack3/switches.js
examples/sourcemapped/output/webpack3/switches.js.map
examples/sourcemapped/output/webpack3/this-arguments-bindings.js
examples/sourcemapped/output/webpack3/this-arguments-bindings.js.map
examples/sourcemapped/output/webpack3/try-catches.js
examples/sourcemapped/output/webpack3/try-catches.js.map
examples/sourcemapped/output/webpack3/type-module.js
examples/sourcemapped/output/webpack3/type-module.js.map
examples/sourcemapped/output/webpack3/type-script-cjs.js
examples/sourcemapped/output/webpack3/type-script-cjs.js.map
examples/sourcemapped/output/webpack3/typescript-classes.js
examples/sourcemapped/output/webpack3/typescript-classes.js.map
examples/sourcemapped/output/webpack3/webpack-functions.js
examples/sourcemapped/output/webpack3/webpack-functions.js.map
examples/sourcemapped/output/webpack3/webpack-line-mappings.js
examples/sourcemapped/output/webpack3/webpack-line-mappings.js.map
examples/sourcemapped/output/webpack3-babel6/babel-bindings-with-flow.js
examples/sourcemapped/output/webpack3-babel6/babel-bindings-with-flow.js.map
examples/sourcemapped/output/webpack3-babel6/babel-classes.js
examples/sourcemapped/output/webpack3-babel6/babel-classes.js.map
examples/sourcemapped/output/webpack3-babel6/babel-flowtype-bindings.js
examples/sourcemapped/output/webpack3-babel6/babel-flowtype-bindings.js.map
examples/sourcemapped/output/webpack3-babel6/classes.js
examples/sourcemapped/output/webpack3-babel6/classes.js.map
examples/sourcemapped/output/webpack3-babel6/esmodules.js
examples/sourcemapped/output/webpack3-babel6/esmodules.js.map
examples/sourcemapped/output/webpack3-babel6/esmodules-cjs.js
examples/sourcemapped/output/webpack3-babel6/esmodules-cjs.js.map
examples/sourcemapped/output/webpack3-babel6/esmodules-es6.js
examples/sourcemapped/output/webpack3-babel6/esmodules-es6.js.map
examples/sourcemapped/output/webpack3-babel6/eval-maps.js
examples/sourcemapped/output/webpack3-babel6/eval-maps.js.map
examples/sourcemapped/output/webpack3-babel6/for-loops.js
examples/sourcemapped/output/webpack3-babel6/for-loops.js.map
examples/sourcemapped/output/webpack3-babel6/for-of.js
examples/sourcemapped/output/webpack3-babel6/for-of.js.map
examples/sourcemapped/output/webpack3-babel6/functions.js
examples/sourcemapped/output/webpack3-babel6/functions.js.map
examples/sourcemapped/output/webpack3-babel6/lex-and-nonlex.js
examples/sourcemapped/output/webpack3-babel6/lex-and-nonlex.js.map
examples/sourcemapped/output/webpack3-babel6/line-start-bindings-es6.js
examples/sourcemapped/output/webpack3-babel6/line-start-bindings-es6.js.map
examples/sourcemapped/output/webpack3-babel6/modules-cjs.js
examples/sourcemapped/output/webpack3-babel6/modules-cjs.js.map
examples/sourcemapped/output/webpack3-babel6/out-of-order-declarations-cjs.js
examples/sourcemapped/output/webpack3-babel6/out-of-order-declarations-cjs.js.map
examples/sourcemapped/output/webpack3-babel6/shadowed-vars.js
examples/sourcemapped/output/webpack3-babel6/shadowed-vars.js.map
examples/sourcemapped/output/webpack3-babel6/step-over-for-of.js
examples/sourcemapped/output/webpack3-babel6/step-over-for-of.js.map
examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array.js
examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array.js.map
examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array-closure.js
examples/sourcemapped/output/webpack3-babel6/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/webpack3-babel6/step-over-for-of-closure.js
examples/sourcemapped/output/webpack3-babel6/step-over-for-of-closure.js.map
examples/sourcemapped/output/webpack3-babel6/step-over-function-params.js
examples/sourcemapped/output/webpack3-babel6/step-over-function-params.js.map
examples/sourcemapped/output/webpack3-babel6/step-over-regenerator-await.js
examples/sourcemapped/output/webpack3-babel6/step-over-regenerator-await.js.map
examples/sourcemapped/output/webpack3-babel6/switches.js
examples/sourcemapped/output/webpack3-babel6/switches.js.map
examples/sourcemapped/output/webpack3-babel6/this-arguments-bindings.js
examples/sourcemapped/output/webpack3-babel6/this-arguments-bindings.js.map
examples/sourcemapped/output/webpack3-babel6/try-catches.js
examples/sourcemapped/output/webpack3-babel6/try-catches.js.map
examples/sourcemapped/output/webpack3-babel6/type-module.js
examples/sourcemapped/output/webpack3-babel6/type-module.js.map
examples/sourcemapped/output/webpack3-babel6/type-script-cjs.js
examples/sourcemapped/output/webpack3-babel6/type-script-cjs.js.map
examples/sourcemapped/output/webpack3-babel6/webpack-functions.js
examples/sourcemapped/output/webpack3-babel6/webpack-functions.js.map
examples/sourcemapped/output/webpack3-babel6/webpack-line-mappings.js
examples/sourcemapped/output/webpack3-babel6/webpack-line-mappings.js.map
examples/sourcemapped/output/webpack3-babel7/babel-bindings-with-flow.js
examples/sourcemapped/output/webpack3-babel7/babel-bindings-with-flow.js.map
examples/sourcemapped/output/webpack3-babel7/babel-classes.js
examples/sourcemapped/output/webpack3-babel7/babel-classes.js.map
examples/sourcemapped/output/webpack3-babel7/babel-flowtype-bindings.js
examples/sourcemapped/output/webpack3-babel7/babel-flowtype-bindings.js.map
examples/sourcemapped/output/webpack3-babel7/classes.js
examples/sourcemapped/output/webpack3-babel7/classes.js.map
examples/sourcemapped/output/webpack3-babel7/esmodules.js
examples/sourcemapped/output/webpack3-babel7/esmodules.js.map
examples/sourcemapped/output/webpack3-babel7/esmodules-cjs.js
examples/sourcemapped/output/webpack3-babel7/esmodules-cjs.js.map
examples/sourcemapped/output/webpack3-babel7/esmodules-es6.js
examples/sourcemapped/output/webpack3-babel7/esmodules-es6.js.map
examples/sourcemapped/output/webpack3-babel7/eval-maps.js
examples/sourcemapped/output/webpack3-babel7/eval-maps.js.map
examples/sourcemapped/output/webpack3-babel7/for-loops.js
examples/sourcemapped/output/webpack3-babel7/for-loops.js.map
examples/sourcemapped/output/webpack3-babel7/for-of.js
examples/sourcemapped/output/webpack3-babel7/for-of.js.map
examples/sourcemapped/output/webpack3-babel7/functions.js
examples/sourcemapped/output/webpack3-babel7/functions.js.map
examples/sourcemapped/output/webpack3-babel7/lex-and-nonlex.js
examples/sourcemapped/output/webpack3-babel7/lex-and-nonlex.js.map
examples/sourcemapped/output/webpack3-babel7/line-start-bindings-es6.js
examples/sourcemapped/output/webpack3-babel7/line-start-bindings-es6.js.map
examples/sourcemapped/output/webpack3-babel7/modules-cjs.js
examples/sourcemapped/output/webpack3-babel7/modules-cjs.js.map
examples/sourcemapped/output/webpack3-babel7/out-of-order-declarations-cjs.js
examples/sourcemapped/output/webpack3-babel7/out-of-order-declarations-cjs.js.map
examples/sourcemapped/output/webpack3-babel7/shadowed-vars.js
examples/sourcemapped/output/webpack3-babel7/shadowed-vars.js.map
examples/sourcemapped/output/webpack3-babel7/step-over-for-of.js
examples/sourcemapped/output/webpack3-babel7/step-over-for-of.js.map
examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array.js
examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array.js.map
examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array-closure.js
examples/sourcemapped/output/webpack3-babel7/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/webpack3-babel7/step-over-for-of-closure.js
examples/sourcemapped/output/webpack3-babel7/step-over-for-of-closure.js.map
examples/sourcemapped/output/webpack3-babel7/step-over-function-params.js
examples/sourcemapped/output/webpack3-babel7/step-over-function-params.js.map
examples/sourcemapped/output/webpack3-babel7/step-over-regenerator-await.js
examples/sourcemapped/output/webpack3-babel7/step-over-regenerator-await.js.map
examples/sourcemapped/output/webpack3-babel7/switches.js
examples/sourcemapped/output/webpack3-babel7/switches.js.map
examples/sourcemapped/output/webpack3-babel7/this-arguments-bindings.js
examples/sourcemapped/output/webpack3-babel7/this-arguments-bindings.js.map
examples/sourcemapped/output/webpack3-babel7/try-catches.js
examples/sourcemapped/output/webpack3-babel7/try-catches.js.map
examples/sourcemapped/output/webpack3-babel7/type-module.js
examples/sourcemapped/output/webpack3-babel7/type-module.js.map
examples/sourcemapped/output/webpack3-babel7/type-script-cjs.js
examples/sourcemapped/output/webpack3-babel7/type-script-cjs.js.map
examples/sourcemapped/output/webpack3-babel7/webpack-functions.js
examples/sourcemapped/output/webpack3-babel7/webpack-functions.js.map
examples/sourcemapped/output/webpack3-babel7/webpack-line-mappings.js
examples/sourcemapped/output/webpack3-babel7/webpack-line-mappings.js.map
examples/sourcemapped/output/webpack4/classes.js
examples/sourcemapped/output/webpack4/classes.js.map
examples/sourcemapped/output/webpack4/esmodules.js
examples/sourcemapped/output/webpack4/esmodules.js.map
examples/sourcemapped/output/webpack4/esmodules-cjs.js
examples/sourcemapped/output/webpack4/esmodules-cjs.js.map
examples/sourcemapped/output/webpack4/esmodules-es6.js
examples/sourcemapped/output/webpack4/esmodules-es6.js.map
examples/sourcemapped/output/webpack4/eval-maps.js
examples/sourcemapped/output/webpack4/eval-maps.js.map
examples/sourcemapped/output/webpack4/for-loops.js
examples/sourcemapped/output/webpack4/for-loops.js.map
examples/sourcemapped/output/webpack4/for-of.js
examples/sourcemapped/output/webpack4/for-of.js.map
examples/sourcemapped/output/webpack4/functions.js
examples/sourcemapped/output/webpack4/functions.js.map
examples/sourcemapped/output/webpack4/lex-and-nonlex.js
examples/sourcemapped/output/webpack4/lex-and-nonlex.js.map
examples/sourcemapped/output/webpack4/line-start-bindings-es6.js
examples/sourcemapped/output/webpack4/line-start-bindings-es6.js.map
examples/sourcemapped/output/webpack4/modules-cjs.js
examples/sourcemapped/output/webpack4/modules-cjs.js.map
examples/sourcemapped/output/webpack4/out-of-order-declarations-cjs.js
examples/sourcemapped/output/webpack4/out-of-order-declarations-cjs.js.map
examples/sourcemapped/output/webpack4/shadowed-vars.js
examples/sourcemapped/output/webpack4/shadowed-vars.js.map
examples/sourcemapped/output/webpack4/step-over-for-of.js
examples/sourcemapped/output/webpack4/step-over-for-of.js.map
examples/sourcemapped/output/webpack4/step-over-for-of-array.js
examples/sourcemapped/output/webpack4/step-over-for-of-array.js.map
examples/sourcemapped/output/webpack4/step-over-for-of-array-closure.js
examples/sourcemapped/output/webpack4/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/webpack4/step-over-for-of-closure.js
examples/sourcemapped/output/webpack4/step-over-for-of-closure.js.map
examples/sourcemapped/output/webpack4/step-over-function-params.js
examples/sourcemapped/output/webpack4/step-over-function-params.js.map
examples/sourcemapped/output/webpack4/step-over-regenerator-await.js
examples/sourcemapped/output/webpack4/step-over-regenerator-await.js.map
examples/sourcemapped/output/webpack4/switches.js
examples/sourcemapped/output/webpack4/switches.js.map
examples/sourcemapped/output/webpack4/this-arguments-bindings.js
examples/sourcemapped/output/webpack4/this-arguments-bindings.js.map
examples/sourcemapped/output/webpack4/try-catches.js
examples/sourcemapped/output/webpack4/try-catches.js.map
examples/sourcemapped/output/webpack4/type-module.js
examples/sourcemapped/output/webpack4/type-module.js.map
examples/sourcemapped/output/webpack4/type-script-cjs.js
examples/sourcemapped/output/webpack4/type-script-cjs.js.map
examples/sourcemapped/output/webpack4/typescript-classes.js
examples/sourcemapped/output/webpack4/typescript-classes.js.map
examples/sourcemapped/output/webpack4/webpack-functions.js
examples/sourcemapped/output/webpack4/webpack-functions.js.map
examples/sourcemapped/output/webpack4/webpack-line-mappings.js
examples/sourcemapped/output/webpack4/webpack-line-mappings.js.map
examples/sourcemapped/output/webpack4-babel6/babel-bindings-with-flow.js
examples/sourcemapped/output/webpack4-babel6/babel-bindings-with-flow.js.map
examples/sourcemapped/output/webpack4-babel6/babel-classes.js
examples/sourcemapped/output/webpack4-babel6/babel-classes.js.map
examples/sourcemapped/output/webpack4-babel6/babel-flowtype-bindings.js
examples/sourcemapped/output/webpack4-babel6/babel-flowtype-bindings.js.map
examples/sourcemapped/output/webpack4-babel6/classes.js
examples/sourcemapped/output/webpack4-babel6/classes.js.map
examples/sourcemapped/output/webpack4-babel6/esmodules.js
examples/sourcemapped/output/webpack4-babel6/esmodules.js.map
examples/sourcemapped/output/webpack4-babel6/esmodules-cjs.js
examples/sourcemapped/output/webpack4-babel6/esmodules-cjs.js.map
examples/sourcemapped/output/webpack4-babel6/esmodules-es6.js
examples/sourcemapped/output/webpack4-babel6/esmodules-es6.js.map
examples/sourcemapped/output/webpack4-babel6/eval-maps.js
examples/sourcemapped/output/webpack4-babel6/eval-maps.js.map
examples/sourcemapped/output/webpack4-babel6/for-loops.js
examples/sourcemapped/output/webpack4-babel6/for-loops.js.map
examples/sourcemapped/output/webpack4-babel6/for-of.js
examples/sourcemapped/output/webpack4-babel6/for-of.js.map
examples/sourcemapped/output/webpack4-babel6/functions.js
examples/sourcemapped/output/webpack4-babel6/functions.js.map
examples/sourcemapped/output/webpack4-babel6/lex-and-nonlex.js
examples/sourcemapped/output/webpack4-babel6/lex-and-nonlex.js.map
examples/sourcemapped/output/webpack4-babel6/line-start-bindings-es6.js
examples/sourcemapped/output/webpack4-babel6/line-start-bindings-es6.js.map
examples/sourcemapped/output/webpack4-babel6/modules-cjs.js
examples/sourcemapped/output/webpack4-babel6/modules-cjs.js.map
examples/sourcemapped/output/webpack4-babel6/out-of-order-declarations-cjs.js
examples/sourcemapped/output/webpack4-babel6/out-of-order-declarations-cjs.js.map
examples/sourcemapped/output/webpack4-babel6/shadowed-vars.js
examples/sourcemapped/output/webpack4-babel6/shadowed-vars.js.map
examples/sourcemapped/output/webpack4-babel6/step-over-for-of.js
examples/sourcemapped/output/webpack4-babel6/step-over-for-of.js.map
examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array.js
examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array.js.map
examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array-closure.js
examples/sourcemapped/output/webpack4-babel6/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/webpack4-babel6/step-over-for-of-closure.js
examples/sourcemapped/output/webpack4-babel6/step-over-for-of-closure.js.map
examples/sourcemapped/output/webpack4-babel6/step-over-function-params.js
examples/sourcemapped/output/webpack4-babel6/step-over-function-params.js.map
examples/sourcemapped/output/webpack4-babel6/step-over-regenerator-await.js
examples/sourcemapped/output/webpack4-babel6/step-over-regenerator-await.js.map
examples/sourcemapped/output/webpack4-babel6/switches.js
examples/sourcemapped/output/webpack4-babel6/switches.js.map
examples/sourcemapped/output/webpack4-babel6/this-arguments-bindings.js
examples/sourcemapped/output/webpack4-babel6/this-arguments-bindings.js.map
examples/sourcemapped/output/webpack4-babel6/try-catches.js
examples/sourcemapped/output/webpack4-babel6/try-catches.js.map
examples/sourcemapped/output/webpack4-babel6/type-module.js
examples/sourcemapped/output/webpack4-babel6/type-module.js.map
examples/sourcemapped/output/webpack4-babel6/type-script-cjs.js
examples/sourcemapped/output/webpack4-babel6/type-script-cjs.js.map
examples/sourcemapped/output/webpack4-babel6/webpack-functions.js
examples/sourcemapped/output/webpack4-babel6/webpack-functions.js.map
examples/sourcemapped/output/webpack4-babel6/webpack-line-mappings.js
examples/sourcemapped/output/webpack4-babel6/webpack-line-mappings.js.map
examples/sourcemapped/output/webpack4-babel7/babel-bindings-with-flow.js
examples/sourcemapped/output/webpack4-babel7/babel-bindings-with-flow.js.map
examples/sourcemapped/output/webpack4-babel7/babel-classes.js
examples/sourcemapped/output/webpack4-babel7/babel-classes.js.map
examples/sourcemapped/output/webpack4-babel7/babel-flowtype-bindings.js
examples/sourcemapped/output/webpack4-babel7/babel-flowtype-bindings.js.map
examples/sourcemapped/output/webpack4-babel7/classes.js
examples/sourcemapped/output/webpack4-babel7/classes.js.map
examples/sourcemapped/output/webpack4-babel7/esmodules.js
examples/sourcemapped/output/webpack4-babel7/esmodules.js.map
examples/sourcemapped/output/webpack4-babel7/esmodules-cjs.js
examples/sourcemapped/output/webpack4-babel7/esmodules-cjs.js.map
examples/sourcemapped/output/webpack4-babel7/esmodules-es6.js
examples/sourcemapped/output/webpack4-babel7/esmodules-es6.js.map
examples/sourcemapped/output/webpack4-babel7/eval-maps.js
examples/sourcemapped/output/webpack4-babel7/eval-maps.js.map
examples/sourcemapped/output/webpack4-babel7/for-loops.js
examples/sourcemapped/output/webpack4-babel7/for-loops.js.map
examples/sourcemapped/output/webpack4-babel7/for-of.js
examples/sourcemapped/output/webpack4-babel7/for-of.js.map
examples/sourcemapped/output/webpack4-babel7/functions.js
examples/sourcemapped/output/webpack4-babel7/functions.js.map
examples/sourcemapped/output/webpack4-babel7/lex-and-nonlex.js
examples/sourcemapped/output/webpack4-babel7/lex-and-nonlex.js.map
examples/sourcemapped/output/webpack4-babel7/line-start-bindings-es6.js
examples/sourcemapped/output/webpack4-babel7/line-start-bindings-es6.js.map
examples/sourcemapped/output/webpack4-babel7/modules-cjs.js
examples/sourcemapped/output/webpack4-babel7/modules-cjs.js.map
examples/sourcemapped/output/webpack4-babel7/out-of-order-declarations-cjs.js
examples/sourcemapped/output/webpack4-babel7/out-of-order-declarations-cjs.js.map
examples/sourcemapped/output/webpack4-babel7/shadowed-vars.js
examples/sourcemapped/output/webpack4-babel7/shadowed-vars.js.map
examples/sourcemapped/output/webpack4-babel7/step-over-for-of.js
examples/sourcemapped/output/webpack4-babel7/step-over-for-of.js.map
examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array.js
examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array.js.map
examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array-closure.js
examples/sourcemapped/output/webpack4-babel7/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/webpack4-babel7/step-over-for-of-closure.js
examples/sourcemapped/output/webpack4-babel7/step-over-for-of-closure.js.map
examples/sourcemapped/output/webpack4-babel7/step-over-function-params.js
examples/sourcemapped/output/webpack4-babel7/step-over-function-params.js.map
examples/sourcemapped/output/webpack4-babel7/step-over-regenerator-await.js
examples/sourcemapped/output/webpack4-babel7/step-over-regenerator-await.js.map
examples/sourcemapped/output/webpack4-babel7/switches.js
examples/sourcemapped/output/webpack4-babel7/switches.js.map
examples/sourcemapped/output/webpack4-babel7/this-arguments-bindings.js
examples/sourcemapped/output/webpack4-babel7/this-arguments-bindings.js.map
examples/sourcemapped/output/webpack4-babel7/try-catches.js
examples/sourcemapped/output/webpack4-babel7/try-catches.js.map
examples/sourcemapped/output/webpack4-babel7/type-module.js
examples/sourcemapped/output/webpack4-babel7/type-module.js.map
examples/sourcemapped/output/webpack4-babel7/type-script-cjs.js
examples/sourcemapped/output/webpack4-babel7/type-script-cjs.js.map
examples/sourcemapped/output/webpack4-babel7/webpack-functions.js
examples/sourcemapped/output/webpack4-babel7/webpack-functions.js.map
examples/sourcemapped/output/webpack4-babel7/webpack-line-mappings.js
examples/sourcemapped/output/webpack4-babel7/webpack-line-mappings.js.map
examples/sourcemapped/output/rollup/classes.js
examples/sourcemapped/output/rollup/classes.js.map
examples/sourcemapped/output/rollup/esmodules.js
examples/sourcemapped/output/rollup/esmodules.js.map
examples/sourcemapped/output/rollup/esmodules-es6.js
examples/sourcemapped/output/rollup/esmodules-es6.js.map
examples/sourcemapped/output/rollup/eval-maps.js
examples/sourcemapped/output/rollup/eval-maps.js.map
examples/sourcemapped/output/rollup/for-loops.js
examples/sourcemapped/output/rollup/for-loops.js.map
examples/sourcemapped/output/rollup/for-of.js
examples/sourcemapped/output/rollup/for-of.js.map
examples/sourcemapped/output/rollup/functions.js
examples/sourcemapped/output/rollup/functions.js.map
examples/sourcemapped/output/rollup/lex-and-nonlex.js
examples/sourcemapped/output/rollup/lex-and-nonlex.js.map
examples/sourcemapped/output/rollup/line-start-bindings-es6.js
examples/sourcemapped/output/rollup/line-start-bindings-es6.js.map
examples/sourcemapped/output/rollup/shadowed-vars.js
examples/sourcemapped/output/rollup/shadowed-vars.js.map
examples/sourcemapped/output/rollup/step-over-for-of.js
examples/sourcemapped/output/rollup/step-over-for-of.js.map
examples/sourcemapped/output/rollup/step-over-for-of-array.js
examples/sourcemapped/output/rollup/step-over-for-of-array.js.map
examples/sourcemapped/output/rollup/step-over-for-of-array-closure.js
examples/sourcemapped/output/rollup/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/rollup/step-over-for-of-closure.js
examples/sourcemapped/output/rollup/step-over-for-of-closure.js.map
examples/sourcemapped/output/rollup/step-over-function-params.js
examples/sourcemapped/output/rollup/step-over-function-params.js.map
examples/sourcemapped/output/rollup/step-over-regenerator-await.js
examples/sourcemapped/output/rollup/step-over-regenerator-await.js.map
examples/sourcemapped/output/rollup/switches.js
examples/sourcemapped/output/rollup/switches.js.map
examples/sourcemapped/output/rollup/this-arguments-bindings.js
examples/sourcemapped/output/rollup/this-arguments-bindings.js.map
examples/sourcemapped/output/rollup/try-catches.js
examples/sourcemapped/output/rollup/try-catches.js.map
examples/sourcemapped/output/rollup/type-module.js
examples/sourcemapped/output/rollup/type-module.js.map
examples/sourcemapped/output/rollup/typescript-classes.js
examples/sourcemapped/output/rollup/typescript-classes.js.map
examples/sourcemapped/output/rollup/webpack-functions.js
examples/sourcemapped/output/rollup/webpack-functions.js.map
examples/sourcemapped/output/rollup/webpack-line-mappings.js
examples/sourcemapped/output/rollup/webpack-line-mappings.js.map
examples/sourcemapped/output/rollup-babel6/babel-bindings-with-flow.js
examples/sourcemapped/output/rollup-babel6/babel-bindings-with-flow.js.map
examples/sourcemapped/output/rollup-babel6/babel-classes.js
examples/sourcemapped/output/rollup-babel6/babel-classes.js.map
examples/sourcemapped/output/rollup-babel6/babel-flowtype-bindings.js
examples/sourcemapped/output/rollup-babel6/babel-flowtype-bindings.js.map
examples/sourcemapped/output/rollup-babel6/classes.js
examples/sourcemapped/output/rollup-babel6/classes.js.map
examples/sourcemapped/output/rollup-babel6/esmodules.js
examples/sourcemapped/output/rollup-babel6/esmodules.js.map
examples/sourcemapped/output/rollup-babel6/esmodules-es6.js
examples/sourcemapped/output/rollup-babel6/esmodules-es6.js.map
examples/sourcemapped/output/rollup-babel6/eval-maps.js
examples/sourcemapped/output/rollup-babel6/eval-maps.js.map
examples/sourcemapped/output/rollup-babel6/for-loops.js
examples/sourcemapped/output/rollup-babel6/for-loops.js.map
examples/sourcemapped/output/rollup-babel6/for-of.js
examples/sourcemapped/output/rollup-babel6/for-of.js.map
examples/sourcemapped/output/rollup-babel6/functions.js
examples/sourcemapped/output/rollup-babel6/functions.js.map
examples/sourcemapped/output/rollup-babel6/lex-and-nonlex.js
examples/sourcemapped/output/rollup-babel6/lex-and-nonlex.js.map
examples/sourcemapped/output/rollup-babel6/line-start-bindings-es6.js
examples/sourcemapped/output/rollup-babel6/line-start-bindings-es6.js.map
examples/sourcemapped/output/rollup-babel6/shadowed-vars.js
examples/sourcemapped/output/rollup-babel6/shadowed-vars.js.map
examples/sourcemapped/output/rollup-babel6/step-over-for-of.js
examples/sourcemapped/output/rollup-babel6/step-over-for-of.js.map
examples/sourcemapped/output/rollup-babel6/step-over-for-of-array.js
examples/sourcemapped/output/rollup-babel6/step-over-for-of-array.js.map
examples/sourcemapped/output/rollup-babel6/step-over-for-of-array-closure.js
examples/sourcemapped/output/rollup-babel6/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/rollup-babel6/step-over-for-of-closure.js
examples/sourcemapped/output/rollup-babel6/step-over-for-of-closure.js.map
examples/sourcemapped/output/rollup-babel6/step-over-function-params.js
examples/sourcemapped/output/rollup-babel6/step-over-function-params.js.map
examples/sourcemapped/output/rollup-babel6/step-over-regenerator-await.js
examples/sourcemapped/output/rollup-babel6/step-over-regenerator-await.js.map
examples/sourcemapped/output/rollup-babel6/switches.js
examples/sourcemapped/output/rollup-babel6/switches.js.map
examples/sourcemapped/output/rollup-babel6/this-arguments-bindings.js
examples/sourcemapped/output/rollup-babel6/this-arguments-bindings.js.map
examples/sourcemapped/output/rollup-babel6/try-catches.js
examples/sourcemapped/output/rollup-babel6/try-catches.js.map
examples/sourcemapped/output/rollup-babel6/type-module.js
examples/sourcemapped/output/rollup-babel6/type-module.js.map
examples/sourcemapped/output/rollup-babel6/webpack-functions.js
examples/sourcemapped/output/rollup-babel6/webpack-functions.js.map
examples/sourcemapped/output/rollup-babel6/webpack-line-mappings.js
examples/sourcemapped/output/rollup-babel6/webpack-line-mappings.js.map
examples/sourcemapped/output/rollup-babel7/babel-bindings-with-flow.js
examples/sourcemapped/output/rollup-babel7/babel-bindings-with-flow.js.map
examples/sourcemapped/output/rollup-babel7/babel-classes.js
examples/sourcemapped/output/rollup-babel7/babel-classes.js.map
examples/sourcemapped/output/rollup-babel7/babel-flowtype-bindings.js
examples/sourcemapped/output/rollup-babel7/babel-flowtype-bindings.js.map
examples/sourcemapped/output/rollup-babel7/classes.js
examples/sourcemapped/output/rollup-babel7/classes.js.map
examples/sourcemapped/output/rollup-babel7/esmodules.js
examples/sourcemapped/output/rollup-babel7/esmodules.js.map
examples/sourcemapped/output/rollup-babel7/esmodules-es6.js
examples/sourcemapped/output/rollup-babel7/esmodules-es6.js.map
examples/sourcemapped/output/rollup-babel7/eval-maps.js
examples/sourcemapped/output/rollup-babel7/eval-maps.js.map
examples/sourcemapped/output/rollup-babel7/for-loops.js
examples/sourcemapped/output/rollup-babel7/for-loops.js.map
examples/sourcemapped/output/rollup-babel7/for-of.js
examples/sourcemapped/output/rollup-babel7/for-of.js.map
examples/sourcemapped/output/rollup-babel7/functions.js
examples/sourcemapped/output/rollup-babel7/functions.js.map
examples/sourcemapped/output/rollup-babel7/lex-and-nonlex.js
examples/sourcemapped/output/rollup-babel7/lex-and-nonlex.js.map
examples/sourcemapped/output/rollup-babel7/line-start-bindings-es6.js
examples/sourcemapped/output/rollup-babel7/line-start-bindings-es6.js.map
examples/sourcemapped/output/rollup-babel7/shadowed-vars.js
examples/sourcemapped/output/rollup-babel7/shadowed-vars.js.map
examples/sourcemapped/output/rollup-babel7/step-over-for-of.js
examples/sourcemapped/output/rollup-babel7/step-over-for-of.js.map
examples/sourcemapped/output/rollup-babel7/step-over-for-of-array.js
examples/sourcemapped/output/rollup-babel7/step-over-for-of-array.js.map
examples/sourcemapped/output/rollup-babel7/step-over-for-of-array-closure.js
examples/sourcemapped/output/rollup-babel7/step-over-for-of-array-closure.js.map
examples/sourcemapped/output/rollup-babel7/step-over-for-of-closure.js
examples/sourcemapped/output/rollup-babel7/step-over-for-of-closure.js.map
examples/sourcemapped/output/rollup-babel7/step-over-function-params.js
examples/sourcemapped/output/rollup-babel7/step-over-function-params.js.map
examples/sourcemapped/output/rollup-babel7/step-over-regenerator-await.js
examples/sourcemapped/output/rollup-babel7/step-over-regenerator-await.js.map
examples/sourcemapped/output/rollup-babel7/switches.js
examples/sourcemapped/output/rollup-babel7/switches.js.map
examples/sourcemapped/output/rollup-babel7/this-arguments-bindings.js
examples/sourcemapped/output/rollup-babel7/this-arguments-bindings.js.map
examples/sourcemapped/output/rollup-babel7/try-catches.js
examples/sourcemapped/output/rollup-babel7/try-catches.js.map
examples/sourcemapped/output/rollup-babel7/type-module.js
examples/sourcemapped/output/rollup-babel7/type-module.js.map
examples/sourcemapped/output/rollup-babel7/webpack-functions.js
examples/sourcemapped/output/rollup-babel7/webpack-functions.js.map
examples/sourcemapped/output/rollup-babel7/webpack-line-mappings.js
examples/sourcemapped/output/rollup-babel7/webpack-line-mappings.js.map
## END-SOURCEMAPPED-FIXTURES
examples/ember/quickstart/dist/index.html
examples/ember/quickstart/dist/assets/quickstart.css
examples/ember/quickstart/dist/assets/quickstart.js
examples/ember/quickstart/dist/assets/quickstart.map
examples/ember/quickstart/dist/assets/vendor.css
examples/ember/quickstart/dist/assets/vendor.js
examples/ember/quickstart/dist/assets/vendor.map
examples/sourcemaps/bundle.js
examples/sourcemaps/bundle.js.map
examples/sourcemaps2/main.min.js
examples/sourcemaps2/main.js
examples/sourcemaps2/main.js.map
examples/sourcemaps3/bundle.js
examples/sourcemaps3/bundle.js.map
examples/sourcemaps3/sorted.js
examples/sourcemaps3/test.js
examples/sourcemaps-reload/v1.bundle.js
examples/sourcemaps-reload/v1.bundle.js.map
examples/sourcemaps-reload/v2.bundle.js
examples/sourcemaps-reload/v2.bundle.js.map
examples/sourcemaps-reload/v3.bundle.js
examples/sourcemaps-reload/v3.bundle.js.map
examples/sourcemaps-reload/doc-sourcemaps-reload.html
examples/sourcemaps-reload/doc-sourcemaps-reload2.html
examples/sourcemaps-reload/doc-sourcemaps-reload3.html
examples/react/build/main.js
examples/react/build/main.js.map
examples/doc-react.html
examples/wasm-sourcemaps/fib.c
examples/wasm-sourcemaps/fib.wasm
examples/wasm-sourcemaps/fib.wasm.map
examples/wasm-sourcemaps/utils.js
examples/doc-html-breakpoints.html
examples/html-breakpoints-slow.js
examples/sjs_slow-load.sjs
examples/fetch.js
examples/doc-event-breakpoints.html
examples/event-breakpoints.js
examples/doc-xhr.html
examples/doc-xhr-run-to-completion.html
examples/doc-scroll-run-to-completion.html
examples/pretty.js
examples/sum/sum.js
examples/sum/sum.min.js
examples/sum/sum.min.js.map
examples/big-sourcemap_files/bundle.js
examples/big-sourcemap_files/bundle.js.map
examples/reload/code_reload_1.js
examples/reload/code_reload_2.js
examples/reload/doc-reload.html
examples/reload/sjs_code_reload.sjs
examples/doc-react-jsx.html
examples/doc-async.html
examples/doc-asm.html
examples/doc-duplicate-functions.html
examples/doc-pretty.html
examples/doc-sourcemapped.html
examples/doc-content-script-sources.html
examples/doc-scripts.html
examples/doc-scripts-debugger.html
examples/doc-script-mutate.html
examples/doc-script-switching.html
examples/doc-exceptions.html
examples/doc-iframes.html
examples/doc-frames.html
examples/doc-debugger-statements.html
examples/doc-minified.html
examples/big-sourcemap.html
examples/doc-minified2.html
examples/doc-on-load.html
examples/doc-preview.html
examples/doc-sourcemaps.html
examples/doc-sourcemaps2.html
examples/doc-sourcemaps3.html
examples/doc-sourcemap-bogus.html
examples/doc-sources.html
examples/doc-sources-querystring.html
examples/doc-strict.html
examples/doc-pause-points.html
examples/doc-return-values.html
examples/doc-wasm-sourcemaps.html
examples/doc-audiocontext.html
examples/asm.js
examples/async.js
examples/bogus-map.js
examples/entry.js
examples/exceptions.js
examples/long.js
examples/math.min.js
examples/nested/nested-source.js
examples/top-level.js
examples/opts.js
examples/output.js
examples/preview.js
examples/simple1.js
examples/simple2.js
examples/simple3.js
examples/frames.js
examples/pause-points.js
examples/script-mutate.js
examples/script-switching-02.js
examples/script-switching-01.js
examples/times2.js
examples/doc-windowless-workers.html
examples/doc-windowless-workers-early-breakpoint.html
examples/simple-worker.js
examples/doc-worker-scopes.html
examples/scopes-worker.js
examples/doc-event-handler.html
examples/doc-editor-scroll.html
examples/doc-eval-throw.html
examples/doc-sourceURL-breakpoint.html
examples/doc-step-in-uninitialized.html
examples/doc-idb-run-to-completion.html
examples/doc-scopes-xrays.html
examples/doc-message-run-to-completion.html
examples/doc-message-run-to-completion-frame.html
examples/doc-merge-scopes.html
[browser_dbg-asm.js]
[browser_dbg-audiocontext.js]

Просмотреть файл

@ -11,8 +11,9 @@ var gClient, gThreadFront;
var gNewChromeSource = promise.defer();
var { DevToolsLoader } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
var customLoader = new DevToolsLoader();
customLoader.invisibleToDebugger = true;
var customLoader = new DevToolsLoader({
invisibleToDebugger: true,
});
var { DebuggerServer } = customLoader.require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");

Просмотреть файл

@ -78,29 +78,5 @@ const tests = fs
)
);
const mochitestRoot = path.join(__dirname, "..", "..");
const browserINI = path.join(mochitestRoot, "browser.ini");
const assets = targets.reduce(
(acc, { fixtures }) =>
fixtures.reduce(
(acc2, { assets: assetList }) => acc2.concat(assetList),
acc
),
[]
);
assets.unshift(path.join(__dirname, "polyfill-bundle.js"));
fs.writeFileSync(
browserINI,
fs.readFileSync(browserINI, "utf8").replace(
/\n *## START-SOURCEMAPPED-FIXTURES[\s\S]*## END-SOURCEMAPPED-FIXTURES/,
`
## START-SOURCEMAPPED-FIXTURES - Generated by examples/sourcemapped/build.js
${assets.map(asset => path.relative(mochitestRoot, asset)).join("\n ")}
## END-SOURCEMAPPED-FIXTURES`
)
);
console.log("DONE - If node is still running, just hit Ctrl+C. Parcel leaves things running for some reason.")
})();

Просмотреть файл

@ -118,8 +118,9 @@ BrowserToolboxProcess.prototype = {
// This allows us to safely use the tools against even the actors and
// DebuggingServer itself, especially since we can mark this loader as
// invisible to the debugger (unlike the usual loader settings).
this.loader = new DevToolsLoader();
this.loader.invisibleToDebugger = true;
this.loader = new DevToolsLoader({
invisibleToDebugger: true,
});
const { DebuggerServer } = this.loader.require("devtools/server/main");
const { SocketListener } = this.loader.require(
"devtools/shared/security/socket"

Просмотреть файл

@ -1,151 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* This JSM is here to keep some compatibility with existing add-ons.
* Please now use the modules:
* - devtools/client/framework/devtools for gDevTools
* - devtools/client/framework/devtools-browser for gDevToolsBrowser
*/
this.EXPORTED_SYMBOLS = ["gDevTools", "gDevToolsBrowser"];
/**
* Do not directly map to the commonjs modules so that callsites of
* gDevTools.jsm do not have to do anything to access to the very last version
* of the module. The `devtools` and `browser` getter are always going to
* retrieve the very last version of the modules.
*/
Object.defineProperty(this, "require", {
get() {
const { require } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
return require;
},
});
Object.defineProperty(this, "devtools", {
get() {
return require("devtools/client/framework/devtools").gDevTools;
},
});
Object.defineProperty(this, "browser", {
get() {
return require("devtools/client/framework/devtools-browser")
.gDevToolsBrowser;
},
});
/**
* gDevTools is a singleton that controls the Firefox Developer Tools.
*
* It is an instance of a DevTools class that holds a set of tools. It has the
* same lifetime as the browser.
*/
const gDevToolsMethods = [
// Used by: - b2g desktop.js
// - nsContextMenu
// - /devtools code
"showToolbox",
// Used by Addon SDK and /devtools
"closeToolbox",
"getToolbox",
// Used by Addon SDK, main.js and tests:
"registerTool",
"registerTheme",
"unregisterTool",
"unregisterTheme",
// Used by main.js and test
"getToolDefinitionArray",
"getThemeDefinitionArray",
// Used by WebExtensions devtools API
"getTheme",
// Used by theme-switching.js
"getThemeDefinition",
"emit",
// Used by /devtools
"on",
"off",
"once",
// Used by tests
"getToolDefinitionMap",
"getThemeDefinitionMap",
"getDefaultTools",
"getAdditionalTools",
"getToolDefinition",
];
this.gDevTools = {
// Used by tests
get _toolboxes() {
return devtools._toolboxes;
},
get _tools() {
return devtools._tools;
},
};
gDevToolsMethods.forEach(name => {
this.gDevTools[name] = (...args) => {
return devtools[name].apply(devtools, args);
};
});
/**
* gDevToolsBrowser exposes functions to connect the gDevTools instance with a
* Firefox instance.
*/
const gDevToolsBrowserMethods = [
// used by browser-sets.inc, command
"toggleToolboxCommand",
// Used by browser.js itself, by setting a oncommand string...
"selectToolCommand",
// Used by browser-sets.inc, command
"openAboutDebugging",
// Used by browser-sets.inc, command
"openConnectScreen",
// Used by browser-sets.inc, command
// itself, webide widget
"openWebIDE",
// Used by browser-sets.inc, command
"openContentProcessToolbox",
// Used by browser.js
"registerBrowserWindow",
// Used by devtools-browser.js for the Toggle Toolbox status
"hasToolboxOpened",
// Used by browser.js
"forgetBrowserWindow",
];
this.gDevToolsBrowser = {
// Used by webide.js
get isWebIDEInitialized() {
return browser.isWebIDEInitialized;
},
// Used by a test (should be removed)
get _trackedBrowserWindows() {
return browser._trackedBrowserWindows;
},
};
gDevToolsBrowserMethods.forEach(name => {
this.gDevToolsBrowser[name] = (...args) => {
return browser[name].apply(browser, args);
};
});

Просмотреть файл

@ -23,7 +23,6 @@ DevToolsModules(
'browser-menus.js',
'devtools-browser.js',
'devtools.js',
'gDevTools.jsm',
'menu-item.js',
'menu.js',
'selection.js',

Просмотреть файл

@ -8,8 +8,9 @@ let tracker;
const { DevToolsLoader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const loader = new DevToolsLoader();
loader.invisibleToDebugger = true;
const loader = new DevToolsLoader({
invisibleToDebugger: true,
});
const { allocationTracker } = loader.require(
"chrome://mochitests/content/browser/devtools/shared/test-helpers/allocation-tracker"
);

Просмотреть файл

@ -80,8 +80,9 @@ async function testMainProcess() {
const { DevToolsLoader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const customLoader = new DevToolsLoader();
customLoader.invisibleToDebugger = true;
const customLoader = new DevToolsLoader({
invisibleToDebugger: true,
});
const { DebuggerServer } = customLoader.require("devtools/server/main");
const { DebuggerClient } = require("devtools/shared/client/debugger-client");

Просмотреть файл

@ -20,7 +20,7 @@ add_task(async function() {
// Retrieve the browser loader dedicated to the Debugger.
const debuggerLoader = panel.panelWin.getBrowserLoaderForWindow();
const loaders = [loader.provider.loader, debuggerLoader.loader];
const loaders = [loader.loader, debuggerLoader.loader];
runMetricsTest({
filterString: "devtools/client/debugger",

Просмотреть файл

@ -18,7 +18,7 @@ add_task(async function() {
await openNewTabAndToolbox(TEST_URL, "inspector");
// The inspector does not use a dedicated browser loader.
const loaders = [loader.provider.loader];
const loaders = [loader.loader];
runMetricsTest({
filterString: "devtools/client/inspector",

Просмотреть файл

@ -20,7 +20,7 @@ add_task(async function() {
// Retrieve the browser loader dedicated to the Netmonitor.
const netmonitorLoader = panel.panelWin.getBrowserLoaderForWindow();
const loaders = [loader.provider.loader, netmonitorLoader.loader];
const loaders = [loader.loader, netmonitorLoader.loader];
runMetricsTest({
filterString: "devtools/client/netmonitor",

Просмотреть файл

@ -20,7 +20,7 @@ add_task(async function() {
// Retrieve the browser loader dedicated to the WebConsole.
const webconsoleLoader = panel._frameWindow.getBrowserLoaderForWindow();
const loaders = [loader.provider.loader, webconsoleLoader.loader];
const loaders = [loader.loader, webconsoleLoader.loader];
runMetricsTest({
filterString: "devtools/client/webconsole",

Просмотреть файл

@ -13,21 +13,15 @@ const { XPCOMUtils } = ChromeUtils.import(
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
// Load devtools module lazily.
XPCOMUtils.defineLazyGetter(this, "devtools", function() {
// eslint-disable-next-line no-shadow
const { devtools } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
return devtools;
});
// Load JsonView services lazily.
XPCOMUtils.defineLazyGetter(this, "JsonViewService", function() {
// eslint-disable-next-line no-shadow
const { JsonViewService } = devtools.require(
"devtools/client/jsonview/converter-child"
const { require } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const {
// eslint-disable-next-line no-shadow
JsonViewService,
} = require("devtools/client/jsonview/converter-child");
return JsonViewService;
});

Просмотреть файл

@ -189,8 +189,12 @@ pref("devtools.netmonitor.har.forceExport", false);
pref("devtools.netmonitor.har.pageLoadedTimeout", 1500);
pref("devtools.netmonitor.har.enableAutoExportToFile", false);
// Support for WebSocket monitoring pref (pending complete implementation)
// Enable WebSocket monitoring in Nightly builds.
#if defined(NIGHTLY_BUILD)
pref("devtools.netmonitor.features.webSockets", true);
#else
pref("devtools.netmonitor.features.webSockets", false);
#endif
// Scratchpad settings
// - recentFileMax: The maximum number of recently-opened files

Просмотреть файл

@ -7,6 +7,7 @@ skip-if = !e10s || os == "win"
support-files =
contextual_identity.html
devices.json
doc_contextmenu_inspect.html
doc_page_state.html
doc_toolbox_rule_view.css
doc_toolbox_rule_view.html
@ -27,6 +28,7 @@ support-files =
[browser_cmd_click.js]
[browser_container_tab.js]
skip-if = fission
[browser_contextmenu_inspect.js]
[browser_contextual_identity.js]
[browser_device_change.js]
[browser_device_custom_edit.js]

Просмотреть файл

@ -0,0 +1,55 @@
"use strict";
// Check that Inspect Element works in Responsive Design Mode.
const TEST_URI = `${URL_ROOT}doc_contextmenu_inspect.html`;
addRDMTask(TEST_URI, async function({ ui, manager }) {
info("Open the responsive design mode and set its size to 500x500 to start");
await setViewportSize(ui, manager, 500, 500);
info("Open the inspector, rule-view and select the test node");
const { inspector } = await openRuleView();
const startNodeFront = inspector.selection.nodeFront;
is(startNodeFront.displayName, "body", "body element is selected by default");
const onSelected = inspector.once("inspector-updated");
const contentAreaContextMenu = document.querySelector(
"#contentAreaContextMenu"
);
const contextOpened = once(contentAreaContextMenu, "popupshown");
info("Simulate a context menu event from the top browser.");
BrowserTestUtils.synthesizeMouse(
ui.getViewportBrowser(),
250,
100,
{
type: "contextmenu",
button: 2,
},
ui.tab.linkedBrowser
);
await contextOpened;
info("Triggering the inspect action");
await gContextMenu.inspectNode();
info("Hiding the menu");
const contextClosed = once(contentAreaContextMenu, "popuphidden");
contentAreaContextMenu.hidePopup();
await contextClosed;
await onSelected;
const newNodeFront = inspector.selection.nodeFront;
is(
newNodeFront.displayName,
"div",
"div element is selected after using Inspect Element"
);
await closeToolbox();
});

Просмотреть файл

@ -0,0 +1,3 @@
<html>
<div style="width: 500px; height: 500px; background: red;"></div>
</html>

Просмотреть файл

@ -4,13 +4,13 @@
"use strict";
const loaders = ChromeUtils.import("resource://devtools/shared/base-loader.js");
const { devtools, loader } = ChromeUtils.import(
const { require: devtoolsRequire, loader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const flags = devtools.require("devtools/shared/flags");
const { joinURI } = devtools.require("devtools/shared/path");
const { assert } = devtools.require("devtools/shared/DevToolsUtils");
const { AppConstants } = devtools.require(
const flags = devtoolsRequire("devtools/shared/flags");
const { joinURI } = devtoolsRequire("devtools/shared/path");
const { assert } = devtoolsRequire("devtools/shared/DevToolsUtils");
const { AppConstants } = devtoolsRequire(
"resource://gre/modules/AppConstants.jsm"
);
@ -115,7 +115,7 @@ function BrowserLoaderBuilder({
"Cannot use both `baseURI` and `useOnlyShared`."
);
const loaderOptions = devtools.require("@loader/options");
const loaderOptions = devtoolsRequire("@loader/options");
const dynamicPaths = {};
if (AppConstants.DEBUG_JS_MODULES) {
@ -132,7 +132,6 @@ function BrowserLoaderBuilder({
}
const opts = {
sharedGlobal: true,
sandboxPrototype: window,
sandboxName: "DevTools (UI loader)",
paths: Object.assign({}, dynamicPaths, loaderOptions.paths),
@ -140,8 +139,8 @@ function BrowserLoaderBuilder({
requireHook: (id, require) => {
// If |id| requires special handling, simply defer to devtools
// immediately.
if (devtools.isLoaderPluginId(id)) {
return devtools.require(id);
if (loader.isLoaderPluginId(id)) {
return devtoolsRequire(id);
}
const uri = require.resolve(id);
@ -166,7 +165,7 @@ function BrowserLoaderBuilder({
uri.match(browserBasedDirsRegExp) != null;
if ((useOnlyShared || !uri.startsWith(baseURI)) && !isBrowserDir) {
return devtools.require(uri);
return devtoolsRequire(uri);
}
return require(uri);
@ -193,9 +192,9 @@ function BrowserLoaderBuilder({
},
// Allow modules to use the DevToolsLoader lazy loading helpers.
loader: {
lazyGetter: devtools.lazyGetter,
lazyImporter: devtools.lazyImporter,
lazyServiceGetter: devtools.lazyServiceGetter,
lazyGetter: loader.lazyGetter,
lazyImporter: loader.lazyImporter,
lazyServiceGetter: loader.lazyServiceGetter,
lazyRequireGetter: this.lazyRequireGetter.bind(this),
},
},
@ -226,7 +225,7 @@ BrowserLoaderBuilder.prototype = {
* Pass true if the property name is a member of the module's exports.
*/
lazyRequireGetter: function(obj, property, module, destructure) {
devtools.lazyGetter(obj, property, () => {
loader.lazyGetter(obj, property, () => {
return destructure
? this.require(module)[property]
: this.require(module || property);

Просмотреть файл

@ -25,8 +25,9 @@ if (DEBUG_ALLOCATIONS) {
const { DevToolsLoader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const loader = new DevToolsLoader();
loader.invisibleToDebugger = true;
const loader = new DevToolsLoader({
invisibleToDebugger: true,
});
const { allocationTracker } = loader.require(
"devtools/shared/test-helpers/allocation-tracker"

Просмотреть файл

@ -158,8 +158,9 @@ HUDService.prototype = {
const { DevToolsLoader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const loader = new DevToolsLoader();
loader.freshCompartment = true;
const loader = new DevToolsLoader({
freshCompartment: true,
});
const { DebuggerServer } = loader.require("devtools/server/main");
DebuggerServer.init();

Просмотреть файл

@ -56,10 +56,10 @@ Example:
Example:
* File: `/devtools/client/framework/gDevTools.jsm`
* File: `/toolkit/mozapps/extensions/AddonManager.jsm`
* Usage (prefer lazy in most cases):
* `loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm")`
* `const { gDevTools } = ChromeUtils.import("resource://devtools/client/framework/gDevTools.jsm")`
* `loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm")`
* `const { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm")`
## Chrome Content

Просмотреть файл

@ -23,7 +23,7 @@ const WebSocketActor = ActorClassWithSpec(webSocketSpec, {
Actor.prototype.initialize.call(this, conn);
this.targetActor = targetActor;
this.listening = false;
this.innerWindowID = null;
// Each connection's webSocketSerialID is mapped to a httpChannelId
this.connections = new Map();
@ -54,22 +54,20 @@ const WebSocketActor = ActorClassWithSpec(webSocketSpec, {
// Actor API
startListening: function() {
// Register WS listener
if (!this.listening) {
const innerWindowID = this.targetActor.window.windowUtils
.currentInnerWindowID;
webSocketEventService.addListener(innerWindowID, this);
this.listening = true;
}
this.stopListening();
this.innerWindowID = this.targetActor.window.windowUtils.currentInnerWindowID;
webSocketEventService.addListener(this.innerWindowID, this);
},
stopListening() {
if (this.listening) {
const innerWindowID = this.targetActor.window.windowUtils
.currentInnerWindowID;
webSocketEventService.removeListener(innerWindowID, this);
this.listening = false;
if (!this.innerWindowID) {
return;
}
if (webSocketEventService.hasListenerFor(this.innerWindowID)) {
webSocketEventService.removeListener(this.innerWindowID, this);
}
this.innerWindowID = null;
},
// nsIWebSocketEventService

Просмотреть файл

@ -32,8 +32,9 @@ function setupServer(mm) {
// Init a custom, invisible DebuggerServer, in order to not pollute the
// debugger with all devtools modules, nor break the debugger itself with
// using it in the same process.
gLoader = new DevToolsLoader();
gLoader.invisibleToDebugger = true;
gLoader = new DevToolsLoader({
invisibleToDebugger: true,
});
const { DebuggerServer } = gLoader.require("devtools/server/main");
DebuggerServer.init();

Просмотреть файл

@ -29,8 +29,9 @@ try {
const { DevToolsLoader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
loader = new DevToolsLoader();
loader.invisibleToDebugger = true;
loader = new DevToolsLoader({
invisibleToDebugger: true,
});
customLoader = true;
} else {
// Otherwise, use the shared loader.

Просмотреть файл

@ -29,8 +29,9 @@ add_task(async function test() {
const { DevToolsLoader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const customLoader = new DevToolsLoader();
customLoader.invisibleToDebugger = true;
const customLoader = new DevToolsLoader({
invisibleToDebugger: true,
});
const { DebuggerServer } = customLoader.require("devtools/server/main");
DebuggerServer.init();

Просмотреть файл

@ -18,135 +18,141 @@ var { requireRawId } = ChromeUtils.import(
this.EXPORTED_SYMBOLS = [
"DevToolsLoader",
"devtools",
"BuiltinProvider",
"require",
"loader",
// Export StructuredCloneHolder for its use from builtin-modules
"StructuredCloneHolder",
];
/**
* Providers are different strategies for loading the devtools.
*/
/**
* Used when the tools should be loaded from the Firefox package itself.
* This is the default case.
*/
function BuiltinProvider() {}
BuiltinProvider.prototype = {
load: function() {
const paths = {
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
devtools: "resource://devtools",
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
acorn: "resource://devtools/shared/acorn",
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
"acorn/util/walk": "resource://devtools/shared/acorn/walk.js",
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
// Allow access to xpcshell test items from the loader.
"xpcshell-test": "resource://test",
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
// Allow access to locale data using paths closer to what is
// used in the source tree.
"devtools/client/locales": "chrome://devtools/locale",
"devtools/shared/locales": "chrome://devtools-shared/locale",
"devtools/startup/locales": "chrome://devtools-startup/locale",
"toolkit/locales": "chrome://global/locale",
};
// When creating a Loader invisible to the Debugger, we have to ensure
// using only modules and not depend on any JSM. As everything that is
// not loaded with Loader isn't going to respect `invisibleToDebugger`.
// But we have to keep using Promise.jsm for other loader to prevent
// breaking unhandled promise rejection in tests.
if (this.invisibleToDebugger) {
paths.promise = "resource://gre/modules/Promise-backend.js";
}
this.loader = new Loader({
paths,
invisibleToDebugger: this.invisibleToDebugger,
freshCompartment: this.freshCompartment,
sharedGlobal: true,
sandboxName: "DevTools (Module loader)",
requireHook: (id, require) => {
if (id.startsWith("raw!") || id.startsWith("theme-loader!")) {
return requireRawId(id, require);
}
return require(id);
},
});
},
unload: function(reason) {
unload(this.loader, reason);
delete this.loader;
},
};
var gNextLoaderID = 0;
/**
* The main devtools API. The standard instance of this loader is exported as
* |devtools| below, but if a fresh copy of the loader is needed, then a new
* |loader| below, but if a fresh copy of the loader is needed, then a new
* one can also be created.
*
* The two following boolean flags are used to control the sandboxes into
* which the modules are loaded.
* @param invisibleToDebugger boolean
* If true, the modules won't be visible by the Debugger API.
* This typically allows to hide server modules from the debugger panel.
* @param freshCompartment boolean
* If true, the modules will be forced to be loaded in a distinct
* compartment. It is typically used to load the modules in a distinct
* system compartment, different from the main one, which is shared by
* all JSMs, XPCOMs and modules loaded with this flag set to true.
* We use this in order to debug modules loaded in this shared system
* compartment. The debugger actor has to be running in a distinct
* compartment than the context it is debugging.
*/
this.DevToolsLoader = function DevToolsLoader() {
this.require = this.require.bind(this);
this.DevToolsLoader = function DevToolsLoader({
invisibleToDebugger = false,
freshCompartment = false,
} = {}) {
const paths = {
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
devtools: "resource://devtools",
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
acorn: "resource://devtools/shared/acorn",
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
"acorn/util/walk": "resource://devtools/shared/acorn/walk.js",
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
// Allow access to xpcshell test items from the loader.
"xpcshell-test": "resource://test",
Services.obs.addObserver(this, "devtools-unload");
// ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠
// Allow access to locale data using paths closer to what is
// used in the source tree.
"devtools/client/locales": "chrome://devtools/locale",
"devtools/shared/locales": "chrome://devtools-shared/locale",
"devtools/startup/locales": "chrome://devtools-startup/locale",
"toolkit/locales": "chrome://global/locale",
};
// When creating a Loader invisible to the Debugger, we have to ensure
// using only modules and not depend on any JSM. As everything that is
// not loaded with Loader isn't going to respect `invisibleToDebugger`.
// But we have to keep using Promise.jsm for other loader to prevent
// breaking unhandled promise rejection in tests.
if (invisibleToDebugger) {
paths.promise = "resource://gre/modules/Promise-backend.js";
}
this.loader = new Loader({
paths,
invisibleToDebugger,
freshCompartment,
sandboxName: "DevTools (Module loader)",
requireHook: (id, require) => {
if (id.startsWith("raw!") || id.startsWith("theme-loader!")) {
return requireRawId(id, require);
}
return require(id);
},
});
this.require = Require(this.loader, { id: "devtools" });
// Fetch custom pseudo modules and globals
const { modules, globals } = this.require("devtools/shared/builtin-modules");
// When creating a Loader for the browser toolbox, we have to use
// Promise-backend.js, as a Loader module. Instead of Promise.jsm which
// can't be flagged as invisible to debugger.
if (invisibleToDebugger) {
delete modules.promise;
}
// Register custom pseudo modules to the current loader instance
for (const id in modules) {
const uri = resolveURI(id, this.loader.mapping);
this.loader.modules[uri] = {
get exports() {
return modules[id];
},
};
}
// Register custom globals to the current loader instance
Object.defineProperties(
this.loader.globals,
Object.getOwnPropertyDescriptors(globals)
);
// Define the loader id for these two usecases:
// * access via the JSM (this.id)
// let { loader } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
// loader.id
this.id = gNextLoaderID++;
// * access via module's `loader` global
// loader.id
globals.loader.id = this.id;
// Expose lazy helpers on `loader`
// ie. when you use it like that from a JSM:
// let { loader } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
// loader.lazyGetter(...);
this.lazyGetter = globals.loader.lazyGetter;
this.lazyImporter = globals.loader.lazyImporter;
this.lazyServiceGetter = globals.loader.lazyServiceGetter;
this.lazyRequireGetter = globals.loader.lazyRequireGetter;
// When replaying, modify the require hook to allow the ReplayInspector to
// replace chrome interfaces with alternatives that understand the proxies
// created for objects in the recording/replaying process.
if (globals.isReplaying) {
const oldHook = this.loader.requireHook;
const ReplayInspector = this.require(
"devtools/server/actors/replay/inspector"
);
this.loader.requireHook = ReplayInspector.wrapRequireHook(oldHook);
}
};
DevToolsLoader.prototype = {
destroy: function(reason = "shutdown") {
Services.obs.removeObserver(this, "devtools-unload");
if (this._provider) {
this._provider.unload(reason);
delete this._provider;
}
},
get provider() {
if (!this._provider) {
this._loadProvider();
}
return this._provider;
},
_provider: null,
get id() {
if (this._id) {
return this._id;
}
this._id = ++gNextLoaderID;
return this._id;
},
/**
* A dummy version of require, in case a provider hasn't been chosen yet when
* this is first called. This will then be replaced by the real version.
* @see setProvider
*/
require: function() {
if (!this._provider) {
this._loadProvider();
}
return this.require.apply(this, arguments);
},
/**
* A dummy version of lazyRequireGetter, in case a provider hasn't been chosen yet when
* this is first called. This will then be replaced by the real version.
* @see setProvider
*/
lazyRequireGetter: function() {
if (!this._provider) {
this._loadProvider();
}
return this.lazyRequireGetter.apply(this, arguments);
unload(this.loader, reason);
delete this.loader;
},
/**
@ -156,98 +162,10 @@ DevToolsLoader.prototype = {
isLoaderPluginId: function(id) {
return id.startsWith("raw!");
},
};
/**
* Override the provider used to load the tools.
*/
setProvider: function(provider) {
if (provider === this._provider) {
return;
}
if (this._provider) {
delete this.require;
this._provider.unload("newprovider");
}
this._provider = provider;
// Pass through internal loader settings specific to this loader instance
this._provider.invisibleToDebugger = this.invisibleToDebugger;
this._provider.freshCompartment = this.freshCompartment;
this._provider.load();
this.require = Require(this._provider.loader, { id: "devtools" });
// Fetch custom pseudo modules and globals
const { modules, globals } = this.require(
"devtools/shared/builtin-modules"
);
// When creating a Loader for the browser toolbox, we have to use
// Promise-backend.js, as a Loader module. Instead of Promise.jsm which
// can't be flagged as invisible to debugger.
if (this.invisibleToDebugger) {
delete modules.promise;
}
// Register custom pseudo modules to the current loader instance
const loader = this._provider.loader;
for (const id in modules) {
const uri = resolveURI(id, loader.mapping);
loader.modules[uri] = {
get exports() {
return modules[id];
},
};
}
// Register custom globals to the current loader instance
globals.loader.id = this.id;
Object.defineProperties(
loader.globals,
Object.getOwnPropertyDescriptors(globals)
);
// Expose lazy helpers on loader
this.lazyGetter = globals.loader.lazyGetter;
this.lazyImporter = globals.loader.lazyImporter;
this.lazyServiceGetter = globals.loader.lazyServiceGetter;
this.lazyRequireGetter = globals.loader.lazyRequireGetter;
// When replaying, modify the require hook to allow the ReplayInspector to
// replace chrome interfaces with alternatives that understand the proxies
// created for objects in the recording/replaying process.
if (globals.isReplaying) {
const oldHook = this._provider.loader.requireHook;
const ReplayInspector = this.require(
"devtools/server/actors/replay/inspector"
);
this._provider.loader.requireHook = ReplayInspector.wrapRequireHook(
oldHook
);
}
},
/**
* Choose a default tools provider based on the preferences.
*/
_loadProvider: function() {
this.setProvider(new BuiltinProvider());
},
/**
* Handles "devtools-unload" event
*
* @param String data
* reason passed to modules when unloaded
*/
observe: function(subject, topic, data) {
if (topic != "devtools-unload") {
return;
}
this.destroy(data);
},
// Export the standard instance of DevToolsLoader used by the tools.
this.loader = new DevToolsLoader({
/**
* Sets whether the compartments loaded by this instance should be invisible
* to the debugger. Invisibility is needed for loaders that support debugging
@ -258,17 +176,6 @@ DevToolsLoader.prototype = {
* @see devtools/client/framework/ToolboxProcess.jsm
*/
invisibleToDebugger: Services.appinfo.name !== "Firefox",
};
// Export the standard instance of DevToolsLoader used by the tools.
this.devtools = this.loader = new DevToolsLoader();
this.require = this.devtools.require.bind(this.devtools);
// For compatibility reasons, expose these symbols on "devtools":
Object.defineProperty(this.devtools, "Toolbox", {
get: () => this.require("devtools/client/framework/toolbox").Toolbox,
});
Object.defineProperty(this.devtools, "TargetFactory", {
get: () => this.require("devtools/client/framework/target").TargetFactory,
});
this.require = this.loader.require;

Просмотреть файл

@ -155,46 +155,37 @@ function load(loader, module) {
},
};
let sandbox;
if (loader.useSharedGlobalSandbox) {
// Create a new object in this sandbox, that will be used as
// the scope object for this particular module
sandbox = new loader.sharedGlobalSandbox.Object();
descriptors.lazyRequire = {
configurable: true,
value: lazyRequire.bind(sandbox),
};
descriptors.lazyRequireModule = {
configurable: true,
value: lazyRequireModule.bind(sandbox),
};
// Create a new object in this sandbox, that will be used as
// the scope object for this particular module
const sandbox = new loader.sharedGlobalSandbox.Object();
descriptors.lazyRequire = {
configurable: true,
value: lazyRequire.bind(sandbox),
};
descriptors.lazyRequireModule = {
configurable: true,
value: lazyRequireModule.bind(sandbox),
};
if ("console" in globals) {
descriptors.console = {
configurable: true,
get() {
return globals.console;
},
};
}
const define = Object.getOwnPropertyDescriptor(globals, "define");
if (define && define.value) {
descriptors.define = define;
}
if ("DOMParser" in globals) {
descriptors.DOMParser = Object.getOwnPropertyDescriptor(
globals,
"DOMParser"
);
}
Object.defineProperties(sandbox, descriptors);
} else {
sandbox = Sandbox({
name: module.uri,
prototype: Object.create(globals, descriptors),
invisibleToDebugger: loader.invisibleToDebugger,
});
if ("console" in globals) {
descriptors.console = {
configurable: true,
get() {
return globals.console;
},
};
}
const define = Object.getOwnPropertyDescriptor(globals, "define");
if (define && define.value) {
descriptors.define = define;
}
if ("DOMParser" in globals) {
descriptors.DOMParser = Object.getOwnPropertyDescriptor(
globals,
"DOMParser"
);
}
Object.defineProperties(sandbox, descriptors);
sandboxes[module.uri] = sandbox;
const originalExports = module.exports;
@ -551,8 +542,6 @@ function unload(loader, reason) {
// - `paths`: Mandatory dictionary of require path mapped to absolute URIs.
// Object keys are path prefix used in require(), values are URIs where each
// prefix should be mapped to.
// - `sharedGlobal`: Boolean, if True, loads all module in a single, shared
// global in order to create only one global and compartment.
// - `globals`: Optional map of globals, that all module scopes will inherit
// from. Map is also exposed under `globals` property of the returned loader
// so it can be extended further later. Defaults to `{}`.
@ -565,7 +554,7 @@ function unload(loader, reason) {
// from loader. This function receive the module path as first argument,
// and native require method as second argument.
function Loader(options) {
let { paths, sharedGlobal, globals } = options;
let { paths, globals } = options;
if (!globals) {
globals = {};
}
@ -648,7 +637,6 @@ function Loader(options) {
mappingCache: { enumerable: false, value: new Map() },
// Map of module objects indexed by module URIs.
modules: { enumerable: false, value: modules },
useSharedGlobalSandbox: { enumerable: false, value: !!sharedGlobal },
sharedGlobalSandbox: { enumerable: false, value: sharedGlobalSandbox },
// Map of module sandboxes indexed by module URIs.
sandboxes: { enumerable: false, value: {} },

Просмотреть файл

@ -37,9 +37,6 @@ class WebSocketFront extends FrontClassWithSpec(webSocketSpec) {
*
*/
destroy() {
if (!this._client) {
return null;
}
this.off("serverWebSocketOpened");
this.off("serverWebSocketClosed");
this.off("serverFrameSent");

Просмотреть файл

@ -9,9 +9,10 @@
const { DevToolsLoader } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const loader = new DevToolsLoader();
loader.invisibleToDebugger = true;
loader.freshCompartment = true;
const loader = new DevToolsLoader({
invisibleToDebugger: true,
freshCompartment: true,
});
const { allocationTracker } = loader.require(
"chrome://mochitests/content/browser/devtools/shared/test-helpers/allocation-tracker"
);

Просмотреть файл

@ -17,6 +17,6 @@ function run_test() {
Assert.ok(indent1 !== indent2);
Assert.ok(loader1._provider !== loader2._provider);
Assert.ok(loader1._provider.loader !== loader2._provider.loader);
Assert.ok(loader1.loader !== loader2.loader);
Assert.ok(loader1.id !== loader2.id);
}

Просмотреть файл

@ -18,12 +18,13 @@ function run_test() {
}
function visible_loader() {
const loader = new DevToolsLoader();
loader.invisibleToDebugger = false;
const loader = new DevToolsLoader({
invisibleToDebugger: false,
});
loader.require("devtools/shared/indentation");
const dbg = new Debugger();
const sandbox = loader._provider.loader.sharedGlobalSandbox;
const sandbox = loader.loader.sharedGlobalSandbox;
try {
dbg.addDebuggee(sandbox);
@ -40,12 +41,13 @@ function visible_loader() {
}
function invisible_loader() {
const loader = new DevToolsLoader();
loader.invisibleToDebugger = true;
const loader = new DevToolsLoader({
invisibleToDebugger: true,
});
loader.require("devtools/shared/indentation");
const dbg = new Debugger();
const sandbox = loader._provider.loader.sharedGlobalSandbox;
const sandbox = loader.loader.sharedGlobalSandbox;
try {
dbg.addDebuggee(sandbox);
@ -59,8 +61,6 @@ function invisible_loader() {
// into it.
const promise = loader.require("promise");
const promiseModule =
loader._provider.loader.modules[
"resource://gre/modules/Promise-backend.js"
];
loader.loader.modules["resource://gre/modules/Promise-backend.js"];
Assert.equal(promise, promiseModule.exports);
}

Просмотреть файл

@ -3,16 +3,14 @@
"use strict";
const { devtools } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
const { loader } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
// Test devtools.lazyRequireGetter
function run_test() {
const name = "asyncUtils";
const path = "devtools/shared/async-utils";
const o = {};
devtools.lazyRequireGetter(o, name, path);
loader.lazyRequireGetter(o, name, path);
const asyncUtils = require(path);
// XXX: do_check_eq only works on primitive types, so we have this
// do_check_true of an equality expression.
@ -21,18 +19,18 @@ function run_test() {
// A non-main loader should get a new object via |lazyRequireGetter|, just
// as it would via a direct |require|.
const o2 = {};
const loader = new DevToolsLoader();
const loader2 = new DevToolsLoader();
// We have to init the loader by loading any module before
// lazyRequireGetter is available
loader.require("devtools/shared/DevToolsUtils");
loader2.require("devtools/shared/DevToolsUtils");
loader.lazyRequireGetter(o2, name, path);
loader2.lazyRequireGetter(o2, name, path);
Assert.ok(o2.asyncUtils !== asyncUtils);
// A module required via a non-main loader that then uses |lazyRequireGetter|
// should also get the same object from that non-main loader.
const exposeLoader = loader.require("xpcshell-test/exposeLoader");
const exposeLoader = loader2.require("xpcshell-test/exposeLoader");
const o3 = exposeLoader.exerciseLazyRequire(name, path);
Assert.ok(o3.asyncUtils === o2.asyncUtils);
}

Просмотреть файл

@ -86,6 +86,21 @@ this.DevToolsShim = {
return !!this._gDevTools;
},
/**
* Returns the array of the existing toolboxes. This method is part of the compatibility
* layer for webextensions.
*
* @return {Array<Toolbox>}
* An array of toolboxes.
*/
getToolboxes: function() {
if (this.isInitialized()) {
return this._gDevTools.getToolboxes();
}
return [];
},
/**
* Register an instance of gDevTools. Should be called by DevTools during startup.
*
@ -303,7 +318,6 @@ const webExtensionsMethods = [
"getTargetForTab",
"getTheme",
"openBrowserConsole",
"getToolboxes",
];
for (const method of webExtensionsMethods) {

Просмотреть файл

@ -1010,8 +1010,9 @@ DevToolsStartup.prototype = {
// actors and DebuggingServer itself, especially since we can mark
// serverLoader as invisible to the debugger (unlike the usual loader
// settings).
const serverLoader = new DevToolsLoader();
serverLoader.invisibleToDebugger = true;
const serverLoader = new DevToolsLoader({
invisibleToDebugger: true,
});
const { DebuggerServer: debuggerServer } = serverLoader.require(
"devtools/server/main"
);

Просмотреть файл

@ -129,6 +129,25 @@ static nsIScriptGlobalObject* GetGlobalObject(nsIChannel* aChannel) {
return global;
}
static bool AllowedByCSP(nsIContentSecurityPolicy* aCSP) {
if (!aCSP) {
return true;
}
bool allowsInlineScript = true;
nsresult rv = aCSP->GetAllowsInline(nsIContentPolicy::TYPE_SCRIPT,
EmptyString(), // aNonce
true, // aParserCreated
nullptr, // aElement,
nullptr, // nsICSPEventListener
EmptyString(), // aContent
0, // aLineNumber
0, // aColumnNumber
&allowsInlineScript);
return (NS_SUCCEEDED(rv) && allowsInlineScript);
}
nsresult nsJSThunk::EvaluateScript(
nsIChannel* aChannel,
mozilla::dom::PopupBlocker::PopupControlState aPopupState,
@ -158,44 +177,16 @@ nsresult nsJSThunk::EvaluateScript(
nsresult rv;
// CSP check: javascript: URIs disabled unless "inline" scripts are
// allowed. Here we use the CSP of the thing that started the load,
// which is the CSPToInherit of the loadInfo.
// CSP check: javascript: URIs are disabled unless "inline" scripts
// are allowed by both the CSP of the thing that started the load
// (which is the CSPToInherit of the loadinfo) and the CSP of the
// target document. The target document check is performed below,
// once we have determined the target document.
nsCOMPtr<nsIContentSecurityPolicy> csp = loadInfo->GetCspToInherit();
if (csp) {
bool allowsInlineScript = true;
rv = csp->GetAllowsInline(nsIContentPolicy::TYPE_SCRIPT,
EmptyString(), // aNonce
true, // aParserCreated
nullptr, // aElement,
nullptr, // nsICSPEventListener
EmptyString(), // aContent
0, // aLineNumber
0, // aColumnNumber
&allowsInlineScript);
// return early if inline scripts are not allowed
if (NS_FAILED(rv) || !allowsInlineScript) {
return NS_ERROR_DOM_RETVAL_UNDEFINED;
}
if (!AllowedByCSP(csp)) {
return NS_ERROR_DOM_RETVAL_UNDEFINED;
}
// Based on the outcome of https://github.com/whatwg/html/issues/4651 we may
// want to also test against the CSP of the document we'll be running against
// (which is targetDoc below). If we do that, we should make sure to only do
// that test if targetDoc->NodePrincipal() subsumes
// loadInfo->TriggeringPrincipal(). If it doesn't, then someone
// more-privileged (our UI or an extension) started the load and the load
// should not be subject to the target document's CSP.
//
// The "more privileged" assumption is safe, because if the triggering
// principal does not subsume targetDoc->NodePrincipal() we won't run the
// script at all. More precisely, we test that "principal" subsumes the
// target's principal, but "principal" should never be higher-privilege than
// the triggering principal here: it's either the triggering principal, or the
// principal of the document we started the load against if the triggering
// principal is system.
// Get the global object we should be running on.
nsIScriptGlobalObject* global = GetGlobalObject(aChannel);
if (!global) {
@ -212,10 +203,34 @@ nsresult nsJSThunk::EvaluateScript(
mozilla::dom::Document* targetDoc = innerWin->GetExtantDoc();
// Sandboxed document check: javascript: URI execution is disabled
// in a sandboxed document unless 'allow-scripts' was specified.
if (targetDoc && targetDoc->HasScriptsBlockedBySandbox()) {
return NS_ERROR_DOM_RETVAL_UNDEFINED;
if (targetDoc) {
// Sandboxed document check: javascript: URI execution is disabled
// in a sandboxed document unless 'allow-scripts' was specified.
if (targetDoc->HasScriptsBlockedBySandbox()) {
return NS_ERROR_DOM_RETVAL_UNDEFINED;
}
// Perform a Security check against the CSP of the document we are
// running against. javascript: URIs are disabled unless "inline"
// scripts are allowed. We only do that if targetDoc->NodePrincipal()
// subsumes loadInfo->TriggeringPrincipal(). If it doesn't, then
// someone more-privileged (our UI or an extension) started the
// load and hence the load should not be subject to the target
// document's CSP.
//
// The "more privileged" assumption is safe, because if the triggering
// principal does not subsume targetDoc->NodePrincipal() we won't run the
// script at all. More precisely, we test that "principal" subsumes the
// target's principal, but "principal" should never be higher-privilege
// than the triggering principal here: it's either the triggering
// principal, or the principal of the document we started the load
// against if the triggering principal is system.
if (targetDoc->NodePrincipal()->Subsumes(loadInfo->TriggeringPrincipal())) {
nsCOMPtr<nsIContentSecurityPolicy> targetCSP = targetDoc->GetCsp();
if (!AllowedByCSP(targetCSP)) {
return NS_ERROR_DOM_RETVAL_UNDEFINED;
}
}
}
// Push our popup control state

Просмотреть файл

@ -78,15 +78,15 @@ class MediaSpan {
// append the new data into it.
RefPtr<MediaByteBuffer> buffer =
new MediaByteBuffer(mLength + aBuffer->Length());
if (!buffer->AppendElements(Elements(), Length()) ||
!buffer->AppendElements(*aBuffer)) {
if (!buffer->AppendElements(Elements(), Length(), fallible) ||
!buffer->AppendElements(*aBuffer, fallible)) {
return false;
}
mBuffer = buffer;
mLength += aBuffer->Length();
return true;
}
if (!mBuffer->AppendElements(*aBuffer)) {
if (!mBuffer->AppendElements(*aBuffer, fallible)) {
return false;
}
mLength += aBuffer->Length();

Просмотреть файл

@ -18,7 +18,6 @@
#include "SourceBufferList.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/HTMLMediaElement.h"
@ -110,13 +109,13 @@ nsresult MediaSource::IsTypeSupported(const nsAString& aType,
const MediaMIMEType& mimeType = containerType->Type();
if (mimeType == MEDIAMIMETYPE("video/mp4") ||
mimeType == MEDIAMIMETYPE("audio/mp4")) {
if (!Preferences::GetBool("media.mediasource.mp4.enabled", false)) {
if (!StaticPrefs::media_mediasource_mp4_enabled()) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
return NS_OK;
}
if (mimeType == MEDIAMIMETYPE("video/webm")) {
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
if (!(StaticPrefs::media_mediasource_webm_enabled() ||
StaticPrefs::media_media_capabilities_enabled() ||
containerType->ExtendedType().Codecs().Contains(
NS_LITERAL_STRING("vp8")) ||
@ -131,8 +130,8 @@ nsresult MediaSource::IsTypeSupported(const nsAString& aType,
return NS_OK;
}
if (mimeType == MEDIAMIMETYPE("audio/webm")) {
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
Preferences::GetBool("media.mediasource.webm.audio.enabled", true))) {
if (!(StaticPrefs::media_mediasource_webm_enabled() ||
StaticPrefs::media_mediasource_webm_audio_enabled())) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
return NS_OK;
@ -428,16 +427,6 @@ bool MediaSource::IsTypeSupported(const GlobalObject& aOwner,
return NS_SUCCEEDED(rv);
}
/* static */
bool MediaSource::Enabled(JSContext* cx, JSObject* aGlobal) {
return Preferences::GetBool("media.mediasource.enabled");
}
/* static */
bool MediaSource::ExperimentalEnabled(JSContext* cx, JSObject* aGlobal) {
return Preferences::GetBool("media.mediasource.experimental.enabled");
}
void MediaSource::SetLiveSeekableRange(double aStart, double aEnd,
ErrorResult& aRv) {
MOZ_ASSERT(NS_IsMainThread());

Просмотреть файл

@ -83,9 +83,6 @@ class MediaSource final : public DOMEventTargetHelper,
static nsresult IsTypeSupported(const nsAString& aType,
DecoderDoctorDiagnostics* aDiagnostics);
static bool Enabled(JSContext* cx, JSObject* aGlobal);
static bool ExperimentalEnabled(JSContext* cx, JSObject* aGlobal);
IMPL_EVENT_HANDLER(sourceopen);
IMPL_EVENT_HANDLER(sourceended);
IMPL_EVENT_HANDLER(sourceclosed);

Просмотреть файл

@ -0,0 +1,10 @@
<html>
<head>
<title>Test setting parent location to javascript:</title>
</head>
<body>
<script>
parent.window.location ="javascript:location.href";
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,18 @@
<html>
<head>
<title>Test setting parent location to javascript:</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'nonce-bug1550414'">
<script nonce="bug1550414">
document.addEventListener("securitypolicyviolation", (e) => {
window.parent.postMessage({
blockedURI: e.blockedURI,
violatedDirective: e.violatedDirective,
originalPolicy: e.originalPolicy,
}, '*');
});
</script>
</head>
<body>
<iframe src="file_iframe_parent_location_js.html"></iframe>
</body>
</html>

Просмотреть файл

@ -391,3 +391,7 @@ fail-if = fission
skip-if = (toolkit == 'android') || (os == 'win' && bits == 32)
support-files =
file_reloadInFreshProcess.sjs
[test_parent_location_js.html]
support-files =
file_parent_location_js.html
file_iframe_parent_location_js.html

Просмотреть файл

@ -0,0 +1,38 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Bug 1550414: Add CSP test for setting parent location to javascript:</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<iframe style="width:100%;" id="testframe"></iframe>
<script class="testbody" type="text/javascript">
/**
* Description of the test:
* Load a document with a CSP of essentially script-src 'none' which includes a
* same origin iframe which tries to modify the parent.location using a javascript:
* URI -> make sure the javascript: URI is blocked correctly!
*/
SimpleTest.waitForExplicitFinish();
function receiveMessage(event) {
window.removeEventListener("message", receiveMessage);
is(event.data.blockedURI, "inline", "blockedURI");
is(event.data.violatedDirective, "script-src", "violatedDirective")
is(event.data.originalPolicy, "script-src 'nonce-bug1550414'", "originalPolicy");
SimpleTest.finish();
}
// using a postMessage handler to report the result back from
// within the sandboxed iframe without 'allow-same-origin'.
window.addEventListener("message", receiveMessage);
document.getElementById("testframe").src = "file_parent_location_js.html";
</script>
</body>
</html>

Просмотреть файл

@ -79,6 +79,6 @@ partial interface HTMLVideoElement {
// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
partial interface HTMLVideoElement {
[Func="mozilla::dom::MediaSource::Enabled", NewObject]
[Pref="media.mediasource.enabled", NewObject]
VideoPlaybackQuality getVideoPlaybackQuality();
};

Просмотреть файл

@ -21,7 +21,7 @@ enum MediaSourceEndOfStreamError {
"decode"
};
[Constructor, Func="mozilla::dom::MediaSource::Enabled"]
[Constructor, Pref="media.mediasource.enabled"]
interface MediaSource : EventTarget {
readonly attribute SourceBufferList sourceBuffers;
readonly attribute SourceBufferList activeSourceBuffers;

Просмотреть файл

@ -15,7 +15,7 @@ enum SourceBufferAppendMode {
"sequence"
};
[Func="mozilla::dom::MediaSource::Enabled"]
[Pref="media.mediasource.enabled"]
interface SourceBuffer : EventTarget {
[SetterThrows]
attribute SourceBufferAppendMode mode;
@ -42,9 +42,9 @@ interface SourceBuffer : EventTarget {
void appendBuffer(ArrayBufferView data);
// Experimental function as proposed in:
// https://github.com/w3c/media-source/issues/100 for promise proposal.
[Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
[Throws, Pref="media.mediasource.experimental.enabled"]
Promise<void> appendBufferAsync(ArrayBuffer data);
[Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
[Throws, Pref="media.mediasource.experimental.enabled"]
Promise<void> appendBufferAsync(ArrayBufferView data);
//[Throws]
//void appendStream(Stream stream, [EnforceRange] optional unsigned long long maxSize);
@ -54,7 +54,7 @@ interface SourceBuffer : EventTarget {
void remove(double start, unrestricted double end);
// Experimental function as proposed in:
// https://github.com/w3c/media-source/issues/100 for promise proposal.
[Throws, Func="mozilla::dom::MediaSource::ExperimentalEnabled"]
[Throws, Pref="media.mediasource.experimental.enabled"]
Promise<void> removeAsync(double start, unrestricted double end);
// Experimental function as proposed in:
// https://github.com/w3c/media-source/issues/155

Просмотреть файл

@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Func="mozilla::dom::MediaSource::Enabled"]
[Pref="media.mediasource.enabled"]
interface SourceBufferList : EventTarget {
readonly attribute unsigned long length;
attribute EventHandler onaddsourcebuffer;

Просмотреть файл

@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Func="mozilla::dom::MediaSource::Enabled"]
[Pref="media.mediasource.enabled"]
interface VideoPlaybackQuality {
readonly attribute DOMHighResTimeStamp creationTime;
readonly attribute unsigned long totalVideoFrames;

Просмотреть файл

@ -10,6 +10,7 @@
// These declarations are highly likely to change in the future. Depend on them
// at your own risk.
#include "mozilla/Maybe.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/TypeTraits.h"
@ -30,7 +31,7 @@ namespace JS {
struct TabSizes {
enum Kind { Objects, Strings, Private, Other };
TabSizes() : objects(0), strings(0), private_(0), other(0) {}
TabSizes() = default;
void add(Kind kind, size_t n) {
switch (kind) {
@ -51,10 +52,10 @@ struct TabSizes {
}
}
size_t objects;
size_t strings;
size_t private_;
size_t other;
size_t objects = 0;
size_t strings = 0;
size_t private_ = 0;
size_t other = 0;
};
/** These are the measurements used by Servo. */
@ -148,9 +149,7 @@ struct InefficientNonFlatteningStringHashPolicy {
// In some classes, one or more of the macro arguments aren't used. We use '_'
// for those.
//
#define DECL_SIZE(tabKind, servoKind, mSize) size_t mSize;
#define ZERO_SIZE(tabKind, servoKind, mSize) mSize(0),
#define COPY_OTHER_SIZE(tabKind, servoKind, mSize) mSize(other.mSize),
#define DECL_SIZE_ZERO(tabKind, servoKind, mSize) size_t mSize = 0;
#define ADD_OTHER_SIZE(tabKind, servoKind, mSize) mSize += other.mSize;
#define SUB_OTHER_SIZE(tabKind, servoKind, mSize) \
MOZ_ASSERT(mSize >= other.mSize); \
@ -183,15 +182,15 @@ struct ClassInfo {
MACRO(Objects, NonHeap, objectsNonHeapElementsWasm) \
MACRO(Objects, NonHeap, objectsNonHeapCodeWasm)
ClassInfo() : FOR_EACH_SIZE(ZERO_SIZE) wasmGuardPages(0) {}
ClassInfo() = default;
void add(const ClassInfo& other) { FOR_EACH_SIZE(ADD_OTHER_SIZE) }
void add(const ClassInfo& other) { FOR_EACH_SIZE(ADD_OTHER_SIZE); }
void subtract(const ClassInfo& other){FOR_EACH_SIZE(SUB_OTHER_SIZE)}
void subtract(const ClassInfo& other) { FOR_EACH_SIZE(SUB_OTHER_SIZE); }
size_t sizeOfAllThings() const {
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N)
FOR_EACH_SIZE(ADD_SIZE_TO_N);
return n;
}
@ -202,16 +201,19 @@ struct ClassInfo {
size_t sizeOfLiveGCThings() const {
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING)
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING);
return n;
}
void addToTabSizes(TabSizes* sizes) const { FOR_EACH_SIZE(ADD_TO_TAB_SIZES) }
void addToTabSizes(TabSizes* sizes) const { FOR_EACH_SIZE(ADD_TO_TAB_SIZES); }
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)}
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
}
FOR_EACH_SIZE(DECL_SIZE) size_t wasmGuardPages;
FOR_EACH_SIZE(DECL_SIZE_ZERO);
size_t wasmGuardPages = 0;
#undef FOR_EACH_SIZE
};
@ -225,31 +227,31 @@ struct ShapeInfo {
MACRO(Other, MallocHeap, shapesMallocHeapDictTables) \
MACRO(Other, MallocHeap, shapesMallocHeapTreeKids)
ShapeInfo() : FOR_EACH_SIZE(ZERO_SIZE) dummy() {}
ShapeInfo() = default;
void add(const ShapeInfo& other) { FOR_EACH_SIZE(ADD_OTHER_SIZE) }
void add(const ShapeInfo& other) { FOR_EACH_SIZE(ADD_OTHER_SIZE); }
void subtract(const ShapeInfo& other){FOR_EACH_SIZE(SUB_OTHER_SIZE)}
void subtract(const ShapeInfo& other) { FOR_EACH_SIZE(SUB_OTHER_SIZE); }
size_t sizeOfAllThings() const {
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N)
FOR_EACH_SIZE(ADD_SIZE_TO_N);
return n;
}
size_t sizeOfLiveGCThings() const {
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING)
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING);
return n;
}
void addToTabSizes(TabSizes* sizes) const { FOR_EACH_SIZE(ADD_TO_TAB_SIZES) }
void addToTabSizes(TabSizes* sizes) const { FOR_EACH_SIZE(ADD_TO_TAB_SIZES); }
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)}
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
}
FOR_EACH_SIZE(DECL_SIZE) int dummy; // present just to absorb the trailing
// comma from FOR_EACH_SIZE(ZERO_SIZE)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
#undef FOR_EACH_SIZE
};
@ -285,13 +287,13 @@ struct CodeSizes {
MACRO(_, NonHeap, other) \
MACRO(_, NonHeap, unused)
CodeSizes() : FOR_EACH_SIZE(ZERO_SIZE) dummy() {}
CodeSizes() = default;
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)}
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
}
FOR_EACH_SIZE(DECL_SIZE) int dummy; // present just to absorb the trailing
// comma from FOR_EACH_SIZE(ZERO_SIZE)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
#undef FOR_EACH_SIZE
};
@ -310,13 +312,13 @@ struct GCSizes {
MACRO(_, MallocHeap, storeBufferWholeCells) \
MACRO(_, MallocHeap, storeBufferGenerics)
GCSizes() : FOR_EACH_SIZE(ZERO_SIZE) dummy() {}
GCSizes() = default;
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)}
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
}
FOR_EACH_SIZE(DECL_SIZE) int dummy; // present just to absorb the trailing
// comma from FOR_EACH_SIZE(ZERO_SIZE)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
#undef FOR_EACH_SIZE
};
@ -335,7 +337,7 @@ struct StringInfo {
MACRO(Strings, MallocHeap, mallocHeapLatin1) \
MACRO(Strings, MallocHeap, mallocHeapTwoByte)
StringInfo() : FOR_EACH_SIZE(ZERO_SIZE) numCopies(0) {}
StringInfo() = default;
void add(const StringInfo& other) {
FOR_EACH_SIZE(ADD_OTHER_SIZE);
@ -350,23 +352,25 @@ struct StringInfo {
bool isNotable() const {
static const size_t NotabilityThreshold = 16 * 1024;
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N)
FOR_EACH_SIZE(ADD_SIZE_TO_N);
return n >= NotabilityThreshold;
}
size_t sizeOfLiveGCThings() const {
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING)
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING);
return n;
}
void addToTabSizes(TabSizes* sizes) const { FOR_EACH_SIZE(ADD_TO_TAB_SIZES) }
void addToTabSizes(TabSizes* sizes) const { FOR_EACH_SIZE(ADD_TO_TAB_SIZES); }
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)}
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
}
FOR_EACH_SIZE(DECL_SIZE)
uint32_t numCopies; // How many copies of the string have we seen?
FOR_EACH_SIZE(DECL_SIZE_ZERO);
uint32_t numCopies = 0; // How many copies of the string have we seen?
#undef FOR_EACH_SIZE
};
@ -402,33 +406,34 @@ struct NotableStringInfo : public StringInfo {
struct ScriptSourceInfo {
#define FOR_EACH_SIZE(MACRO) MACRO(_, MallocHeap, misc)
ScriptSourceInfo() : FOR_EACH_SIZE(ZERO_SIZE) numScripts(0) {}
ScriptSourceInfo() = default;
void add(const ScriptSourceInfo& other) {
FOR_EACH_SIZE(ADD_OTHER_SIZE)
FOR_EACH_SIZE(ADD_OTHER_SIZE);
numScripts++;
}
void subtract(const ScriptSourceInfo& other) {
FOR_EACH_SIZE(SUB_OTHER_SIZE)
FOR_EACH_SIZE(SUB_OTHER_SIZE);
numScripts--;
}
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
}
bool isNotable() const {
static const size_t NotabilityThreshold = 16 * 1024;
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N)
FOR_EACH_SIZE(ADD_SIZE_TO_N);
return n >= NotabilityThreshold;
}
FOR_EACH_SIZE(DECL_SIZE)
uint32_t numScripts; // How many ScriptSources come from this file? (It
// can be more than one in XML files that have
// multiple scripts in CDATA sections.)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
uint32_t numScripts = 0; // How many ScriptSources come from this file? (It
// can be more than one in XML files that have
// multiple scripts in CDATA sections.)
#undef FOR_EACH_SIZE
};
@ -461,13 +466,12 @@ struct HelperThreadStats {
MACRO(_, MallocHeap, ionBuilder) \
MACRO(_, MallocHeap, wasmCompile)
explicit HelperThreadStats()
: FOR_EACH_SIZE(ZERO_SIZE) idleThreadCount(0), activeThreadCount(0) {}
HelperThreadStats() = default;
FOR_EACH_SIZE(DECL_SIZE)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
unsigned idleThreadCount;
unsigned activeThreadCount;
unsigned idleThreadCount = 0;
unsigned activeThreadCount = 0;
#undef FOR_EACH_SIZE
};
@ -479,9 +483,9 @@ struct GlobalStats {
#define FOR_EACH_SIZE(MACRO) MACRO(_, MallocHeap, tracelogger)
explicit GlobalStats(mozilla::MallocSizeOf mallocSizeOf)
: FOR_EACH_SIZE(ZERO_SIZE) mallocSizeOf_(mallocSizeOf) {}
: mallocSizeOf_(mallocSizeOf) {}
FOR_EACH_SIZE(DECL_SIZE)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
HelperThreadStats helperThread;
@ -510,36 +514,21 @@ struct RuntimeSizes {
MACRO(_, MallocHeap, wasmRuntime) \
MACRO(_, MallocHeap, jitLazyLink)
RuntimeSizes()
: FOR_EACH_SIZE(ZERO_SIZE) scriptSourceInfo(),
code(),
gc(),
notableScriptSources() {
allScriptSources = js_new<ScriptSourcesHashMap>();
if (!allScriptSources) {
MOZ_CRASH("oom");
}
}
~RuntimeSizes() {
// |allScriptSources| is usually deleted and set to nullptr before this
// destructor runs. But there are failure cases due to OOMs that may
// prevent that, so it doesn't hurt to try again here.
js_delete(allScriptSources);
}
RuntimeSizes() { allScriptSources.emplace(); }
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
scriptSourceInfo.addToServoSizes(sizes);
code.addToServoSizes(sizes);
gc.addToServoSizes(sizes);
}
FOR_EACH_SIZE(DECL_SIZE_ZERO);
// The script source measurements in |scriptSourceInfo| are initially for
// all script sources. At the end, if the measurement granularity is
// FineGrained, we subtract the measurements of the notable script sources
// and move them into |notableScriptSources|.
FOR_EACH_SIZE(DECL_SIZE)
ScriptSourceInfo scriptSourceInfo;
CodeSizes code;
GCSizes gc;
@ -552,7 +541,7 @@ struct RuntimeSizes {
// it is filled with info about every script source in the runtime. It's
// then used to fill in |notableScriptSources| (which actually gets
// reported), and immediately discarded afterwards.
ScriptSourcesHashMap* allScriptSources;
mozilla::Maybe<ScriptSourcesHashMap> allScriptSources;
js::Vector<NotableScriptSourceInfo, 0, js::SystemAllocPolicy>
notableScriptSources;
@ -574,10 +563,8 @@ struct UnusedGCThingSizes {
MACRO(Other, GCHeapUnused, scope) \
MACRO(Other, GCHeapUnused, regExpShared)
UnusedGCThingSizes() : FOR_EACH_SIZE(ZERO_SIZE) dummy() {}
UnusedGCThingSizes(UnusedGCThingSizes&& other)
: FOR_EACH_SIZE(COPY_OTHER_SIZE) dummy() {}
UnusedGCThingSizes() = default;
UnusedGCThingSizes(UnusedGCThingSizes&& other) = default;
void addToKind(JS::TraceKind kind, intptr_t n) {
switch (kind) {
@ -622,23 +609,25 @@ struct UnusedGCThingSizes {
}
}
void addSizes(const UnusedGCThingSizes& other){FOR_EACH_SIZE(ADD_OTHER_SIZE)}
void addSizes(const UnusedGCThingSizes& other) {
FOR_EACH_SIZE(ADD_OTHER_SIZE);
}
size_t totalSize() const {
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N)
FOR_EACH_SIZE(ADD_SIZE_TO_N);
return n;
}
void addToTabSizes(JS::TabSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_TAB_SIZES)
FOR_EACH_SIZE(ADD_TO_TAB_SIZES);
}
void addToServoSizes(JS::ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)}
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
}
FOR_EACH_SIZE(DECL_SIZE) int dummy; // present just to absorb the trailing
// comma from FOR_EACH_SIZE(ZERO_SIZE)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
#undef FOR_EACH_SIZE
};
@ -669,40 +658,14 @@ struct ZoneStats {
MACRO(Other, MallocHeap, crossCompartmentWrappersTables) \
MACRO(Other, MallocHeap, compartmentsPrivateData)
ZoneStats()
: FOR_EACH_SIZE(ZERO_SIZE) unusedGCThings(),
stringInfo(),
shapeInfo(),
extra(),
allStrings(nullptr),
notableStrings(),
isTotals(true) {}
ZoneStats() = default;
ZoneStats(ZoneStats&& other) = default;
ZoneStats(ZoneStats&& other)
: FOR_EACH_SIZE(COPY_OTHER_SIZE)
unusedGCThings(std::move(other.unusedGCThings)),
stringInfo(std::move(other.stringInfo)),
shapeInfo(std::move(other.shapeInfo)),
extra(other.extra),
allStrings(other.allStrings),
notableStrings(std::move(other.notableStrings)),
isTotals(other.isTotals) {
other.allStrings = nullptr;
MOZ_ASSERT(!other.isTotals);
}
~ZoneStats() {
// |allStrings| is usually deleted and set to nullptr before this
// destructor runs. But there are failure cases due to OOMs that may
// prevent that, so it doesn't hurt to try again here.
js_delete(allStrings);
}
bool initStrings();
void initStrings();
void addSizes(const ZoneStats& other) {
MOZ_ASSERT(isTotals);
FOR_EACH_SIZE(ADD_OTHER_SIZE)
FOR_EACH_SIZE(ADD_OTHER_SIZE);
unusedGCThings.addSizes(other.unusedGCThings);
stringInfo.add(other.stringInfo);
shapeInfo.add(other.shapeInfo);
@ -711,7 +674,7 @@ struct ZoneStats {
size_t sizeOfLiveGCThings() const {
MOZ_ASSERT(isTotals);
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING)
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING);
n += stringInfo.sizeOfLiveGCThings();
n += shapeInfo.sizeOfLiveGCThings();
return n;
@ -719,7 +682,7 @@ struct ZoneStats {
void addToTabSizes(JS::TabSizes* sizes) const {
MOZ_ASSERT(isTotals);
FOR_EACH_SIZE(ADD_TO_TAB_SIZES)
FOR_EACH_SIZE(ADD_TO_TAB_SIZES);
unusedGCThings.addToTabSizes(sizes);
stringInfo.addToTabSizes(sizes);
shapeInfo.addToTabSizes(sizes);
@ -727,21 +690,22 @@ struct ZoneStats {
void addToServoSizes(JS::ServoSizes* sizes) const {
MOZ_ASSERT(isTotals);
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
unusedGCThings.addToServoSizes(sizes);
stringInfo.addToServoSizes(sizes);
shapeInfo.addToServoSizes(sizes);
}
FOR_EACH_SIZE(DECL_SIZE_ZERO);
// These string measurements are initially for all strings. At the end,
// if the measurement granularity is FineGrained, we subtract the
// measurements of the notable script sources and move them into
// |notableStrings|.
FOR_EACH_SIZE(DECL_SIZE)
UnusedGCThingSizes unusedGCThings;
StringInfo stringInfo;
ShapeInfo shapeInfo;
void* extra; // This field can be used by embedders.
void* extra = nullptr; // This field can be used by embedders.
typedef js::HashMap<JSString*, StringInfo,
js::InefficientNonFlatteningStringHashPolicy,
@ -752,9 +716,9 @@ struct ZoneStats {
// filled with info about every string in the zone. It's then used to fill
// in |notableStrings| (which actually gets reported), and immediately
// discarded afterwards.
StringsHashMap* allStrings;
mozilla::Maybe<StringsHashMap> allStrings;
js::Vector<NotableStringInfo, 0, js::SystemAllocPolicy> notableStrings;
bool isTotals;
bool isTotals = true;
#undef FOR_EACH_SIZE
};
@ -786,44 +750,23 @@ struct RealmStats {
MACRO(Other, MallocHeap, jitRealm) \
MACRO(Other, MallocHeap, scriptCountsMap)
RealmStats()
: FOR_EACH_SIZE(ZERO_SIZE) classInfo(),
extra(),
allClasses(nullptr),
notableClasses(),
isTotals(true) {}
RealmStats(RealmStats&& other)
: FOR_EACH_SIZE(COPY_OTHER_SIZE) classInfo(std::move(other.classInfo)),
extra(other.extra),
allClasses(other.allClasses),
notableClasses(std::move(other.notableClasses)),
isTotals(other.isTotals) {
other.allClasses = nullptr;
MOZ_ASSERT(!other.isTotals);
}
RealmStats() = default;
RealmStats(RealmStats&& other) = default;
RealmStats(const RealmStats&) = delete; // disallow copying
~RealmStats() {
// |allClasses| is usually deleted and set to nullptr before this
// destructor runs. But there are failure cases due to OOMs that may
// prevent that, so it doesn't hurt to try again here.
js_delete(allClasses);
}
bool initClasses();
void initClasses();
void addSizes(const RealmStats& other) {
MOZ_ASSERT(isTotals);
FOR_EACH_SIZE(ADD_OTHER_SIZE)
FOR_EACH_SIZE(ADD_OTHER_SIZE);
classInfo.add(other.classInfo);
}
size_t sizeOfLiveGCThings() const {
MOZ_ASSERT(isTotals);
size_t n = 0;
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING)
FOR_EACH_SIZE(ADD_SIZE_TO_N_IF_LIVE_GC_THING);
n += classInfo.sizeOfLiveGCThings();
return n;
}
@ -840,21 +783,22 @@ struct RealmStats {
classInfo.addToServoSizes(sizes);
}
FOR_EACH_SIZE(DECL_SIZE_ZERO);
// The class measurements in |classInfo| are initially for all classes. At
// the end, if the measurement granularity is FineGrained, we subtract the
// measurements of the notable classes and move them into |notableClasses|.
FOR_EACH_SIZE(DECL_SIZE)
ClassInfo classInfo;
void* extra; // This field can be used by embedders.
void* extra = nullptr; // This field can be used by embedders.
typedef js::HashMap<const char*, ClassInfo, mozilla::CStringHasher,
js::SystemAllocPolicy>
ClassesHashMap;
// These are similar to |allStrings| and |notableStrings| in ZoneStats.
ClassesHashMap* allClasses;
mozilla::Maybe<ClassesHashMap> allClasses;
js::Vector<NotableClassInfo, 0, js::SystemAllocPolicy> notableClasses;
bool isTotals;
bool isTotals = true;
#undef FOR_EACH_SIZE
};
@ -877,13 +821,7 @@ struct RuntimeStats {
MACRO(_, Ignore, gcHeapGCThings)
explicit RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)
: FOR_EACH_SIZE(ZERO_SIZE) runtime(),
realmTotals(),
zTotals(),
realmStatsVector(),
zoneStatsVector(),
currZoneStats(nullptr),
mallocSizeOf_(mallocSizeOf) {}
: mallocSizeOf_(mallocSizeOf) {}
// Here's a useful breakdown of the GC heap.
//
@ -909,11 +847,11 @@ struct RuntimeStats {
// multiple of the chunk size, which is good.
void addToServoSizes(ServoSizes* sizes) const {
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES)
FOR_EACH_SIZE(ADD_TO_SERVO_SIZES);
runtime.addToServoSizes(sizes);
}
FOR_EACH_SIZE(DECL_SIZE)
FOR_EACH_SIZE(DECL_SIZE_ZERO);
RuntimeSizes runtime;
@ -923,7 +861,7 @@ struct RuntimeStats {
RealmStatsVector realmStatsVector;
ZoneStatsVector zoneStatsVector;
ZoneStats* currZoneStats;
ZoneStats* currZoneStats = nullptr;
mozilla::MallocSizeOf mallocSizeOf_;
@ -976,9 +914,7 @@ extern JS_PUBLIC_API bool AddServoSizeOf(JSContext* cx,
} // namespace JS
#undef DECL_SIZE
#undef ZERO_SIZE
#undef COPY_OTHER_SIZE
#undef DECL_SIZE_ZERO
#undef ADD_OTHER_SIZE
#undef SUB_OTHER_SIZE
#undef ADD_SIZE_TO_N

Просмотреть файл

@ -30,8 +30,9 @@ install:: $(LIBRARY_NAME).pc
cp $^ $(JS_LIBRARY_NAME).pc
$(SYSINSTALL) $(JS_LIBRARY_NAME).pc $(DESTDIR)$(libdir)/pkgconfig
install:: ../js-config.h
$(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(JS_LIBRARY_NAME)
install:: ../js-config.h ../js-confdefs.h
$(SYSINSTALL) -m644 ../js-config.h $(DESTDIR)$(includedir)/$(JS_LIBRARY_NAME)
$(SYSINSTALL) -m644 ../js-confdefs.h $(DESTDIR)$(includedir)/$(JS_LIBRARY_NAME)
######################################################
# BEGIN SpiderMonkey header installation

Просмотреть файл

@ -108,7 +108,7 @@ if test "$echo_libdir" = "yes"; then
fi
if test "$echo_cflags" = "yes"; then
echo "-std=gnu++11 -include $includedir/$JS_LIBRARY_NAME/js/RequiredDefines.h -I$includedir/$JS_LIBRARY_NAME $NSPR_CFLAGS"
echo "-std=gnu++11 -include $includedir/$JS_LIBRARY_NAME/js-confdefs.h -isystem $includedir/$JS_LIBRARY_NAME $NSPR_CFLAGS"
fi
if test "$echo_libs" = "yes"; then

Просмотреть файл

@ -11,4 +11,4 @@ Libs: -L${libdir} -l@JS_LIBRARY_NAME@
# Use -isystem for includes rather than -I, to mark them as "system headers"
# that don't generate warning diagnostics. For justification, see
# https://bugzilla.mozilla.org/show_bug.cgi?id=1539036
Cflags: -include ${includedir}/@JS_LIBRARY_NAME@/js/RequiredDefines.h -isystem ${includedir}/@JS_LIBRARY_NAME@
Cflags: -include ${includedir}/@JS_LIBRARY_NAME@/js-confdefs.h -isystem ${includedir}/@JS_LIBRARY_NAME@

Просмотреть файл

@ -2024,6 +2024,7 @@ JSFunction* AllocNewFunction(JSContext* cx, HandleAtom atom,
}
if (isSelfHosting) {
fun->setIsSelfHostedBuiltin();
MOZ_ASSERT(!fun->isInterpretedLazy());
}
return fun;
}

Просмотреть файл

@ -492,18 +492,9 @@ bool BaselineCacheIRCompiler::emitCallScriptedGetterResultShared(
AutoScratchRegister callee(allocator, masm);
AutoScratchRegister scratch(allocator, masm);
// First, ensure our getter is non-lazy.
{
FailurePath* failure;
if (!addFailurePath(&failure)) {
return false;
}
masm.loadPtr(getterAddr, callee);
masm.branchIfFunctionHasNoJitEntry(callee, /* constructing */ false,
failure->label());
masm.loadJitCodeRaw(callee, code);
}
// First, retrieve jitCodeRaw for getter.
masm.loadPtr(getterAddr, callee);
masm.loadJitCodeRaw(callee, code);
allocator.discardStack(masm);
@ -1547,18 +1538,8 @@ bool BaselineCacheIRCompiler::emitCallScriptedSetter() {
ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId());
bool isSameRealm = reader.readBool();
// First, ensure our setter is non-lazy. This also loads the callee in
// scratch1.
{
FailurePath* failure;
if (!addFailurePath(&failure)) {
return false;
}
masm.loadPtr(setterAddr, scratch1);
masm.branchIfFunctionHasNoJitEntry(scratch1, /* constructing */ false,
failure->label());
}
// First, load the callee in scratch1.
masm.loadPtr(setterAddr, scratch1);
allocator.discardStack(masm);

Просмотреть файл

@ -56,11 +56,15 @@ BaselineCompilerHandler::BaselineCompilerHandler(JSContext* cx,
: frame_(script, masm),
alloc_(alloc),
analysis_(alloc, script),
#ifdef DEBUG
masm_(masm),
#endif
script_(script),
pc_(script->code()),
icEntryIndex_(0),
compileDebugInstrumentation_(script->isDebuggee()),
ionCompileable_(jit::IsIonEnabled() && CanIonCompileScript(cx, script)) {}
ionCompileable_(jit::IsIonEnabled() && CanIonCompileScript(cx, script)) {
}
BaselineInterpreterHandler::BaselineInterpreterHandler(JSContext* cx,
MacroAssembler& masm)
@ -126,6 +130,29 @@ bool BaselineCompiler::init() {
return true;
}
bool BaselineCompilerHandler::appendRetAddrEntry(JSContext* cx,
RetAddrEntry::Kind kind,
uint32_t retOffset) {
uint32_t pcOffset = script_->pcToOffset(pc_);
// Entries must be sorted by pcOffset for binary search to work.
// See BaselineScript::retAddrEntryFromPCOffset.
MOZ_ASSERT_IF(!retAddrEntries_.empty(),
retAddrEntries_.back().pcOffset() <= pcOffset);
// Similarly, entries must be sorted by return offset and this offset must be
// unique. See BaselineScript::retAddrEntryFromReturnOffset.
MOZ_ASSERT_IF(!retAddrEntries_.empty() && !masm_.oom(),
retAddrEntries_.back().returnOffset().offset() < retOffset);
if (!retAddrEntries_.emplaceBack(pcOffset, kind, CodeOffset(retOffset))) {
ReportOutOfMemory(cx);
return false;
}
return true;
}
bool BaselineCompiler::addPCMappingEntry(bool addIndexEntry) {
// Don't add multiple entries for a single pc.
size_t nentries = pcMappingEntries_.length();
@ -677,6 +704,7 @@ void BaselineInterpreterCodeGen::storeFrameSizeAndPushDescriptor(
template <typename Handler>
bool BaselineCodeGen<Handler>::callVMInternal(VMFunctionId id,
RetAddrEntry::Kind kind,
CallVMPhase phase) {
#ifdef DEBUG
// Assert prepareVMCall() has been called.
@ -745,14 +773,15 @@ bool BaselineCodeGen<Handler>::callVMInternal(VMFunctionId id,
}
#endif
return handler.appendRetAddrEntry(cx, RetAddrEntry::Kind::CallVM, callOffset);
return handler.appendRetAddrEntry(cx, kind, callOffset);
}
template <typename Handler>
template <typename Fn, Fn fn>
bool BaselineCodeGen<Handler>::callVM(CallVMPhase phase) {
bool BaselineCodeGen<Handler>::callVM(RetAddrEntry::Kind kind,
CallVMPhase phase) {
VMFunctionId fnId = VMFunctionToId<Fn, fn>::id;
return callVMInternal(fnId, phase);
return callVMInternal(fnId, kind, phase);
}
template <typename Handler>
@ -777,14 +806,13 @@ bool BaselineCodeGen<Handler>::emitStackCheck() {
pushArg(R1.scratchReg());
const CallVMPhase phase = CallVMPhase::BeforePushingLocals;
const RetAddrEntry::Kind kind = RetAddrEntry::Kind::StackCheck;
using Fn = bool (*)(JSContext*, BaselineFrame*);
if (!callVMNonOp<Fn, CheckOverRecursedBaseline>(phase)) {
if (!callVM<Fn, CheckOverRecursedBaseline>(kind, phase)) {
return false;
}
handler.markLastRetAddrEntryKind(RetAddrEntry::Kind::StackCheck);
masm.bind(&skipCall);
return true;
}
@ -1109,14 +1137,13 @@ bool BaselineCodeGen<Handler>::emitDebugPrologue() {
pushBytecodePCArg();
pushArg(R0.scratchReg());
const RetAddrEntry::Kind kind = RetAddrEntry::Kind::DebugPrologue;
using Fn = bool (*)(JSContext*, BaselineFrame*, jsbytecode*, bool*);
if (!callVM<Fn, jit::DebugPrologue>()) {
if (!callVM<Fn, jit::DebugPrologue>(kind)) {
return false;
}
// Fix up the RetAddrEntry appended by callVM for on-stack recompilation.
handler.markLastRetAddrEntryKind(RetAddrEntry::Kind::DebugPrologue);
// If the stub returns |true|, we have to return the value stored in the
// frame's return value slot.
Label done;
@ -1382,13 +1409,12 @@ bool BaselineCompilerCodeGen::emitWarmUpCounterIncrement() {
pushBytecodePCArg();
masm.PushBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
const RetAddrEntry::Kind kind = RetAddrEntry::Kind::WarmupCounter;
using Fn = bool (*)(JSContext*, BaselineFrame*, jsbytecode*);
if (!callVM<Fn, IonCompileScriptForBaseline>()) {
if (!callVM<Fn, IonCompileScriptForBaseline>(kind)) {
return false;
}
// Annotate the RetAddrEntry as warmup counter.
handler.markLastRetAddrEntryKind(RetAddrEntry::Kind::WarmupCounter);
}
masm.bind(&skipCall);
@ -5162,14 +5188,13 @@ bool BaselineCodeGen<Handler>::emitReturn() {
pushBytecodePCArg();
pushArg(R0.scratchReg());
const RetAddrEntry::Kind kind = RetAddrEntry::Kind::DebugEpilogue;
using Fn = bool (*)(JSContext*, BaselineFrame*, jsbytecode*);
if (!callVM<Fn, jit::DebugEpilogueOnBaselineReturn>()) {
if (!callVM<Fn, jit::DebugEpilogueOnBaselineReturn>(kind)) {
return false;
}
// Fix up the RetAddrEntry appended by callVM for on-stack recompilation.
handler.markLastRetAddrEntryKind(RetAddrEntry::Kind::DebugEpilogue);
masm.loadValue(frame.addressOfReturnValue(), JSReturnOperand);
return true;
};
@ -5963,13 +5988,13 @@ bool BaselineCodeGen<Handler>::emit_JSOP_AFTERYIELD() {
pushBytecodePCArg();
pushArg(R0.scratchReg());
const RetAddrEntry::Kind kind = RetAddrEntry::Kind::DebugAfterYield;
using Fn = bool (*)(JSContext*, BaselineFrame*, jsbytecode*, bool*);
if (!callVM<Fn, jit::DebugAfterYield>()) {
if (!callVM<Fn, jit::DebugAfterYield>(kind)) {
return false;
}
handler.markLastRetAddrEntryKind(RetAddrEntry::Kind::DebugAfterYield);
Label done;
masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, &done);
{

Просмотреть файл

@ -364,18 +364,16 @@ class BaselineCodeGen {
Register scratch1, Register scratch2);
enum class CallVMPhase { BeforePushingLocals, AfterPushingLocals };
bool callVMInternal(VMFunctionId id, CallVMPhase phase);
bool callVMInternal(VMFunctionId id, RetAddrEntry::Kind kind,
CallVMPhase phase);
template <typename Fn, Fn fn>
bool callVM(CallVMPhase phase = CallVMPhase::AfterPushingLocals);
bool callVM(RetAddrEntry::Kind kind = RetAddrEntry::Kind::CallVM,
CallVMPhase phase = CallVMPhase::AfterPushingLocals);
template <typename Fn, Fn fn>
bool callVMNonOp(CallVMPhase phase = CallVMPhase::AfterPushingLocals) {
if (!callVM<Fn, fn>(phase)) {
return false;
}
handler.markLastRetAddrEntryKind(RetAddrEntry::Kind::NonOpCallVM);
return true;
return callVM<Fn, fn>(RetAddrEntry::Kind::NonOpCallVM, phase);
}
// ifDebuggee should be a function emitting code for when the script is a
@ -529,6 +527,9 @@ class BaselineCompilerHandler {
CompilerFrameInfo frame_;
TempAllocator& alloc_;
BytecodeAnalysis analysis_;
#ifdef DEBUG
const MacroAssembler& masm_;
#endif
FixedList<Label> labels_;
RetAddrEntryVector retAddrEntries_;
JSScript* script_;
@ -585,17 +586,7 @@ class BaselineCompilerHandler {
RetAddrEntryVector& retAddrEntries() { return retAddrEntries_; }
MOZ_MUST_USE bool appendRetAddrEntry(JSContext* cx, RetAddrEntry::Kind kind,
uint32_t retOffset) {
if (!retAddrEntries_.emplaceBack(script_->pcToOffset(pc_), kind,
CodeOffset(retOffset))) {
ReportOutOfMemory(cx);
return false;
}
return true;
}
void markLastRetAddrEntryKind(RetAddrEntry::Kind kind) {
retAddrEntries_.back().setKind(kind);
}
uint32_t retOffset);
// If a script has more |nslots| than this the stack check must account
// for these slots explicitly.
@ -715,13 +706,12 @@ class BaselineInterpreterHandler {
return debugInstrumentationOffsets_.append(offset.offset());
}
// Interpreter doesn't need to keep track of RetAddrEntries, so these methods
// are no-ops.
// Interpreter doesn't need to keep track of RetAddrEntries, so this is a
// no-op.
MOZ_MUST_USE bool appendRetAddrEntry(JSContext* cx, RetAddrEntry::Kind kind,
uint32_t retOffset) {
return true;
}
void markLastRetAddrEntryKind(RetAddrEntry::Kind) {}
bool maybeIonCompileable() const { return true; }

Просмотреть файл

@ -650,22 +650,40 @@ RetAddrEntry& BaselineScript::retAddrEntryFromPCOffset(
MOZ_ALWAYS_TRUE(ComputeBinarySearchMid(RetAddrEntries(this), pcOffset, &mid));
MOZ_ASSERT(mid < numRetAddrEntries());
for (size_t i = mid; retAddrEntry(i).pcOffset() == pcOffset; i--) {
if (retAddrEntry(i).kind() == kind) {
return retAddrEntry(i);
}
if (i == 0) {
break;
}
// Search for the first entry for this pc.
size_t first = mid;
while (first > 0 && retAddrEntry(first - 1).pcOffset() == pcOffset) {
first--;
}
for (size_t i = mid + 1; i < numRetAddrEntries(); i++) {
if (retAddrEntry(i).pcOffset() != pcOffset) {
break;
}
if (retAddrEntry(i).kind() == kind) {
return retAddrEntry(i);
}
// Search for the last entry for this pc.
size_t last = mid;
while (last + 1 < numRetAddrEntries() &&
retAddrEntry(last + 1).pcOffset() == pcOffset) {
last++;
}
MOZ_ASSERT(first <= last);
MOZ_ASSERT(retAddrEntry(first).pcOffset() == pcOffset);
MOZ_ASSERT(retAddrEntry(last).pcOffset() == pcOffset);
for (size_t i = first; i <= last; i++) {
RetAddrEntry& entry = retAddrEntry(i);
if (entry.kind() != kind) {
continue;
}
#ifdef DEBUG
// There must be a unique entry for this pcOffset and Kind to ensure our
// return value is well-defined.
for (size_t j = i + 1; j <= last; j++) {
MOZ_ASSERT(retAddrEntry(j).kind() != kind);
}
#endif
return entry;
}
MOZ_CRASH("Didn't find RetAddrEntry.");
}

Просмотреть файл

@ -167,7 +167,9 @@ class RetAddrEntry {
public:
RetAddrEntry(uint32_t pcOffset, Kind kind, CodeOffset retOffset)
: returnOffset_(uint32_t(retOffset.offset())), pcOffset_(pcOffset) {
: returnOffset_(uint32_t(retOffset.offset())),
pcOffset_(pcOffset),
kind_(uint32_t(kind)) {
MOZ_ASSERT(returnOffset_ == retOffset.offset(),
"retOffset must fit in returnOffset_");
@ -176,14 +178,9 @@ class RetAddrEntry {
MOZ_ASSERT(pcOffset_ == pcOffset);
JS_STATIC_ASSERT(BaselineMaxScriptLength <= (1u << 28) - 1);
MOZ_ASSERT(pcOffset <= BaselineMaxScriptLength);
setKind(kind);
}
// Set the kind and asserts that it's sane.
void setKind(Kind kind) {
MOZ_ASSERT(kind < Kind::Invalid);
kind_ = uint32_t(kind);
MOZ_ASSERT(this->kind() == kind);
MOZ_ASSERT(this->kind() == kind, "kind must fit in kind_ bit field");
}
CodeOffset returnOffset() const { return CodeOffset(returnOffset_); }

Просмотреть файл

@ -5091,8 +5091,6 @@ AttachDecision CallIRGenerator::tryAttachCallScripted(
if (isSpecialized) {
// Ensure callee matches this stub's callee
calleeOffset = writer.guardSpecificFunction(calleeObjId, calleeFunc);
// Guard against relazification
writer.guardFunctionHasJitEntry(calleeObjId, isConstructing);
} else {
// Guard that object is a scripted function
writer.guardClass(calleeObjId, GuardClassKind::JSFunction);

Просмотреть файл

@ -4971,8 +4971,13 @@ void CodeGenerator::visitCallGeneric(LCallGeneric* call) {
if (call->mir()->isConstructing()) {
masm.branchIfNotInterpretedConstructor(calleereg, nargsreg, &invoke);
} else {
masm.branchIfFunctionHasNoJitEntry(calleereg, /* isConstructing */ false,
&invoke);
// See visitCallKnown.
if (call->mir()->needsArgCheck()) {
masm.branchIfFunctionHasNoJitEntry(calleereg, /* isConstructing */ false,
&invoke);
} else {
masm.branchIfFunctionHasNoScript(calleereg, &invoke);
}
masm.branchFunctionKind(Assembler::Equal, JSFunction::ClassConstructor,
calleereg, objreg, &invoke);
}
@ -5098,14 +5103,6 @@ void CodeGenerator::visitCallKnown(LCallKnown* call) {
MOZ_ASSERT_IF(target->isClassConstructor(), call->isConstructing());
Label uncompiled;
if (!target->isNativeWithJitEntry()) {
// The calleereg is known to be a non-native function, but might point
// to a LazyScript instead of a JSScript.
masm.branchIfFunctionHasNoJitEntry(calleereg, call->isConstructing(),
&uncompiled);
}
if (call->mir()->maybeCrossRealm()) {
masm.switchToObjectRealm(calleereg, objreg);
}
@ -5113,7 +5110,22 @@ void CodeGenerator::visitCallKnown(LCallKnown* call) {
if (call->mir()->needsArgCheck()) {
masm.loadJitCodeRaw(calleereg, objreg);
} else {
// In order to use the jitCodeNoArgCheck entry point, we must ensure the
// JSFunction is pointing to the canonical JSScript. Due to lambda cloning,
// we may still be referencing the original LazyScript.
//
// NOTE: We checked that canonical function script had a valid JitScript.
// This will not be tossed without all Ion code being tossed first.
Label uncompiled, end;
masm.branchIfFunctionHasNoScript(calleereg, &uncompiled);
masm.loadJitCodeNoArgCheck(calleereg, objreg);
masm.jump(&end);
// jitCodeRaw is still valid even if uncompiled.
masm.bind(&uncompiled);
masm.loadJitCodeRaw(calleereg, objreg);
masm.bind(&end);
}
// Nestle the StackPointer up to the argument vector.
@ -5141,24 +5153,6 @@ void CodeGenerator::visitCallKnown(LCallKnown* call) {
int prefixGarbage = sizeof(JitFrameLayout) - sizeof(void*);
masm.adjustStack(prefixGarbage - unusedStack);
if (uncompiled.used()) {
Label end;
masm.jump(&end);
// Handle uncompiled functions.
masm.bind(&uncompiled);
if (call->isConstructing() && target->nargs() > call->numActualArgs()) {
emitCallInvokeFunctionShuffleNewTarget(call, calleereg, target->nargs(),
unusedStack);
} else {
emitCallInvokeFunction(call, calleereg, call->isConstructing(),
call->ignoresReturnValue(), call->numActualArgs(),
unusedStack);
}
masm.bind(&end);
}
// If the return value of the constructing function is Primitive,
// replace the return value with the Object from CreateThis.
if (call->mir()->isConstructing()) {

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше