Merge autoland to mozilla-central. a=merge

This commit is contained in:
Bogdan Tara 2019-10-10 00:38:40 +03:00
Родитель f543161777 665bdb853c
Коммит ef914e2504
63 изменённых файлов: 927 добавлений и 641 удалений

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

@ -108,34 +108,6 @@
testName("btn_label_4", "label5");
//////////////////////////////////////////////////////////////////////////
// Name from the label element in anonymous content (see bug 362365).
// Get the name from anonymous label element for anonymous textbox
// (@anonid is used).
var ID = "box_label_anon1";
var box1Acc = testName(ID, null);
if (box1Acc) {
var textboxAcc = box1Acc.firstChild;
is(textboxAcc.name, "Label",
"Wrong label for anonymous textbox of " + ID);
}
// Get the name from anonymous label element for anonymous textbox
// (@anonid is used). Nested bindings.
ID = "box_label_anon2";
var box2Acc = testName(ID, null);
if (box2Acc) {
var textboxAcc = box2Acc.firstChild;
is(textboxAcc.name, "Label",
"Wrong label for anonymous textbox of " + ID);
var topTextboxAcc = box2Acc.lastChild;
is(topTextboxAcc.name, "Top textbox",
"Wrong label for anonymous textbox of " + ID);
}
//////////////////////////////////////////////////////////////////////////
// tooltiptext (if nothing above isn't presented then tooltiptext is used)
testName("box_tooltiptext", "tooltiptext label");
@ -307,15 +279,6 @@
<button id="btn_label_4"/>
</hbox>
<!-- label element, anonymous content -->
<box id="box_label_anon1"
class="first"
role="group"/>
<box id="box_label_anon2"
class="second"
role="group"/>
<!-- tooltiptext -->
<box id="box_tooltiptext"
role="group"

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

@ -1,34 +0,0 @@
/* vim: set ts=2 sw=2 sts=2 et 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";
var EXPORTED_SYMBOLS = ["ContextMenuSpecialProcessChild"];
const { ActorChild } = ChromeUtils.import(
"resource://gre/modules/ActorChild.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { E10SUtils } = ChromeUtils.import(
"resource://gre/modules/E10SUtils.jsm"
);
/**
* This module is a workaround for bug 1555154, where the contextmenu event doesn't
* cause the JS Window Actor Child to be constructed automatically in the parent
* process or extension process documents.
*/
class ContextMenuSpecialProcessChild extends ActorChild {
handleEvent(event) {
if (
Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_DEFAULT ||
Services.appinfo.remoteType == E10SUtils.EXTENSION_REMOTE_TYPE
) {
this.content
.getWindowGlobalChild()
.getActor("ContextMenu")
.handleEvent(event);
}
}
}

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

@ -31,7 +31,6 @@ FINAL_TARGET_FILES.actors += [
'ContentSearchChild.jsm',
'ContextMenuChild.jsm',
'ContextMenuParent.jsm',
'ContextMenuSpecialProcessChild.jsm',
'DOMFullscreenChild.jsm',
'FormValidationChild.jsm',
'FormValidationParent.jsm',

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

@ -1632,9 +1632,9 @@ pref("browser.contentblocking.report.proxy.enabled", false);
pref("browser.contentblocking.report.monitor.url", "https://monitor.firefox.com/?entrypoint=protection_report_monitor&utm_source=about-protections");
pref("browser.contentblocking.report.monitor.sign_in_url", "https://monitor.firefox.com/oauth/init?entrypoint=protection_report_monitor&utm_source=about-protections&email=");
pref("browser.contentblocking.report.lockwise.url", "https://lockwise.firefox.com/");
pref("browser.contentblocking.report.lockwise.url", "https://lockwise.firefox.com/?entrypoint=protection_report_lockwise&utm_source=about-protections");
pref("browser.contentblocking.report.manage_devices.url", "https://accounts.firefox.com/settings/clients");
pref("browser.contentblocking.report.proxy_extension.url", "https://fpn.firefox.com/browser");
pref("browser.contentblocking.report.proxy_extension.url", "https://fpn.firefox.com/browser?entrypoint=protection_report_proxy&utm_source=about-protections");
// Protection Report's SUMO urls
pref("browser.contentblocking.report.monitor.how_it_works.url", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/monitor-faq");

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

@ -781,16 +781,14 @@ async function runUrlbarTest(
},
};
} else {
// Hide the results as we expect many changes there that we don't want to
// detect here.
URLBar.view.panel.style.visibility = "hidden";
let dropmarkerRect = URLBar.dropmarker.getBoundingClientRect();
let textBoxRect = URLBar.querySelector(
"moz-input-box"
).getBoundingClientRect();
let resultsRect = {
top: URLBar.textbox.closest("toolbar").getBoundingClientRect().bottom,
right: win.innerWidth,
bottom: win.innerHeight,
left: 0,
};
expectedRects = {
filter: rects =>
rects.filter(
@ -806,12 +804,7 @@ async function runUrlbarTest(
(r.x1 >= dropmarkerRect.left - 1 &&
r.x2 <= dropmarkerRect.right + 1 &&
r.y1 >= dropmarkerRect.top &&
r.y2 <= dropmarkerRect.bottom) ||
// We expect many changes in the results view.
(r.x1 >= resultsRect.left &&
r.x2 <= resultsRect.right &&
r.y1 >= resultsRect.top &&
r.y2 <= resultsRect.bottom)
r.y2 <= dropmarkerRect.bottom)
)
),
};

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

@ -230,16 +230,6 @@ let LEGACY_ACTORS = {
},
},
ContextMenuSpecialProcess: {
child: {
module: "resource:///actors/ContextMenuSpecialProcessChild.jsm",
events: {
contextmenu: { mozSystemGroup: true },
},
},
allFrames: true,
},
DOMFullscreen: {
child: {
module: "resource:///actors/DOMFullscreenChild.jsm",

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

@ -1047,8 +1047,9 @@ var UITour = {
* @param {ChromeWindow} aWindow the chrome window
* @param {bool} aShouldOpen true means we should open the menu, otherwise false
* @param {String} aMenuName "appMenu" or "pageActionPanel"
* @param {Object} aOptions Extra config arguments, example `autohide: true`.
*/
_setMenuStateForAnnotation(aWindow, aShouldOpen, aMenuName) {
_setMenuStateForAnnotation(aWindow, aShouldOpen, aMenuName, aOptions = {}) {
log.debug("_setMenuStateForAnnotation: Menu is ", aMenuName);
log.debug(
"_setMenuStateForAnnotation: Menu is expected to be:",
@ -1071,7 +1072,7 @@ var UITour = {
if (aShouldOpen) {
log.debug("_setMenuStateForAnnotation: Opening the menu");
promise = new Promise(resolve => {
this.showMenu(aWindow, aMenuName, resolve);
this.showMenu(aWindow, aMenuName, resolve, aOptions);
});
} else if (!this.noautohideMenus.has(aMenuName)) {
// If the menu was opened explictly by api user through `Mozilla.UITour.showMenu`,
@ -1091,8 +1092,9 @@ var UITour = {
*
* @param {ChromeWindow} aChromeWindow The chrome window
* @param {Object} aTarget The target on which we show highlight or show info.
* @param {Object} options Extra config arguments, example `autohide: true`.
*/
async _ensureTarget(aChromeWindow, aTarget) {
async _ensureTarget(aChromeWindow, aTarget, aOptions = {}) {
let shouldOpenAppMenu = false;
let shouldOpenPageActionPanel = false;
if (this.targetIsInAppMenu(aTarget)) {
@ -1144,7 +1146,8 @@ var UITour = {
promise = this._setMenuStateForAnnotation(
aChromeWindow,
true,
menuToOpen
menuToOpen,
aOptions
);
}
return promise;
@ -1182,9 +1185,10 @@ var UITour = {
* window.
* @param aTarget The element to highlight.
* @param aEffect (optional) The effect to use from UITour.highlightEffects or "none".
* @param aOptions (optional) Extra config arguments, example `autohide: true`.
* @see UITour.highlightEffects
*/
async showHighlight(aChromeWindow, aTarget, aEffect = "none") {
async showHighlight(aChromeWindow, aTarget, aEffect = "none", aOptions = {}) {
let showHighlightElement = aAnchorEl => {
let highlighter = aChromeWindow.document.getElementById(
"UITourHighlight"
@ -1266,7 +1270,7 @@ var UITour = {
};
try {
await this._ensureTarget(aChromeWindow, aTarget);
await this._ensureTarget(aChromeWindow, aTarget, aOptions);
let anchorEl = await this._correctAnchor(aChromeWindow, aTarget);
showHighlightElement(anchorEl);
} catch (e) {
@ -1452,7 +1456,7 @@ var UITour = {
this._setMenuStateForAnnotation(aWindow, false, "pageActionPanel");
},
showMenu(aWindow, aMenuName, aOpenCallback = null) {
showMenu(aWindow, aMenuName, aOpenCallback = null, aOptions = {}) {
log.debug("showMenu:", aMenuName);
function openMenuButton(aMenuBtn) {
if (!aMenuBtn || !aMenuBtn.hasMenu() || aMenuBtn.open) {
@ -1483,7 +1487,9 @@ var UITour = {
menu.show = () => aWindow.BrowserPageActions.showPanel();
}
if (!aOptions.autohide) {
menu.node.setAttribute("noautohide", "true");
}
// If the popup is already opened, don't recreate the widget as it may cause a flicker.
if (menu.node.state != "open") {
this.recreatePopup(menu.node);

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

@ -123,7 +123,7 @@ class UrlbarEventBufferer {
/**
* Handles DOM events.
* @param {Event} event DOM event from the <textbox>.
* @param {Event} event DOM event from the input.
*/
handleEvent(event) {
if (event.type == "blur") {
@ -141,7 +141,7 @@ class UrlbarEventBufferer {
/**
* Receives DOM events, eventually queues them up, and calls back when it's
* the right time to handle the event.
* @param {Event} event DOM event from the <textbox>.
* @param {Event} event DOM event from the input.
* @param {Function} callback to be invoked when it's the right time to handle
* the event.
*/

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

@ -40,15 +40,14 @@ let getBoundsWithoutFlushing = element =>
let px = number => number.toFixed(2) + "px";
/**
* Represents the urlbar <textbox>.
* Also forwards important textbox properties and methods.
* Implements the text input part of the address bar UI.
*/
class UrlbarInput {
/**
* @param {object} options
* The initial options for UrlbarInput.
* @param {object} options.textbox
* The <textbox> element.
* The container element.
*/
constructor(options = {}) {
this.textbox = options.textbox;
@ -356,9 +355,8 @@ class UrlbarInput {
}
/**
* Passes DOM events for the textbox to the _on_<event type> methods.
* Passes DOM events to the _on_<event type> methods.
* @param {Event} event
* DOM event from the <textbox>.
*/
handleEvent(event) {
let methodName = "_on_" + event.type;

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

@ -258,10 +258,6 @@
fill: #0A51BF;
}
:root[lwt-popup-brighttext] #protections-popup[mainviewshowing][side=top]::part(arrow) {
fill: #0CB0F5;
}
#protections-popup-mainView-panel-header-section {
color: white;
background: radial-gradient(circle farthest-side at top right, #9059FF, #0250BB);
@ -271,14 +267,6 @@
background: radial-gradient(circle farthest-side at top left, #9059FF, #0250BB);
}
:root[lwt-popup-brighttext] #protections-popup-mainView-panel-header-section {
background: radial-gradient(circle farthest-side at top right, #C689FF, #00B3F4);
}
:root[lwt-popup-brighttext] #protections-popup-mainView-panel-header-section:-moz-locale-dir(rtl) {
background: radial-gradient(circle farthest-side at top left, #C689FF, #00B3F4);
}
#identity-popup-mainView-panel-header-span,
#protections-popup-mainView-panel-header-span {
font-weight: 600;

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

@ -1825,25 +1825,23 @@ toolbarpaletteitem[place="menu-panel"] > .subviewbutton-nav::after {
#protections-popup #messaging-system-message-container {
height: 260px;
overflow: hidden;
transition: margin-bottom .25s;
transition: height .25s;
border-top: 1px solid var(--panel-separator-color);
}
#protections-popup #messaging-system-message-container[disabled] {
/* Offset the height when hidden. This makes the panel content
* cover the info message and reveal it as it slides down, rather
* than the info message growing in height. */
margin-bottom: -260px;
height: 0;
}
#protections-popup #messaging-system-message-container[disabled] #protections-popup-message {
opacity: 0;
/* height + margins */
transform: translateY(calc(-100% - 10px));
}
#protections-popup-message {
display: flex;
align-items: flex-end;
transition: opacity .25s;
transition: transform .25s;
}
#protections-popup-message.whatsNew-hero-message {

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

@ -4,10 +4,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
%filter substitution
%define identityBoxPaddingInline 6px
%define identityBoxMarginInlineEnd 2px
#identity-box {
padding-inline-start: 6px;
padding-inline-end: 6px;
margin-inline-end: 2px;
padding-inline: @identityBoxPaddingInline@;
margin-inline-end: @identityBoxMarginInlineEnd@;
}
#identity-box,
@ -222,8 +225,7 @@
/* TRACKING PROTECTION ICON */
#tracking-protection-icon-container {
padding-inline-start: 6px;
padding-inline-end: 6px;
padding-inline: @identityBoxPaddingInline@;
/* Separator */
border-inline-end: 1px solid var(--urlbar-separator-color);
border-image: linear-gradient(transparent 15%, var(--urlbar-separator-color) 15%, var(--urlbar-separator-color) 85%, transparent 85%);

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

@ -6,10 +6,10 @@
%filter substitution
%define urlbarViewPadding 4px
%define urlbarViewIconMarginEnd 8px
%define urlbarViewIconMarginEnd (@identityBoxPaddingInline@ + @identityBoxMarginInlineEnd@)
%define urlbarViewFaviconOffset (@urlbarViewPadding@ + 16px /* type icon width */ + @urlbarViewIconMarginEnd@)
%define urlbarViewInlineStartPadding (@urlbarBreakoutHorizontalExtend@ - 16px /* type icon width */ - @urlbarViewIconMarginEnd@)
%define urlbarViewHorizontalMargin 5px
%define urlbarViewMarginInline 5px
%define urlbarViewItemPaddingStart (@urlbarBreakoutHorizontalExtend@ - @urlbarViewMarginInline@ - (/* type icon: */ 16px + @urlbarViewIconMarginEnd@) + /* favicon margin: */ @identityBoxPaddingInline@)
:root {
--autocomplete-popup-background: var(--arrowpanel-background);
@ -48,8 +48,8 @@
}
.urlbarView.megabar {
margin-inline: @urlbarViewHorizontalMargin@;
width: calc(100% - 2 * @urlbarViewHorizontalMargin@);
margin-inline: @urlbarViewMarginInline@;
width: calc(100% - 2 * @urlbarViewMarginInline@);
/* Match urlbar-background's border. */
border-inline: 1px solid transparent;
}
@ -79,8 +79,8 @@
display: flex;
padding-top: 24px;
padding-bottom: 24px;
padding-inline-start: calc(@urlbarViewInlineStartPadding@);
padding-inline-end: calc(@urlbarBreakoutHorizontalExtend@ - @urlbarViewHorizontalMargin@);
padding-inline-start: calc(@urlbarViewItemPaddingStart@);
padding-inline-end: calc(@urlbarBreakoutHorizontalExtend@ - @urlbarViewMarginInline@);
}
.urlbarView:not(.megabar) #urlbar-contextual-tip {
@ -133,8 +133,8 @@
fill-opacity: .6;
padding-top: 6px;
padding-bottom: 6px;
padding-inline-start: calc(@urlbarViewInlineStartPadding@);
padding-inline-end: calc(@urlbarBreakoutHorizontalExtend@ - @urlbarViewHorizontalMargin@);
padding-inline-start: calc(@urlbarViewItemPaddingStart@);
padding-inline-end: calc(@urlbarBreakoutHorizontalExtend@ - @urlbarViewMarginInline@);
}
.urlbarView:not(.megabar) .urlbarView-row {
@ -182,7 +182,7 @@
.urlbarView-favicon {
min-width: 16px;
height: 16px;
margin-inline-end: @urlbarViewIconMarginEnd@;
margin-inline-end: calc(@urlbarViewIconMarginEnd@);
background-repeat: no-repeat;
background-size: contain;
-moz-context-properties: fill, fill-opacity;
@ -222,7 +222,7 @@
#urlbar-contextual-tip-icon {
min-width: 24px;
height: 24px;
margin-inline-end: @urlbarViewIconMarginEnd@;
margin-inline-end: calc(@urlbarViewIconMarginEnd@);
background-repeat: no-repeat;
background-size: contain;
-moz-context-properties: fill, fill-opacity;
@ -389,7 +389,7 @@
.urlbarView.megabar .search-one-offs {
padding-inline-start: @urlbarBreakoutHorizontalExtend@;
padding-inline-end: calc(@urlbarBreakoutHorizontalExtend@ - @urlbarViewHorizontalMargin@);
padding-inline-end: calc(@urlbarBreakoutHorizontalExtend@ - @urlbarViewMarginInline@);
}
#urlbar:not(.megabar) .search-one-offs {

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

@ -434,12 +434,16 @@ function focusTab(tab) {
* Create an iframe that can be used to load DevTools via about:devtools-toolbox.
*/
function createDevToolsFrame(doc, className) {
const frame = doc.createXULElement("iframe");
let frame;
if (Services.prefs.getBoolPref("devtools.toolbox.content-frame", false)) {
frame = doc.createXULElement("browser");
frame.setAttribute("type", "content");
} else {
frame = doc.createXULElement("iframe");
}
frame.flex = 1; // Required to be able to shrink when the window shrinks
frame.className = className;
if (Services.prefs.getBoolPref("devtools.toolbox.content-frame", false)) {
frame.setAttribute("type", "content");
}
frame.tooltip = "aHTMLTooltip";
return frame;
}

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

@ -270,6 +270,7 @@ function Toolbox(
this._onNewSelectedNodeFront = this._onNewSelectedNodeFront.bind(this);
this._onToolSelected = this._onToolSelected.bind(this);
this._onContextMenu = this._onContextMenu.bind(this);
this._onMouseDown = this._onMouseDown.bind(this);
this.updateToolboxButtonsVisibility = this.updateToolboxButtonsVisibility.bind(
this
);
@ -939,6 +940,7 @@ Toolbox.prototype = {
"contextmenu",
this._onContextMenu
);
this._chromeEventHandler.addEventListener("mousedown", this._onMouseDown);
},
_removeChromeEventHandlerEvents: function() {
@ -960,6 +962,10 @@ Toolbox.prototype = {
"contextmenu",
this._onContextMenu
);
this._chromeEventHandler.removeEventListener(
"mousedown",
this._onMouseDown
);
this._chromeEventHandler = null;
},
@ -1114,19 +1120,43 @@ Toolbox.prototype = {
// Handle context menu events in standard input elements: <input> and <textarea>.
// Also support for custom input elements using .devtools-input class
// (e.g. CodeMirror instances).
if (
const isInInput =
e.originalTarget.closest("input[type=text]") ||
e.originalTarget.closest("input[type=search]") ||
e.originalTarget.closest("input:not([type])") ||
e.originalTarget.closest(".devtools-input") ||
e.originalTarget.closest("textarea")
e.originalTarget.closest("textarea");
const doc = e.originalTarget.ownerDocument;
const isHTMLPanel = doc.documentElement.namespaceURI === HTML_NS;
if (
// Context-menu events on input elements will use a custom context menu.
isInInput ||
// Context-menu events from HTML panels should not trigger the default
// browser context menu for HTML documents.
isHTMLPanel
) {
e.stopPropagation();
e.preventDefault();
}
if (isInInput) {
this.openTextBoxContextMenu(e.screenX, e.screenY);
}
},
_onMouseDown: function(e) {
const isMiddleClick = e.button === 1;
if (isMiddleClick) {
// Middle clicks will trigger the scroll lock feature to turn on.
// When the DevTools toolbox was running in an <iframe>, this behavior was
// disabled by default. When running in a <browser> element, we now need
// to catch and preventDefault() on those events.
e.preventDefault();
}
},
_getDebugTargetData: function() {
const url = new URL(this.win.location);
const searchParams = new this.win.URLSearchParams(url.search);

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

@ -562,6 +562,15 @@ MarkupContainer.prototype = {
event.preventDefault();
}
// Middle clicks will trigger the scroll lock feature to turn on.
// The toolbox is normally responsible for calling preventDefault when
// needed, but we prevent markup-view mousedown events from bubbling up (via
// stopPropagation). So we have to preventDefault here as well in order to
// avoid this issue.
if (isMiddleClick) {
event.preventDefault();
}
// Follow attribute links if middle or meta click.
if (isMiddleClick || isMetaClick) {
const link = target.dataset.link;

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

@ -476,18 +476,25 @@ Now you can listen to events on a front:
});
front.giveGoodNews().then(() => { console.log("request returned.") });
You might want to update your front's state when an event is fired, before emitting it against the front. You can use `preEvent` in the front definition for that:
If you want to modify the argument that will be passed to event listeners callbacks, you
can use `before(eventName, fn)` in the front definition. This can only be used once for a
given `eventName`. The `fn` function will be called before emitting the event via
the EventEmitter API on the Front, and its return value will be passed to the event
listener callbacks. If `fn` is async, the event will only be emitted after `fn` call resolves.
countGoodNews: protocol.preEvent("good-news", function (news) {
this.amountOfGoodNews++;
// In front file, most probably in the constructor:
this.before("good-news", function(news) {
return news.join(" - ");
});
You can have events wait until an asynchronous action completes before firing by returning a promise. If you have multiple preEvents defined for a specific event, and at least one fires asynchronously, then all preEvents most resolve before all events are fired.
countGoodNews: protocol.preEvent("good-news", function (news) {
return this.updateGoodNews().then(() => this.amountOfGoodNews++);
// In any consumer
front.on("good-news", function(news) {
console.log(news);
});
So if the server sent the following array: `[1, 2, 3]`, the console.log in the consumer
would print `1 - 2 - 3`.
On a somewhat related note, not every method needs to be request/response. Just like an actor can emit a one-way event, a method can be marked as a one-way request. Maybe we don't care about giveGoodNews returning anything:
// spec:

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

@ -914,6 +914,10 @@ void BrowsingContext::PostMessageMoz(JSContext* aCx,
const Sequence<JSObject*>& aTransfer,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError) {
if (mIsDiscarded) {
return;
}
RefPtr<BrowsingContext> sourceBc;
PostMessageData data;
data.targetOrigin() = aTargetOrigin;

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

@ -12101,7 +12101,7 @@ already_AddRefed<Document> Document::CreateStaticClone(
clonedDoc->mReferrerInfo =
static_cast<dom::ReferrerInfo*>(mReferrerInfo.get())->Clone();
clonedDoc->mPreloadReferrerInfo = clonedDoc->mPreloadReferrerInfo;
clonedDoc->mPreloadReferrerInfo = clonedDoc->mReferrerInfo;
}
}
mCreatingStaticClone = false;

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

@ -525,66 +525,6 @@ void Element::ClearStyleStateLocks() {
NotifyStyleStateChange(locks.mLocks);
}
#ifdef MOZ_XBL
static bool MayNeedToLoadXBLBinding(const Element& aElement) {
// Clean this up in https://bugzilla.mozilla.org/show_bug.cgi?id=1585823
return false;
}
#endif
JSObject* Element::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
JS::Rooted<JSObject*> obj(aCx, nsINode::WrapObject(aCx, aGivenProto));
if (!obj) {
return nullptr;
}
#ifdef MOZ_XBL
if (!MayNeedToLoadXBLBinding(*this)) {
return obj;
}
{
RefPtr<ComputedStyle> style =
nsComputedDOMStyle::GetComputedStyleNoFlush(this, nullptr);
if (!style) {
return obj;
}
// We have a binding that must be installed.
const StyleUrlOrNone& computedBinding = style->StyleDisplay()->mBinding;
if (!computedBinding.IsUrl()) {
return obj;
}
auto& url = computedBinding.AsUrl();
nsCOMPtr<nsIURI> uri = url.GetURI();
nsCOMPtr<nsIPrincipal> principal = url.ExtraData().Principal();
nsXBLService* xblService = nsXBLService::GetInstance();
if (!xblService) {
dom::Throw(aCx, NS_ERROR_NOT_AVAILABLE);
return nullptr;
}
RefPtr<nsXBLBinding> binding;
xblService->LoadBindings(this, uri, principal, getter_AddRefs(binding));
if (binding) {
if (nsContentUtils::IsSafeToRunScript()) {
binding->ExecuteAttachedHandler();
} else {
nsContentUtils::AddScriptRunner(
NewRunnableMethod("nsXBLBinding::ExecuteAttachedHandler", binding,
&nsXBLBinding::ExecuteAttachedHandler));
}
}
}
#endif
return obj;
}
/* virtual */
nsINode* Element::GetScopeChainParent() const { return OwnerDoc(); }

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

@ -1488,8 +1488,6 @@ class Element : public FragmentOrElement {
*/
static CORSMode AttrValueToCORSMode(const nsAttrValue* aValue);
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
nsINode* GetScopeChainParent() const override;
/**

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

@ -23,11 +23,30 @@
#include "mozilla/dom/SameProcessMessageQueue.h"
#include "mozilla/dom/ScriptLoader.h"
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/dom/JSWindowActorService.h"
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::dom::ipc;
/* static */
already_AddRefed<InProcessBrowserChildMessageManager>
InProcessBrowserChildMessageManager::Create(nsDocShell* aShell,
nsIContent* aOwner,
nsFrameMessageManager* aChrome) {
RefPtr<InProcessBrowserChildMessageManager> mm =
new InProcessBrowserChildMessageManager(aShell, aOwner, aChrome);
NS_ENSURE_TRUE(mm->Init(), nullptr);
if (XRE_IsParentProcess()) {
RefPtr<JSWindowActorService> wasvc = JSWindowActorService::GetSingleton();
wasvc->RegisterChromeEventTarget(mm);
}
return mm.forget();
}
bool InProcessBrowserChildMessageManager::DoSendBlockingMessage(
JSContext* aCx, const nsAString& aMessage, StructuredCloneData& aData,
JS::Handle<JSObject*> aCpows, nsIPrincipal* aPrincipal,
@ -101,6 +120,10 @@ InProcessBrowserChildMessageManager::InProcessBrowserChildMessageManager(
}
InProcessBrowserChildMessageManager::~InProcessBrowserChildMessageManager() {
if (XRE_IsParentProcess()) {
JSWindowActorService::UnregisterChromeEventTarget(this);
}
mAnonymousGlobalScopes.Clear();
mozilla::DropJSObjects(this);
}

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

@ -47,14 +47,7 @@ class InProcessBrowserChildMessageManager final
public:
static already_AddRefed<InProcessBrowserChildMessageManager> Create(
nsDocShell* aShell, nsIContent* aOwner, nsFrameMessageManager* aChrome) {
RefPtr<InProcessBrowserChildMessageManager> mm =
new InProcessBrowserChildMessageManager(aShell, aOwner, aChrome);
NS_ENSURE_TRUE(mm->Init(), nullptr);
return mm.forget();
}
nsDocShell* aShell, nsIContent* aOwner, nsFrameMessageManager* aChrome);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(

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

@ -94,7 +94,7 @@ void ShadowRoot::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
ShadowRootAuthorStylesMallocEnclosingSizeOf, mServoStyles.get());
}
JSObject* ShadowRoot::WrapObject(JSContext* aCx,
JSObject* ShadowRoot::WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
return mozilla::dom::ShadowRoot_Binding::Wrap(aCx, this, aGivenProto);
}

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

@ -168,8 +168,7 @@ class ShadowRoot final : public DocumentFragment,
mozilla::ServoStyleRuleMap& ServoStyleRuleMap();
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapNode(JSContext*, JS::Handle<JSObject*> aGivenProto) final;
void AddToIdTable(Element* aElement, nsAtom* aId);
void RemoveFromIdTable(Element* aElement, nsAtom* aId);

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

@ -439,8 +439,7 @@ class nsINode : public mozilla::dom::EventTarget {
inline mozilla::dom::DocumentFragment* AsDocumentFragment();
inline const mozilla::dom::DocumentFragment* AsDocumentFragment() const;
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext*, JS::Handle<JSObject*> aGivenProto) final;
/**
* Hook for constructing JS::ubi::Concrete specializations for memory

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

@ -44,7 +44,9 @@ nsWindowRoot::~nsWindowRoot() {
mListenerManager->Disconnect();
}
JSWindowActorService::UnregisterWindowRoot(this);
if (XRE_IsContentProcess()) {
JSWindowActorService::UnregisterChromeEventTarget(this);
}
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsWindowRoot, mWindow, mListenerManager,
@ -320,9 +322,9 @@ void nsWindowRoot::EnumerateBrowsers(BrowserEnumerator aEnumFunc, void* aArg) {
already_AddRefed<EventTarget> NS_NewWindowRoot(nsPIDOMWindowOuter* aWindow) {
nsCOMPtr<EventTarget> result = new nsWindowRoot(aWindow);
if (XRE_IsContentProcess()) {
RefPtr<JSWindowActorService> wasvc = JSWindowActorService::GetSingleton();
if (wasvc) {
wasvc->RegisterWindowRoot(result);
wasvc->RegisterChromeEventTarget(result);
}
return result.forget();

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

@ -232,7 +232,7 @@ class nsWrapperCache {
void TraceWrapper(const TraceCallbacks& aCallbacks, void* aClosure) {
if (PreservingWrapper() && mWrapper) {
aCallbacks.Trace(&mWrapper, "Preserved wrapper", aClosure);
aCallbacks.Trace(this, "Preserved wrapper", aClosure);
}
}
@ -304,13 +304,13 @@ class nsWrapperCache {
void ReleaseWrapper(void* aScriptObjectHolder);
protected:
void TraceWrapper(JSTracer* aTrc, const char* name) {
if (mWrapper) {
js::UnsafeTraceManuallyBarrieredEdge(aTrc, &mWrapper, name);
}
}
protected:
void PoisonWrapper() {
if (mWrapper) {
// Set the pointer to a value that will cause a crash if it is

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

@ -156,6 +156,8 @@ dictionary WindowActorChildOptions : WindowActorSidedOptions {
* Events which this actor wants to be listening to. When these events fire,
* it will trigger actor creation, and then forward the event to the actor.
*
* NOTE: Listeners are not attached for windows loaded in chrome docshells.
*
* NOTE: `once` option is not support due to we register listeners in a shared
* location.
*/

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

@ -243,8 +243,8 @@ NS_IMETHODIMP JSWindowActorProtocol::Observe(nsISupports* aSubject,
return NS_OK;
}
void JSWindowActorProtocol::RegisterListenersFor(EventTarget* aRoot) {
EventListenerManager* elm = aRoot->GetOrCreateListenerManager();
void JSWindowActorProtocol::RegisterListenersFor(EventTarget* aTarget) {
EventListenerManager* elm = aTarget->GetOrCreateListenerManager();
for (auto& event : mChild.mEvents) {
elm->AddEventListenerByType(EventListenerHolder(this), event.mName,
@ -252,8 +252,8 @@ void JSWindowActorProtocol::RegisterListenersFor(EventTarget* aRoot) {
}
}
void JSWindowActorProtocol::UnregisterListenersFor(EventTarget* aRoot) {
EventListenerManager* elm = aRoot->GetOrCreateListenerManager();
void JSWindowActorProtocol::UnregisterListenersFor(EventTarget* aTarget) {
EventListenerManager* elm = aTarget->GetOrCreateListenerManager();
for (auto& event : mChild.mEvents) {
elm->RemoveEventListenerByType(EventListenerHolder(this), event.mName,
@ -388,9 +388,9 @@ void JSWindowActorService::RegisterWindowActor(
Unused << cp->SendInitJSWindowActorInfos(ipcInfos);
}
// Register event listeners for any existing window roots.
for (EventTarget* root : mRoots) {
proto->RegisterListenersFor(root);
// Register event listeners for any existing chrome targets.
for (EventTarget* target : mChromeEventTargets) {
proto->RegisterListenersFor(target);
}
// Add observers to the protocol.
@ -410,9 +410,9 @@ void JSWindowActorService::UnregisterWindowActor(const nsAString& aName) {
}
}
// Remove listeners for this actor from each of our window roots.
for (EventTarget* root : mRoots) {
proto->UnregisterListenersFor(root);
// Remove listeners for this actor from each of our chrome targets.
for (EventTarget* target : mChromeEventTargets) {
proto->UnregisterListenersFor(target);
}
// Remove observers for this actor from observer serivce.
@ -431,9 +431,9 @@ void JSWindowActorService::LoadJSWindowActorInfos(
JSWindowActorProtocol::FromIPC(aInfos[i]);
mDescriptors.Put(aInfos[i].name(), proto);
// Register listeners for each window root.
for (EventTarget* root : mRoots) {
proto->RegisterListenersFor(root);
// Register listeners for each chrome target.
for (EventTarget* target : mChromeEventTargets) {
proto->RegisterListenersFor(target);
}
// Add observers for each actor.
@ -451,21 +451,21 @@ void JSWindowActorService::GetJSWindowActorInfos(
}
}
void JSWindowActorService::RegisterWindowRoot(EventTarget* aRoot) {
MOZ_ASSERT(!mRoots.Contains(aRoot));
mRoots.AppendElement(aRoot);
void JSWindowActorService::RegisterChromeEventTarget(EventTarget* aTarget) {
MOZ_ASSERT(!mChromeEventTargets.Contains(aTarget));
mChromeEventTargets.AppendElement(aTarget);
// Register event listeners on the newly added Window Root.
for (auto iter = mDescriptors.Iter(); !iter.Done(); iter.Next()) {
iter.Data()->RegisterListenersFor(aRoot);
iter.Data()->RegisterListenersFor(aTarget);
}
}
/* static */
void JSWindowActorService::UnregisterWindowRoot(EventTarget* aRoot) {
void JSWindowActorService::UnregisterChromeEventTarget(EventTarget* aTarget) {
if (gJSWindowActorService) {
// NOTE: No need to unregister listeners here, as the root is going away.
gJSWindowActorService->mRoots.RemoveElement(aRoot);
// NOTE: No need to unregister listeners here, as the target is going away.
gJSWindowActorService->mChromeEventTargets.RemoveElement(aTarget);
}
}

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

@ -70,8 +70,8 @@ class JSWindowActorProtocol final : public nsIObserver,
const ParentSide& Parent() const { return mParent; }
const ChildSide& Child() const { return mChild; }
void RegisterListenersFor(EventTarget* aRoot);
void UnregisterListenersFor(EventTarget* aRoot);
void RegisterListenersFor(EventTarget* aTarget);
void UnregisterListenersFor(EventTarget* aTarget);
void AddObservers();
void RemoveObservers();
bool Matches(BrowsingContext* aBrowsingContext, nsIURI* aURI,
@ -114,11 +114,11 @@ class JSWindowActorService final {
// from mDescriptors to JSWindowActorInfos.
void GetJSWindowActorInfos(nsTArray<JSWindowActorInfo>& aInfos);
// Register or unregister a WindowRoot object from this JSWindowActorService.
void RegisterWindowRoot(EventTarget* aRoot);
// Register or unregister a chrome event target.
void RegisterChromeEventTarget(EventTarget* aTarget);
// NOTE: This method is static, as it may be called during shutdown.
static void UnregisterWindowRoot(EventTarget* aRoot);
static void UnregisterChromeEventTarget(EventTarget* aTarget);
already_AddRefed<JSWindowActorProtocol> GetProtocol(const nsAString& aName);
@ -126,7 +126,7 @@ class JSWindowActorService final {
JSWindowActorService();
~JSWindowActorService();
nsTArray<EventTarget*> mRoots;
nsTArray<EventTarget*> mChromeEventTargets;
nsRefPtrHashtable<nsStringHashKey, JSWindowActorProtocol> mDescriptors;
};

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

@ -555,6 +555,8 @@ void nsContentSecurityUtils::AssertAboutPageHasCSP(Document* aDocument) {
NS_LITERAL_CSTRING("about:sync-log"),
// about:printpreview displays plain text only -> no CSP
NS_LITERAL_CSTRING("about:printpreview"),
// about:logo just displays the firefox logo -> no CSP
NS_LITERAL_CSTRING("about:logo"),
# if defined(ANDROID)
NS_LITERAL_CSTRING("about:config"),
# endif

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

@ -154,8 +154,8 @@ void record_telemetry_time(mozilla::wr::TelemetryProbe aProbe,
mozilla::Telemetry::Accumulate(mozilla::Telemetry::WR_SCENESWAP_TIME,
time_ms);
break;
case mozilla::wr::TelemetryProbe::RenderTime:
mozilla::Telemetry::Accumulate(mozilla::Telemetry::WR_RENDER_TIME,
case mozilla::wr::TelemetryProbe::FrameBuildTime:
mozilla::Telemetry::Accumulate(mozilla::Telemetry::WR_FRAMEBUILD_TIME,
time_ms);
break;
default:

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

@ -514,7 +514,7 @@ fn get_proc_address(glcontext_ptr: *mut c_void,
pub enum TelemetryProbe {
SceneBuildTime = 0,
SceneSwapTime = 1,
RenderTime = 2,
FrameBuildTime = 2,
}
extern "C" {
@ -582,7 +582,7 @@ impl RenderNotifier for CppNotifier {
render_time_ns: Option<u64>) {
unsafe {
if let Some(time) = render_time_ns {
record_telemetry_time(TelemetryProbe::RenderTime, time);
record_telemetry_time(TelemetryProbe::FrameBuildTime, time);
}
if composite_needed {
wr_notifier_new_frame_ready(self.window_id);

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

@ -722,8 +722,8 @@ Chunk* GCRuntime::pickChunk(AutoLockGCBgAlloc& lock) {
return chunk;
}
BackgroundAllocTask::BackgroundAllocTask(JSRuntime* rt, ChunkPool& pool)
: GCParallelTaskHelper(rt),
BackgroundAllocTask::BackgroundAllocTask(GCRuntime* gc, ChunkPool& pool)
: GCParallelTaskHelper(gc),
chunkPool_(pool),
enabled_(CanUseExtraThreads() && GetCPUCount() >= 2) {}
@ -731,9 +731,8 @@ void BackgroundAllocTask::run() {
TraceLoggerThread* logger = TraceLoggerForCurrentThread();
AutoTraceLog logAllocation(logger, TraceLogger_GCAllocation);
GCRuntime* gc = &runtime()->gc;
AutoLockGC lock(gc);
while (!cancel_ && runtime()->gc.wantBackgroundAllocation(lock)) {
while (!cancel_ && gc->wantBackgroundAllocation(lock)) {
Chunk* chunk;
{
AutoUnlockGC unlock(lock);

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -26,8 +26,9 @@ class GCParallelTask : public RunnableTask {
public:
using TaskFunc = void (*)(GCParallelTask*);
gc::GCRuntime* const gc;
private:
JSRuntime* const runtime_;
TaskFunc func_;
// The state of the parallel computation.
@ -46,14 +47,14 @@ class GCParallelTask : public RunnableTask {
cancel_;
public:
explicit GCParallelTask(JSRuntime* runtime, TaskFunc func)
: runtime_(runtime),
explicit GCParallelTask(gc::GCRuntime* gc, TaskFunc func)
: gc(gc),
func_(func),
state_(State::NotStarted),
duration_(nullptr),
cancel_(false) {}
GCParallelTask(GCParallelTask&& other)
: runtime_(other.runtime_),
: gc(other.gc),
func_(other.func_),
state_(other.state_),
duration_(nullptr),
@ -63,8 +64,6 @@ class GCParallelTask : public RunnableTask {
// before members get destructed.
virtual ~GCParallelTask();
JSRuntime* runtime() { return runtime_; }
// Time spent in the most recent invocation of this task.
mozilla::TimeDuration duration() const { return duration_; }
@ -78,8 +77,8 @@ class GCParallelTask : public RunnableTask {
void joinWithLockHeld(AutoLockHelperThreadState& locked);
// Instead of dispatching to a helper, run the task on the current thread.
void runFromMainThread(JSRuntime* rt);
void joinAndRunFromMainThread(JSRuntime* rt);
void runFromMainThread();
void joinAndRunFromMainThread();
// If the task is not already running, either start it or run it on the main
// thread if that fails.
@ -151,8 +150,8 @@ class GCParallelTask : public RunnableTask {
template <typename Derived>
class GCParallelTaskHelper : public GCParallelTask {
public:
explicit GCParallelTaskHelper(JSRuntime* runtime)
: GCParallelTask(runtime, &runTaskTyped) {}
explicit GCParallelTaskHelper(gc::GCRuntime* gc)
: GCParallelTask(gc, &runTaskTyped) {}
GCParallelTaskHelper(GCParallelTaskHelper&& other)
: GCParallelTask(std::move(other)) {}

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

@ -118,13 +118,13 @@ class ChunkPool {
class BackgroundSweepTask : public GCParallelTaskHelper<BackgroundSweepTask> {
public:
explicit BackgroundSweepTask(JSRuntime* rt) : GCParallelTaskHelper(rt) {}
explicit BackgroundSweepTask(GCRuntime* gc) : GCParallelTaskHelper(gc) {}
void run();
};
class BackgroundFreeTask : public GCParallelTaskHelper<BackgroundFreeTask> {
public:
explicit BackgroundFreeTask(JSRuntime* rt) : GCParallelTaskHelper(rt) {}
explicit BackgroundFreeTask(GCRuntime* gc) : GCParallelTaskHelper(gc) {}
void run();
};
@ -137,7 +137,7 @@ class BackgroundAllocTask : public GCParallelTaskHelper<BackgroundAllocTask> {
const bool enabled_;
public:
BackgroundAllocTask(JSRuntime* rt, ChunkPool& pool);
BackgroundAllocTask(GCRuntime* gc, ChunkPool& pool);
bool enabled() const { return enabled_; }
void run();
@ -149,7 +149,7 @@ class BackgroundDecommitTask
public:
using ChunkVector = mozilla::Vector<Chunk*>;
explicit BackgroundDecommitTask(JSRuntime* rt) : GCParallelTaskHelper(rt) {}
explicit BackgroundDecommitTask(GCRuntime* gc) : GCParallelTaskHelper(gc) {}
void setChunksToScan(ChunkVector& chunks);
void run();
@ -479,6 +479,10 @@ class GCRuntime {
bool isVerifyPreBarriersEnabled() const { return false; }
#endif
#ifdef JSGC_HASH_TABLE_CHECKS
void checkHashTablesAfterMovingGC();
#endif
// Queue memory memory to be freed on a background thread if possible.
void queueUnusedLifoBlocksForFree(LifoAlloc* lifo);
void queueAllLifoBlocksForFree(LifoAlloc* lifo);
@ -568,6 +572,8 @@ class GCRuntime {
IncrementalResult budgetIncrementalGC(bool nonincrementalByAPI,
JS::GCReason reason,
SliceBudget& budget);
void checkZoneIsScheduled(Zone* zone, JS::GCReason reason,
const char* trigger);
IncrementalResult resetIncrementalGC(AbortReason reason);
// Assert if the system state is such that we should never
@ -615,7 +621,11 @@ class GCRuntime {
bool shouldPreserveJITCode(JS::Realm* realm,
const mozilla::TimeStamp& currentTime,
JS::GCReason reason, bool canAllocateMoreCode);
void discardJITCodeForGC();
void startBackgroundFreeAfterMinorGC();
void relazifyFunctionsForShrinkingGC();
void purgeShapeCachesForShrinkingGC();
void purgeSourceURLsForShrinkingGC();
void traceRuntimeForMajorGC(JSTracer* trc, AutoGCSession& session);
void traceRuntimeAtoms(JSTracer* trc, const AutoAccessAtomsZone& atomsAccess);
void traceKeptAtoms(JSTracer* trc);
@ -638,6 +648,7 @@ class GCRuntime {
void markAllGrayReferences(gcstats::PhaseKind phase);
void beginSweepPhase(JS::GCReason reason, AutoGCSession& session);
void dropStringWrappers();
void groupZonesForSweeping(JS::GCReason reason);
MOZ_MUST_USE bool findSweepGroupEdges();
void getNextSweepGroup();
@ -647,6 +658,7 @@ class GCRuntime {
void markIncomingCrossCompartmentPointers(MarkColor color);
IncrementalProgress beginSweepingSweepGroup(JSFreeOp* fop,
SliceBudget& budget);
void updateAtomsBitmap();
void sweepDebuggerOnMainThread(JSFreeOp* fop);
void sweepJitDataOnMainThread(JSFreeOp* fop);
IncrementalProgress endSweepingSweepGroup(JSFreeOp* fop, SliceBudget& budget);
@ -660,7 +672,7 @@ class GCRuntime {
IncrementalProgress finalizeAllocKind(JSFreeOp* fop, SliceBudget& budget);
IncrementalProgress sweepShapeTree(JSFreeOp* fop, SliceBudget& budget);
void endSweepPhase(bool lastGC);
bool allCCVisibleZonesWereCollected() const;
bool allCCVisibleZonesWereCollected();
void sweepZones(JSFreeOp* fop, bool destroyingRuntime);
void decommitFreeArenasWithoutUnlocking(const AutoLockGC& lock);
void startDecommit();
@ -814,7 +826,7 @@ class GCRuntime {
}
// Clear each zone's gray buffers, but do not change the current state.
void resetBufferedGrayRoots() const;
void resetBufferedGrayRoots();
// Reset the gray buffering state to Unused.
void clearBufferedGrayRoots() {

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

@ -127,7 +127,7 @@ inline Chunk* js::NurseryChunk::toChunk(GCRuntime* gc) {
void js::NurseryDecommitTask::queueChunk(
NurseryChunk* nchunk, const AutoLockHelperThreadState& lock) {
// Using the chunk pointers to build the queue is infallible.
Chunk* chunk = nchunk->toChunk(&runtime()->gc);
Chunk* chunk = nchunk->toChunk(gc);
chunk->info.prev = nullptr;
chunk->info.next = queue;
queue = chunk;
@ -190,7 +190,6 @@ void js::NurseryDecommitTask::run() {
void js::NurseryDecommitTask::decommitChunk(Chunk* chunk) {
chunk->decommitAllArenas();
{
GCRuntime* gc = &runtime()->gc;
AutoLockGC lock(gc);
gc->recycleChunk(chunk, lock);
}
@ -225,7 +224,7 @@ js::Nursery::Nursery(GCRuntime* gc)
canAllocateStrings_(true),
reportTenurings_(0),
minorGCTriggerReason_(JS::GCReason::NO_REASON),
decommitTask(gc->rt)
decommitTask(gc)
#ifdef JS_GC_ZEAL
,
lastCanary_(nullptr)
@ -1091,7 +1090,7 @@ void js::Nursery::doCollection(JS::GCReason reason,
startProfile(ProfileKey::CheckHashTables);
#ifdef JS_GC_ZEAL
if (gc->hasZealMode(ZealMode::CheckHashTablesOnMinorGC)) {
CheckHashTablesAfterMovingGC(rt);
gc->checkHashTablesAfterMovingGC();
}
#endif
endProfile(ProfileKey::CheckHashTables);

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

@ -75,7 +75,7 @@ class MacroAssembler;
class NurseryDecommitTask : public GCParallelTaskHelper<NurseryDecommitTask> {
public:
explicit NurseryDecommitTask(JSRuntime* rt) : GCParallelTaskHelper(rt) {}
explicit NurseryDecommitTask(gc::GCRuntime* gc) : GCParallelTaskHelper(gc) {}
void queueChunk(NurseryChunk* chunk, const AutoLockHelperThreadState& lock);

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

@ -50,16 +50,18 @@ class GCZonesIter {
ZonesIter zone;
public:
explicit GCZonesIter(JSRuntime* rt, ZoneSelector selector = WithAtoms)
: zone(rt, selector) {
explicit GCZonesIter(GCRuntime* gc, ZoneSelector selector = WithAtoms)
: zone(gc, selector) {
MOZ_ASSERT(JS::RuntimeHeapIsBusy());
MOZ_ASSERT_IF(rt->gc.atomsZone->isCollectingFromAnyThread(),
!rt->hasHelperThreadZones());
MOZ_ASSERT_IF(gc->atomsZone->isCollectingFromAnyThread(),
!gc->rt->hasHelperThreadZones());
if (!done() && !zone->isCollectingFromAnyThread()) {
next();
}
}
explicit GCZonesIter(JSRuntime* rt, ZoneSelector selector = WithAtoms)
: GCZonesIter(&rt->gc, selector) {}
bool done() const { return zone.done(); }
@ -89,12 +91,14 @@ class SweepGroupZonesIter {
ZoneSelector selector;
public:
explicit SweepGroupZonesIter(JSRuntime* rt, ZoneSelector selector = WithAtoms)
explicit SweepGroupZonesIter(GCRuntime* gc, ZoneSelector selector = WithAtoms)
: selector(selector) {
MOZ_ASSERT(CurrentThreadIsPerformingGC());
current = rt->gc.getCurrentSweepGroup();
current = gc->getCurrentSweepGroup();
maybeSkipAtomsZone();
}
explicit SweepGroupZonesIter(JSRuntime* rt, ZoneSelector selector = WithAtoms)
: SweepGroupZonesIter(&rt->gc, selector) {}
void maybeSkipAtomsZone() {
if (selector == SkipAtoms && current && current->isAtomsZone()) {

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

@ -38,15 +38,17 @@ class ZonesIter {
JS::Zone** end;
public:
ZonesIter(JSRuntime* rt, ZoneSelector selector)
: iterMarker(&rt->gc),
atomsZone(selector == WithAtoms ? rt->gc.atomsZone.ref() : nullptr),
it(rt->gc.zones().begin()),
end(rt->gc.zones().end()) {
ZonesIter(gc::GCRuntime* gc, ZoneSelector selector)
: iterMarker(gc),
atomsZone(selector == WithAtoms ? gc->atomsZone.ref() : nullptr),
it(gc->zones().begin()),
end(gc->zones().end()) {
if (!atomsZone) {
skipHelperThreadZones();
}
}
ZonesIter(JSRuntime* rt, ZoneSelector selector)
: ZonesIter(&rt->gc, selector) {}
bool done() const { return !atomsZone && it == end; }
@ -184,12 +186,14 @@ class CompartmentsOrRealmsIterT {
mozilla::Maybe<InnerIterT> inner;
public:
explicit CompartmentsOrRealmsIterT(JSRuntime* rt)
: iterMarker(&rt->gc), zone(rt, SkipAtoms) {
explicit CompartmentsOrRealmsIterT(gc::GCRuntime* gc)
: iterMarker(gc), zone(gc, SkipAtoms) {
if (!zone.done()) {
inner.emplace(zone);
}
}
explicit CompartmentsOrRealmsIterT(JSRuntime* rt)
: CompartmentsOrRealmsIterT(&rt->gc) {}
bool done() const { return zone.done(); }

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

@ -338,7 +338,7 @@ void js::gc::GCRuntime::traceKeptAtoms(JSTracer* trc) {
// We don't have exact rooting information for atoms while parsing. When
// this is happeninng we set a flag on the zone and trace all atoms in the
// zone's cache.
for (GCZonesIter zone(trc->runtime()); !zone.done(); zone.next()) {
for (GCZonesIter zone(this); !zone.done(); zone.next()) {
if (zone->hasKeptAtoms()) {
zone->traceAtomCache(trc);
}
@ -392,7 +392,7 @@ void js::gc::GCRuntime::traceRuntimeCommon(JSTracer* trc,
// Zone::traceScriptTableRoots() for justification re: calling this only
// during major (non-nursery) collections.
if (!JS::RuntimeHeapIsMinorCollecting()) {
for (ZonesIter zone(rt, ZoneSelector::SkipAtoms); !zone.done();
for (ZonesIter zone(this, ZoneSelector::SkipAtoms); !zone.done();
zone.next()) {
zone->traceScriptTableRoots(trc);
}
@ -527,7 +527,7 @@ void js::gc::GCRuntime::bufferGrayRoots() {
// Precondition: the state has been reset to "unused" after the last GC
// and the zone's buffers have been cleared.
MOZ_ASSERT(grayBufferState == GrayBufferState::Unused);
for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
for (GCZonesIter zone(this); !zone.done(); zone.next()) {
MOZ_ASSERT(zone->gcGrayRoots().IsEmpty());
}
@ -601,11 +601,11 @@ void GCRuntime::markBufferedGrayRoots(JS::Zone* zone) {
}
}
void GCRuntime::resetBufferedGrayRoots() const {
void GCRuntime::resetBufferedGrayRoots() {
MOZ_ASSERT(
grayBufferState != GrayBufferState::Okay,
"Do not clear the gray buffers unless we are Failed or becoming Unused");
for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
for (GCZonesIter zone(this); !zone.done(); zone.next()) {
zone->gcGrayRoots().Clear();
}
}

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

@ -153,6 +153,10 @@ using PhaseKindTable =
static double t(TimeDuration duration) { return duration.ToMilliseconds(); }
inline JSContext* Statistics::context() {
return gc->rt->mainContextFromOwnThread();
}
inline Phase Statistics::currentPhase() const {
return phaseStack.empty() ? Phase::NONE : phaseStack.back();
}
@ -570,13 +574,13 @@ UniqueChars Statistics::renderJsonSlice(size_t sliceNum) const {
return printer.release();
}
UniqueChars Statistics::renderNurseryJson(JSRuntime* rt) const {
UniqueChars Statistics::renderNurseryJson() const {
Sprinter printer(nullptr, false);
if (!printer.init()) {
return UniqueChars(nullptr);
}
JSONPrinter json(printer);
rt->gc.nursery().renderProfileJSON(json);
gc->nursery().renderProfileJSON(json);
return printer.release();
}
@ -750,8 +754,8 @@ void Statistics::formatJsonPhaseTimes(const PhaseTimeTable& phaseTimes,
}
}
Statistics::Statistics(JSRuntime* rt)
: runtime(rt),
Statistics::Statistics(GCRuntime* gc)
: gc(gc),
gcTimerFile(nullptr),
gcDebugFile(nullptr),
nonincrementalReason_(gc::AbortReason::None),
@ -989,22 +993,21 @@ void Statistics::beginGC(JSGCInvocationKind kind,
gckind = kind;
nonincrementalReason_ = gc::AbortReason::None;
GCRuntime& gc = runtime->gc;
preTotalHeapBytes = gc.heapSize.bytes();
preTotalHeapBytes = gc->heapSize.bytes();
preCollectedHeapBytes = 0;
startingMajorGCNumber = gc.majorGCCount();
startingSliceNumber = gc.gcNumber();
startingMajorGCNumber = gc->majorGCCount();
startingSliceNumber = gc->gcNumber();
if (gc.lastGCEndTime()) {
timeSinceLastGC = currentTime - gc.lastGCEndTime();
if (gc->lastGCEndTime()) {
timeSinceLastGC = currentTime - gc->lastGCEndTime();
}
}
void Statistics::measureInitialHeapSize() {
MOZ_ASSERT(preCollectedHeapBytes == 0);
for (GCZonesIter zone(runtime, WithAtoms); !zone.done(); zone.next()) {
for (GCZonesIter zone(gc, WithAtoms); !zone.done(); zone.next()) {
preCollectedHeapBytes += zone->gcHeapSize.bytes();
}
}
@ -1012,12 +1015,12 @@ void Statistics::measureInitialHeapSize() {
void Statistics::adoptHeapSizeDuringIncrementalGC(Zone* mergedZone) {
// A zone is being merged into a zone that's currently being collected so we
// need to adjust our record of the total size of heap for collected zones.
MOZ_ASSERT(runtime->gc.isIncrementalGCInProgress());
MOZ_ASSERT(gc->isIncrementalGCInProgress());
preCollectedHeapBytes += mergedZone->gcHeapSize.bytes();
}
void Statistics::endGC() {
postTotalHeapBytes = runtime->gc.heapSize.bytes();
postTotalHeapBytes = gc->heapSize.bytes();
sendGCTelemetry();
@ -1025,17 +1028,18 @@ void Statistics::endGC() {
}
void Statistics::sendGCTelemetry() {
JSRuntime* runtime = gc->rt;
runtime->addTelemetry(JS_TELEMETRY_GC_IS_ZONE_GC,
!zoneStats.isFullCollection());
TimeDuration markTotal = SumPhase(PhaseKind::MARK, phaseTimes);
TimeDuration markRootsTotal = SumPhase(PhaseKind::MARK_ROOTS, phaseTimes);
double markTime = t(markTotal);
size_t markCount = runtime->gc.marker.getMarkCount();
size_t markCount = gc->marker.getMarkCount();
double markRate = markCount / markTime;
runtime->addTelemetry(JS_TELEMETRY_GC_MARK_MS, markTime);
runtime->addTelemetry(JS_TELEMETRY_GC_MARK_RATE, markRate);
runtime->addTelemetry(JS_TELEMETRY_GC_SWEEP_MS, t(phaseTimes[Phase::SWEEP]));
if (runtime->gc.isCompactingGc()) {
if (gc->isCompactingGc()) {
runtime->addTelemetry(JS_TELEMETRY_GC_COMPACT_MS,
t(phaseTimes[Phase::COMPACT]));
}
@ -1062,7 +1066,7 @@ void Statistics::sendGCTelemetry() {
}
runtime->addTelemetry(JS_TELEMETRY_GC_INCREMENTAL_DISABLED,
!runtime->gc.isIncrementalGCAllowed());
!gc->isIncrementalGCAllowed());
TimeDuration sccTotal, sccLongest;
sccDurations(&sccTotal, &sccLongest);
@ -1115,19 +1119,17 @@ void Statistics::sendGCTelemetry() {
void Statistics::beginNurseryCollection(JS::GCReason reason) {
count(COUNT_MINOR_GC);
startingMinorGCNumber = runtime->gc.minorGCCount();
startingMinorGCNumber = gc->minorGCCount();
if (nurseryCollectionCallback) {
(*nurseryCollectionCallback)(
runtime->mainContextFromOwnThread(),
JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START, reason);
context(), JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START, reason);
}
}
void Statistics::endNurseryCollection(JS::GCReason reason) {
if (nurseryCollectionCallback) {
(*nurseryCollectionCallback)(
runtime->mainContextFromOwnThread(),
JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END, reason);
context(), JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END, reason);
}
allocsSinceMinorGC = {0, 0};
@ -1143,11 +1145,12 @@ void Statistics::beginSlice(const ZoneGCStats& zoneStats,
TimeStamp currentTime = ReallyNow();
bool first = !runtime->gc.isIncrementalGCInProgress();
bool first = !gc->isIncrementalGCInProgress();
if (first) {
beginGC(gckind, currentTime);
}
JSRuntime* runtime = gc->rt;
if (!runtime->parentRuntime && !slices_.empty()) {
TimeDuration timeSinceLastSlice = currentTime - slices_.back().end;
runtime->addTelemetry(JS_TELEMETRY_GC_TIME_BETWEEN_SLICES_MS,
@ -1155,7 +1158,7 @@ void Statistics::beginSlice(const ZoneGCStats& zoneStats,
}
if (!slices_.emplaceBack(budget, reason, currentTime, GetPageFaultCount(),
runtime->gc.state())) {
gc->state())) {
// If we are OOM, set a flag to indicate we have missing slice data.
aborted = true;
return;
@ -1166,7 +1169,7 @@ void Statistics::beginSlice(const ZoneGCStats& zoneStats,
// Slice callbacks should only fire for the outermost level.
bool wasFullGC = zoneStats.isFullCollection();
if (sliceCallback) {
JSContext* cx = runtime->mainContextFromOwnThread();
JSContext* cx = context();
JS::GCDescription desc(!wasFullGC, false, gckind, reason);
if (first) {
(*sliceCallback)(cx, JS::GC_CYCLE_BEGIN, desc);
@ -1185,7 +1188,7 @@ void Statistics::endSlice() {
auto& slice = slices_.back();
slice.end = ReallyNow();
slice.endFaults = GetPageFaultCount();
slice.finalState = runtime->gc.state();
slice.finalState = gc->state();
writeLogMessage("end slice");
@ -1194,7 +1197,7 @@ void Statistics::endSlice() {
sliceCount_++;
}
bool last = !runtime->gc.isIncrementalGCInProgress();
bool last = !gc->isIncrementalGCInProgress();
if (last) {
if (gcTimerFile) {
printStats();
@ -1214,7 +1217,7 @@ void Statistics::endSlice() {
if (!aborted) {
bool wasFullGC = zoneStats.isFullCollection();
if (sliceCallback) {
JSContext* cx = runtime->mainContextFromOwnThread();
JSContext* cx = context();
JS::GCDescription desc(!wasFullGC, last, gckind, slices_.back().reason);
(*sliceCallback)(cx, JS::GC_SLICE_END, desc);
if (last) {
@ -1256,6 +1259,7 @@ void Statistics::endSlice() {
}
void Statistics::sendSliceTelemetry(const SliceData& slice) {
JSRuntime* runtime = gc->rt;
TimeDuration sliceTime = slice.end - slice.start;
runtime->addTelemetry(JS_TELEMETRY_GC_SLICE_MS, t(sliceTime));
@ -1291,6 +1295,7 @@ void Statistics::sendSliceTelemetry(const SliceData& slice) {
void Statistics::reportLongestPhaseInMajorGC(PhaseKind longest,
int telemetryId) {
JSRuntime* runtime = gc->rt;
if (longest != PhaseKind::NONE) {
uint8_t bucket = phaseKinds[longest].telemetryBucket;
runtime->addTelemetry(telemetryId, bucket);
@ -1371,7 +1376,7 @@ void Statistics::beginPhase(PhaseKind phaseKind) {
}
void Statistics::recordPhaseBegin(Phase phase) {
MOZ_ASSERT(CurrentThreadCanAccessRuntime(runtime));
MOZ_ASSERT(CurrentThreadCanAccessRuntime(gc->rt));
// Guard against any other re-entry.
MOZ_ASSERT(!phaseStartTimes[phase]);
@ -1398,7 +1403,7 @@ void Statistics::recordPhaseBegin(Phase phase) {
}
void Statistics::recordPhaseEnd(Phase phase) {
MOZ_ASSERT(CurrentThreadCanAccessRuntime(runtime));
MOZ_ASSERT(CurrentThreadCanAccessRuntime(gc->rt));
MOZ_ASSERT(phaseStartTimes[phase]);
@ -1470,7 +1475,7 @@ void Statistics::endPhase(PhaseKind phaseKind) {
void Statistics::recordParallelPhase(PhaseKind phaseKind,
TimeDuration duration) {
MOZ_ASSERT(CurrentThreadCanAccessRuntime(runtime));
MOZ_ASSERT(CurrentThreadCanAccessRuntime(gc->rt));
Phase phase = lookupChildPhase(phaseKind);
@ -1542,7 +1547,7 @@ void Statistics::maybePrintProfileHeaders() {
static int printedHeader = 0;
if ((printedHeader++ % 200) == 0) {
printProfileHeader();
if (runtime->gc.nursery().enableProfiling()) {
if (gc->nursery().enableProfiling()) {
Nursery::printProfileHeader();
}
}

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

@ -137,7 +137,7 @@ struct Statistics {
static MOZ_MUST_USE bool initialize();
explicit Statistics(JSRuntime* rt);
explicit Statistics(gc::GCRuntime* gc);
~Statistics();
Statistics(const Statistics&) = delete;
@ -299,7 +299,7 @@ struct Statistics {
UniqueChars renderJsonSlice(size_t sliceNum) const;
// Return JSON for the previous nursery collection.
UniqueChars renderNurseryJson(JSRuntime* rt) const;
UniqueChars renderNurseryJson() const;
#ifdef DEBUG
// Print a logging message.
@ -309,7 +309,7 @@ struct Statistics {
#endif
private:
JSRuntime* runtime;
gc::GCRuntime* const gc;
/* File used for MOZ_GCTIMER output. */
FILE* gcTimerFile;
@ -425,6 +425,8 @@ struct Statistics {
ProfileDurations totalTimes_;
uint64_t sliceCount_;
JSContext* context();
Phase currentPhase() const;
Phase lookupChildPhase(PhaseKind phaseKind) const;

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

@ -252,7 +252,7 @@ void gc::GCRuntime::startVerifyPreBarriers() {
incrementalState = State::Mark;
marker.start();
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
for (ZonesIter zone(this, WithAtoms); !zone.done(); zone.next()) {
MOZ_ASSERT(!zone->usedByHelperThread());
zone->setNeedsIncrementalBarrier(true);
zone->arenas.clearFreeLists();
@ -346,7 +346,7 @@ void gc::GCRuntime::endVerifyPreBarriers() {
bool compartmentCreated = false;
/* We need to disable barriers before tracing, which may invoke barriers. */
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
for (ZonesIter zone(this, WithAtoms); !zone.done(); zone.next()) {
if (!zone->needsIncrementalBarrier()) {
compartmentCreated = true;
}

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

@ -1737,7 +1737,7 @@ void js::GCParallelTask::startOrRunIfIdle(AutoLockHelperThreadState& lock) {
if (!(CanUseExtraThreads() && startWithLockHeld(lock))) {
AutoUnlockHelperThreadState unlock(lock);
runFromMainThread(runtime());
runFromMainThread();
}
}
@ -1769,19 +1769,19 @@ static inline TimeDuration TimeSince(TimeStamp prev) {
return now - prev;
}
void GCParallelTask::joinAndRunFromMainThread(JSRuntime* rt) {
void GCParallelTask::joinAndRunFromMainThread() {
{
AutoLockHelperThreadState lock;
MOZ_ASSERT(!isRunningWithLockHeld(lock));
joinWithLockHeld(lock);
}
runFromMainThread(rt);
runFromMainThread();
}
void js::GCParallelTask::runFromMainThread(JSRuntime* rt) {
void js::GCParallelTask::runFromMainThread() {
assertNotStarted();
MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(rt));
MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(gc->rt));
TimeStamp timeStart = ReallyNow();
runTask();
duration_ = TimeSince(timeStart);
@ -1793,7 +1793,7 @@ void js::GCParallelTask::runFromHelperThread(AutoLockHelperThreadState& lock) {
{
AutoUnlockHelperThreadState parallelSection(lock);
AutoSetHelperThreadContext usesContext;
AutoSetContextRuntime ascr(runtime());
AutoSetContextRuntime ascr(gc->rt);
gc::AutoSetThreadIsPerformingGC performingGC;
TimeStamp timeStart = ReallyNow();
runTask();

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

@ -421,6 +421,17 @@ function makeChan(url, type = Ci.nsIContentPolicy.TYPE_STYLESHEET) {
add_task(async function check_channels() {
do_get_profile();
// This test uses a histogram which isn't enabled on for all products
// (Thunderbird is missing it in this case).
Services.prefs.setBoolPref(
"toolkit.telemetry.testing.overrideProductsCheck",
true
);
registerCleanupFunction(function() {
Services.prefs.clearUserPref(
"toolkit.telemetry.testing.overrideProductsCheck"
);
});
let contentType = "text/css;hi";
let content = `.identity-color-blue {

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

@ -16,6 +16,10 @@ class nsIChannel;
class nsIURI;
#define UC_LOG(args) MOZ_LOG(UrlClassifierCommon::sLog, LogLevel::Info, args)
#define UC_LOG_DEBUG(args) \
MOZ_LOG(UrlClassifierCommon::sLog, LogLevel::Debug, args)
#define UC_LOG_WARN(args) \
MOZ_LOG(UrlClassifierCommon::sLog, LogLevel::Warning, args)
#define UC_LOG_ENABLED() MOZ_LOG_TEST(UrlClassifierCommon::sLog, LogLevel::Info)
namespace mozilla {

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

@ -36,17 +36,6 @@
namespace mozilla {
namespace net {
//
// MOZ_LOG=nsChannelClassifier:5
//
static LazyLogModule gChannelClassifierLog("nsChannelClassifier");
#undef LOG
#define LOG(args) MOZ_LOG(gChannelClassifierLog, LogLevel::Info, args)
#define LOG_DEBUG(args) MOZ_LOG(gChannelClassifierLog, LogLevel::Debug, args)
#define LOG_WARN(args) MOZ_LOG(gChannelClassifierLog, LogLevel::Warning, args)
#define LOG_ENABLED() MOZ_LOG_TEST(gChannelClassifierLog, LogLevel::Info)
#define URLCLASSIFIER_SKIP_HOSTNAMES "urlclassifier.skipHostnames"
// Put CachedPrefs in anonymous namespace to avoid any collision from outside of
@ -124,12 +113,12 @@ NS_IMPL_ISUPPORTS(nsChannelClassifier, nsIURIClassifierCallback, nsIObserver)
nsChannelClassifier::nsChannelClassifier(nsIChannel* aChannel)
: mIsAllowListed(false), mSuspendedChannel(false), mChannel(aChannel) {
LOG_DEBUG(("nsChannelClassifier::nsChannelClassifier %p", this));
UC_LOG_DEBUG(("nsChannelClassifier::nsChannelClassifier %p", this));
MOZ_ASSERT(mChannel);
}
nsChannelClassifier::~nsChannelClassifier() {
LOG_DEBUG(("nsChannelClassifier::~nsChannelClassifier %p", this));
UC_LOG_DEBUG(("nsChannelClassifier::~nsChannelClassifier %p", this));
}
void nsChannelClassifier::Start() {
@ -190,7 +179,7 @@ nsresult nsChannelClassifier::StartInternal() {
nsCString skipHostnames = CachedPrefs::GetInstance()->GetSkipHostnames();
if (!skipHostnames.IsEmpty()) {
LOG(("nsChannelClassifier[%p]:StartInternal whitelisted hostnames = %s",
UC_LOG(("nsChannelClassifier[%p]:StartInternal whitelisted hostnames = %s",
this, skipHostnames.get()));
if (IsHostnameWhitelisted(uri, skipHostnames)) {
return NS_ERROR_UNEXPECTED;
@ -215,12 +204,12 @@ nsresult nsChannelClassifier::StartInternal() {
NS_ENSURE_SUCCESS(rv, rv);
bool expectCallback;
if (LOG_ENABLED()) {
if (UC_LOG_ENABLED()) {
nsCOMPtr<nsIURI> principalURI;
principal->GetURI(getter_AddRefs(principalURI));
nsCString spec = principalURI->GetSpecOrDefault();
spec.Truncate(std::min(spec.Length(), UrlClassifierCommon::sMaxSpecLength));
LOG(("nsChannelClassifier[%p]: Classifying principal %s on channel[%p]",
UC_LOG(("nsChannelClassifier[%p]: Classifying principal %s on channel[%p]",
this, spec.get(), mChannel.get()));
}
// The classify is running in parent process, no need to give a valid event
@ -238,15 +227,15 @@ nsresult nsChannelClassifier::StartInternal() {
// Some channels (including nsJSChannel) fail on Suspend. This
// shouldn't be fatal, but will prevent malware from being
// blocked on these channels.
LOG_WARN(("nsChannelClassifier[%p]: Couldn't suspend channel", this));
UC_LOG_WARN(("nsChannelClassifier[%p]: Couldn't suspend channel", this));
return rv;
}
mSuspendedChannel = true;
LOG_DEBUG(("nsChannelClassifier[%p]: suspended channel %p", this,
UC_LOG_DEBUG(("nsChannelClassifier[%p]: suspended channel %p", this,
mChannel.get()));
} else {
LOG(("nsChannelClassifier[%p]: not expecting callback", this));
UC_LOG(("nsChannelClassifier[%p]: not expecting callback", this));
return NS_ERROR_FAILURE;
}
@ -268,7 +257,7 @@ bool nsChannelClassifier::IsHostnameWhitelisted(
while (tokenizer.hasMoreTokens()) {
const nsACString& token = tokenizer.nextToken();
if (token.Equals(host)) {
LOG(("nsChannelClassifier[%p]:StartInternal skipping %s (whitelisted)",
UC_LOG(("nsChannelClassifier[%p]:StartInternal skipping %s (whitelisted)",
this, host.get()));
return true;
}
@ -289,7 +278,7 @@ void nsChannelClassifier::MarkEntryClassified(nsresult status) {
return;
}
if (LOG_ENABLED()) {
if (UC_LOG_ENABLED()) {
nsAutoCString errorName;
GetErrorName(status, errorName);
nsCOMPtr<nsIURI> uri;
@ -297,7 +286,7 @@ void nsChannelClassifier::MarkEntryClassified(nsresult status) {
nsAutoCString spec;
uri->GetAsciiSpec(spec);
spec.Truncate(std::min(spec.Length(), UrlClassifierCommon::sMaxSpecLength));
LOG(("nsChannelClassifier::MarkEntryClassified[%s] %s", errorName.get(),
UC_LOG(("nsChannelClassifier::MarkEntryClassified[%s] %s", errorName.get(),
spec.get()));
}
@ -364,7 +353,7 @@ nsresult nsChannelClassifier::SendThreatHitReport(nsIChannel* aChannel,
nsPrintfCString reportEnablePref(
"browser.safebrowsing.provider.%s.dataSharing.enabled", provider.get());
if (!Preferences::GetBool(reportEnablePref.get(), false)) {
LOG((
UC_LOG((
"nsChannelClassifier::SendThreatHitReport data sharing disabled for %s",
provider.get()));
return NS_OK;
@ -395,21 +384,22 @@ nsChannelClassifier::OnClassifyComplete(nsresult aErrorCode,
if (mSuspendedChannel) {
nsAutoCString errorName;
if (LOG_ENABLED() && NS_FAILED(aErrorCode)) {
if (UC_LOG_ENABLED() && NS_FAILED(aErrorCode)) {
GetErrorName(aErrorCode, errorName);
LOG(("nsChannelClassifier[%p]:OnClassifyComplete %s (suspended channel)",
UC_LOG(
("nsChannelClassifier[%p]:OnClassifyComplete %s (suspended channel)",
this, errorName.get()));
}
MarkEntryClassified(aErrorCode);
if (NS_FAILED(aErrorCode)) {
if (LOG_ENABLED()) {
if (UC_LOG_ENABLED()) {
nsCOMPtr<nsIURI> uri;
mChannel->GetURI(getter_AddRefs(uri));
nsCString spec = uri->GetSpecOrDefault();
spec.Truncate(
std::min(spec.Length(), UrlClassifierCommon::sMaxSpecLength));
LOG(
UC_LOG(
("nsChannelClassifier[%p]: cancelling channel %p for %s "
"with error code %s",
this, mChannel.get(), spec.get(), errorName.get()));
@ -430,7 +420,7 @@ nsChannelClassifier::OnClassifyComplete(nsresult aErrorCode,
mChannel->Cancel(aErrorCode);
}
LOG_DEBUG(
UC_LOG_DEBUG(
("nsChannelClassifier[%p]: resuming channel[%p] from "
"OnClassifyComplete",
this, mChannel.get()));
@ -481,7 +471,5 @@ nsChannelClassifier::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK;
}
#undef LOG_ENABLED
} // namespace net
} // namespace mozilla

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

@ -24,8 +24,8 @@ job-template:
description: Sends {locales} XPIs for platform to addons.mozilla.org
worker-type:
by-release-level:
production: scriptworker-prov-v1/addon-v1
staging: scriptworker-prov-v1/addon-dev
production: scriptworker-k8s/gecko-3-addon
staging: scriptworker-k8s/gecko-1-addon
worker:
implementation: push-addons
channel:

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

@ -38,9 +38,10 @@ this.specialpowers = class extends ExtensionAPI {
includeChrome: true,
child: {
moduleURI: "resource://specialpowers/SpecialPowersChild.jsm",
events: {
DOMWindowCreated: {},
},
observers: [
"chrome-document-global-created",
"content-document-global-created",
],
},
parent: {
moduleURI: "resource://specialpowers/SpecialPowersParent.jsm",

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

@ -187,9 +187,9 @@ class SpecialPowersChild extends JSWindowActorChild {
this._extensionListeners = null;
}
handleEvent(aEvent) {
// We don't actually care much about the "DOMWindowCreated" event.
// We only listen to it to force creation of the actor.
observe(aSubject, aTopic, aData) {
// Ignore the "{chrome/content}-document-global-created" event. It
// is only observed to force creation of the actor.
}
actorCreated() {

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

@ -259,11 +259,11 @@
},
"CHECKERBOARD_DURATION": {
"record_in_processes": ["main", "content", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
"bug_numbers": [1238040, 1539309],
"bug_numbers": [1238040, 1539309, 1584109],
"releaseChannelCollection": "opt-out",
"expires_in_version": "73",
"expires_in_version": "never",
"kind": "exponential",
"high": 100000,
"n_buckets": 50,
@ -271,11 +271,11 @@
},
"CHECKERBOARD_PEAK": {
"record_in_processes": ["main", "content", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
"bug_numbers": [1238040, 1539309],
"bug_numbers": [1238040, 1539309, 1584109],
"releaseChannelCollection": "opt-out",
"expires_in_version": "73",
"expires_in_version": "never",
"kind": "exponential",
"high": 66355200,
"n_buckets": 50,
@ -283,11 +283,11 @@
},
"CHECKERBOARD_POTENTIAL_DURATION": {
"record_in_processes": ["main", "content", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
"bug_numbers": [1238040, 1539309],
"bug_numbers": [1238040, 1539309, 1584109],
"releaseChannelCollection": "opt-out",
"expires_in_version": "73",
"expires_in_version": "never",
"kind": "exponential",
"high": 1000000,
"n_buckets": 50,
@ -295,11 +295,11 @@
},
"CHECKERBOARD_SEVERITY": {
"record_in_processes": ["main", "content", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
"bug_numbers": [1238040, 1539309],
"bug_numbers": [1238040, 1539309, 1584109],
"releaseChannelCollection": "opt-out",
"expires_in_version": "73",
"expires_in_version": "never",
"kind": "exponential",
"high": 1073741824,
"n_buckets": 50,
@ -13958,9 +13958,9 @@
},
"CONTENT_PAINT_TIME": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "mwoodrow@mozilla.com", "dbolter@mozilla.com"],
"bug_numbers": [1309442, 1489524],
"bug_numbers": [1309442, 1489524, 1584109],
"expires_in_version": "never",
"releaseChannelCollection": "opt-out",
"kind": "exponential",
@ -13970,9 +13970,9 @@
},
"CONTENT_FULL_PAINT_TIME": {
"record_in_processes": ["main", "content", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "jmuizelaar@mozilla.com", "dbolter@mozilla.com"],
"bug_numbers": [1505858],
"bug_numbers": [1505858, 1584109],
"expires_in_version": "never",
"releaseChannelCollection": "opt-out",
"kind": "exponential",
@ -13982,9 +13982,9 @@
},
"CONTENT_FRAME_TIME": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "rhunt@mozilla.com"],
"bug_numbers": [1470528, 1509536],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "jnicol@mozilla.com"],
"bug_numbers": [1470528, 1509536, 1584109],
"expires_in_version": "never",
"releaseChannelCollection": "opt-out",
"kind": "exponential",
@ -13994,9 +13994,9 @@
},
"CONTENT_FRAME_TIME_VSYNC": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "mwoodrow@mozilla.com"],
"bug_numbers": [1517355],
"bug_numbers": [1517355, 1584109],
"expires_in_version": "never",
"releaseChannelCollection": "opt-out",
"kind": "linear",
@ -14007,10 +14007,10 @@
},
"CONTENT_FRAME_TIME_WITH_SVG": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "mwoodrow@mozilla.com"],
"bug_numbers": [1483549, 1509536],
"expires_in_version": "70",
"bug_numbers": [1483549, 1509536, 1584109],
"expires_in_version": "never",
"releaseChannelCollection": "opt-out",
"kind": "exponential",
"high": 5000,
@ -14019,10 +14019,10 @@
},
"CONTENT_FRAME_TIME_WITHOUT_RESOURCE_UPLOAD": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "mwoodrow@mozilla.com"],
"bug_numbers": [1503405],
"expires_in_version": "70",
"bug_numbers": [1503405, 1584109],
"expires_in_version": "never",
"kind": "exponential",
"high": 5000,
"n_buckets": 50,
@ -14030,10 +14030,10 @@
},
"CONTENT_FRAME_TIME_WITHOUT_UPLOAD": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "mwoodrow@mozilla.com"],
"bug_numbers": [1503405],
"expires_in_version": "70",
"bug_numbers": [1503405, 1584109],
"expires_in_version": "never",
"kind": "exponential",
"high": 5000,
"n_buckets": 50,
@ -14041,10 +14041,10 @@
},
"CONTENT_FRAME_TIME_REASON": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "mwoodrow@mozilla.com"],
"bug_numbers": [1510853],
"expires_in_version": "73",
"bug_numbers": [1510853, 1584109],
"expires_in_version": "never",
"kind": "categorical",
"description": "The reason that CONTENT_FRAME_TIME recorded a slow (>200) result, if any.",
"labels": ["OnTime", "NoVsync", "MissedComposite", "SlowComposite", "MissedCompositeMid", "MissedCompositeLong", "MissedCompositeLow", "NoVsyncNoId"]
@ -15130,9 +15130,9 @@
},
"WR_SCENEBUILD_TIME": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"alert_emails": ["kgupta@mozilla.com"],
"bug_numbers": [1470901],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
"bug_numbers": [1470901, 1584109],
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,
@ -15141,20 +15141,20 @@
},
"WR_SCENESWAP_TIME": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"alert_emails": ["kgupta@mozilla.com"],
"bug_numbers": [1470901],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
"bug_numbers": [1470901, 1584109],
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,
"n_buckets": 50,
"description": "WebRender scene swap time in milliseconds"
},
"WR_RENDER_TIME": {
"WR_FRAMEBUILD_TIME": {
"record_in_processes": ["main", "gpu"],
"products": ["firefox", "fennec", "geckoview"],
"alert_emails": ["kgupta@mozilla.com"],
"bug_numbers": [1470901],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": ["gfx-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
"bug_numbers": [1470901, 1584109],
"expires_in_version": "never",
"kind": "exponential",
"high": 1000,
@ -15304,7 +15304,7 @@
},
"GV_PAGE_LOAD_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": [
"geckoview-team@mozilla.com",
"esawin@mozilla.com"
@ -15313,7 +15313,7 @@
"kind": "exponential",
"high": 100000,
"n_buckets": 100,
"bug_numbers": [1499418],
"bug_numbers": [1499418, 1584109],
"description": "GeckoView: Time taken to load a page in ms. This includes all static contents, no dynamic content. Loading of about: pages is not counted."
},
"GV_PAGE_RELOAD_MS": {
@ -15333,7 +15333,7 @@
},
"GV_STARTUP_RUNTIME_MS": {
"record_in_processes": ["main", "content"],
"products": ["firefox", "fennec", "geckoview"],
"products": ["firefox", "fennec", "geckoview", "geckoview_streaming"],
"alert_emails": [
"geckoview-team@mozilla.com",
"esawin@mozilla.com"
@ -15342,7 +15342,7 @@
"kind": "exponential",
"high": 10000,
"n_buckets": 50,
"bug_numbers": [1499418],
"bug_numbers": [1499418, 1584109],
"description": "GeckoView: Time taken to initialize GeckoRuntime in ms."
},
"GV_STARTUP_MODULES_MS": {

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

@ -8,22 +8,373 @@
$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0
geckoview:
page_load_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: GV_PAGE_LOAD_MS
description: >
The time taken to load a page. This includes all static contents, no dynamic content.
Loading of about: pages is not counted.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- geckoview-team@mozilla.com
- esawin@mozilla.com
expires: never
startup_runtime:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: GV_STARTUP_RUNTIME_MS
description: >
The time taken to initialize GeckoRuntime.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- geckoview-team@mozilla.com
- esawin@mozilla.com
expires: never
gfx:
composite_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: COMPOSITE_TIME
description: |
description: >
The time taken to composite a frame.
On non-webrender this is the time taken in `CompositorBridgeParent::CompositeToTarget()`.
On webrender, this is the time taken from the start of `WebRenderBridgeParent::CompositeToTarget()`, until the render thread has rendered the frame (in `RenderThread::HandleFrameOneDoc()`).
On webrender, this is the time taken from the start of `WebRenderBridgeParent::CompositeToTarget()`,
until the render thread has rendered the frame (in `RenderThread::HandleFrameOneDoc()`).
bugs:
- https://bugzilla.mozilla.org/1080160
- https://bugzilla.mozilla.org/1529352
- https://bugzilla.mozilla.org/1580129
- https://bugzilla.mozilla.org/show_bug.cgi?id=1080160
- https://bugzilla.mozilla.org/show_bug.cgi?id=1529352
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580129
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1580129#c7
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- jnicol@mozilla.com
expires: never
gfx.checkerboard:
duration:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: CHECKERBOARD_DURATION
description: >
The duration of a checkerboard event.
Checkerboarding is when painting has not kept up with asynchronous panning and
zooming so the compositor has to display a "checkerboard pattern" (or in practice,
the background color) rather than the actual page content.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
- https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- kgupta@mozilla.com
expires: never
peak_pixel_count:
type: custom_distribution
range_max: 66355200
bucket_count: 50
histogram_type: exponential
unit: Pixels
gecko_datapoint: CHECKERBOARD_PEAK
description: >
The peak number of CSS pixels that checkerboarded during a checkerboard event.
The minimum value of the largest histogram bucket is the size of a 4k display with
maximum APZ zooming.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
- https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- kgupta@mozilla.com
expires: never
potential_duration:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: CHECKERBOARD_POTENTIAL_DURATION
description: >
The total amount of time that we could reasonably be checkerboarding.
This is the union of two possibly-intersecting sets of time periods:
The first set is that in which checkerboarding was actually happening,
since by definition it could potentially be happening.
The second set is that in which the APZC is actively transforming content
in the compositor, since it could potentially transform it so as to display
checkerboarding to the user. Combined with other information, this allows us
to meaningfully say how frequently users actually enncounters checkerboarding.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
- https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- kgupta@mozilla.com
expires: never
severity:
type: custom_distribution
range_max: 1073741824
bucket_count: 50
histogram_type: exponential
unit: Opaque unit
gecko_datapoint: CHECKERBOARD_SEVERITY
description: >
An opaque measurement of the severity of a checkerboard event.
This doesn't have units, it's just useful for comparing two checkerboard
events to see which one is worse, for some implementation-specific
definition of "worse". The larger the value, the worse the checkerboarding.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
- https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- kgupta@mozilla.com
expires: never
gfx.content:
paint_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: CONTENT_PAINT_TIME
description: >
Time spent in the main-thread paint pipeline for content.
For non-webrender, this includes display list building, layer building, and when OMTP
is disabled, rasterization.
For webrender, this includes display list building, and webrender display list building.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1309442
- https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- mwoodrow@mozilla.com
- dbolter@mozilla.com
expires: never
full_paint_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: CONTENT_FULL_PAINT_TIME
description: >
Time spent in the full paint pipeline for content until it's ready for composition.
For non-webrender this includes `paint_time`, plus rasterization if OMTP is enabled.
For webrender, this includes `paint_time`, plus scene building time.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1505858
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- jmuizelaar@mozilla.com
- dbolter@mozilla.com
expires: never
gfx.content.frame_time:
from_paint:
type: custom_distribution
range_max: 5000
bucket_count: 50
histogram_type: exponential
unit: Percentage of vsync interval
gecko_datapoint: CONTENT_FRAME_TIME
description: >
The time, in percentage of a vsync interval, spent from beginning a paint in
the content process until that frame is presented in the compositor.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1470528
- https://bugzilla.mozilla.org/show_bug.cgi?id=1509536
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- jnicol@mozilla.com
expires: never
from_vsync:
type: custom_distribution
range_min: 8
range_max: 792
bucket_count: 100
histogram_type: linear
unit: Percentage of vsync interval
gecko_datapoint: CONTENT_FRAME_TIME_VSYNC
description: >
The time, in percentage of a vsync interval, spent from the vsync that started a
paint in the content process until that frame is presented in the compositor.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1517355
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- mwoodrow@mozilla.com
expires: never
with_svg:
type: custom_distribution
range_max: 5000
bucket_count: 50
histogram_type: exponential
unit: Percentage of vsync interval
gecko_datapoint: CONTENT_FRAME_TIME_WITH_SVG
description: >
The time, in percentage of a vsync interval, spent from beginning a paint in the
content process until that frame is presented in the compositor, for frames that
contained an SVG to be drawn by webrender.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1483549
- https://bugzilla.mozilla.org/show_bug.cgi?id=1509536
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- mwoodrow@mozilla.com
expires: never
without_resource_upload:
type: custom_distribution
range_max: 5000
bucket_count: 50
histogram_type: exponential
unit: Percentage of vsync interval
gecko_datapoint: CONTENT_FRAME_TIME_WITHOUT_RESOURCE_UPLOAD
description: >
The time, in percentage of a vsync interval, spent from beginning a paint in the
content process until that frame is presented in the compositor by webrender,
excluding time spent uploading resources.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1503405
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- mwoodrow@mozilla.com
expires: never
without_upload:
type: custom_distribution
range_max: 5000
bucket_count: 50
histogram_type: exponential
unit: Percentage of vsync interval
gecko_datapoint: CONTENT_FRAME_TIME_WITHOUT_UPLOAD
description: >
The time, in percentage of a vsync interval, spent from beginning a paint in the
content process until that frame is presented in the compositor by webrender,
excluding time spent uploading any content.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1503405
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- mwoodrow@mozilla.com
expires: never
reason:
type: labeled_counter
labels:
- on_time
- no_vsync
- missed_composite
- slow_composite
- missed_composite_mid
- missed_composite_long
- missed_composite_low
- no_vsync_no_id
gecko_datapoint: CONTENT_FRAME_TIME_REASON
description: >
The reason that `gfx.content.frame_time.from_paint` recorded a slow (>200ms) result, if any.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1510853
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- mwoodrow@mozilla.com
expires: never
gfx.webrender:
scenebuild_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: WR_SCENEBUILD_TIME
description: >
The time taken to build a webrender scene.
This occurs each time webrender receives a new display list.
This additionally includes blob rasterization time.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- kgupta@mozilla.com
expires: never
sceneswap_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: WR_SCENESWAP_TIME
description: >
The time taken to do a webrender scene swap. This is book-keeping that APZ must
perform once webrender has built a new scene.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- kgupta@mozilla.com
expires: never
render_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: WR_FRAMEBUILD_TIME
description: >
The time taken to build a webrender frame.
This involves calculating the visibility of primitives, requesting resources,
and building the render passes which will be used to render the frame.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
notification_emails:
- gfx-telemetry-alerts@mozilla.com
- kgupta@mozilla.com
expires: never

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

@ -87,6 +87,11 @@
return;
}
// shift + F7 is the default DevTools shortcut for the Style Editor.
if (event.shiftKey) {
return;
}
if (event.defaultPrevented || !event.isTrusted) {
return;
}

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

@ -323,9 +323,6 @@ def run(update=False, query=None, intersect_query=None, try_config=None, full=Fa
print(FZF_NOT_FOUND)
return 1
if show_estimates:
download_task_history_data()
check_working_directory(push)
tg = generate_tasks(parameters, full)
all_tasks = sorted(tg.tasks.keys())
@ -335,6 +332,7 @@ def run(update=False, query=None, intersect_query=None, try_config=None, full=Fa
dep_cache = os.path.join(cache_dir, 'target_task_dependencies')
if show_estimates:
download_task_history_data()
make_trimmed_taskgraph_cache(graph_cache, dep_cache)
if not full:

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

@ -985,10 +985,9 @@ struct JsGcTracer : public TraceCallbacks {
void* aClosure) const override {
JS::TraceEdge(static_cast<JSTracer*>(aClosure), aPtr, aName);
}
virtual void Trace(JSObject** aPtr, const char* aName,
virtual void Trace(nsWrapperCache* aPtr, const char* aName,
void* aClosure) const override {
js::UnsafeTraceManuallyBarrieredEdge(static_cast<JSTracer*>(aClosure), aPtr,
aName);
aPtr->TraceWrapper(static_cast<JSTracer*>(aClosure), aName);
}
virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char* aName,
void* aClosure) const override {
@ -1055,9 +1054,9 @@ struct ClearJSHolder : public TraceCallbacks {
*aPtr = nullptr;
}
virtual void Trace(JSObject** aPtr, const char* aName,
virtual void Trace(nsWrapperCache* aPtr, const char* aName,
void* aClosure) const override {
*aPtr = nullptr;
aPtr->ClearWrapper();
}
virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char*,

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

@ -49,6 +49,8 @@ class nsCycleCollectionISupports {
NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionISupports,
NS_CYCLECOLLECTIONISUPPORTS_IID)
class nsWrapperCache;
namespace JS {
template <class T>
class Heap;
@ -66,7 +68,7 @@ struct TraceCallbacks {
void* aClosure) const = 0;
virtual void Trace(JS::Heap<JSObject*>* aPtr, const char* aName,
void* aClosure) const = 0;
virtual void Trace(JSObject** aPtr, const char* aName,
virtual void Trace(nsWrapperCache* aPtr, const char* aName,
void* aClosure) const = 0;
virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char* aName,
void* aClosure) const = 0;
@ -94,7 +96,7 @@ struct TraceCallbackFunc : public TraceCallbacks {
void* aClosure) const override;
virtual void Trace(JS::Heap<JSObject*>* aPtr, const char* aName,
void* aClosure) const override;
virtual void Trace(JSObject** aPtr, const char* aName,
virtual void Trace(nsWrapperCache* aPtr, const char* aName,
void* aClosure) const override;
virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char* aName,
void* aClosure) const override;

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

@ -2490,9 +2490,9 @@ class SnowWhiteKiller : public TraceCallbacks {
AppendJSObjectToPurpleBuffer(aObject->unbarrieredGet());
}
virtual void Trace(JSObject** aObject, const char* aName,
virtual void Trace(nsWrapperCache* aWrapperCache, const char* aName,
void* aClosure) const override {
AppendJSObjectToPurpleBuffer(*aObject);
AppendJSObjectToPurpleBuffer(aWrapperCache->GetWrapperPreserveColor());
}
virtual void Trace(JS::TenuredHeap<JSObject*>* aObject, const char* aName,

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

@ -50,10 +50,11 @@ void TraceCallbackFunc::Trace(JS::Heap<JSObject*>* aPtr, const char* aName,
}
}
void TraceCallbackFunc::Trace(JSObject** aPtr, const char* aName,
void TraceCallbackFunc::Trace(nsWrapperCache* aPtr, const char* aName,
void* aClosure) const {
if (*aPtr) {
mCallback(JS::GCCellPtr(*aPtr), aName, aClosure);
JSObject* obj = aPtr->GetWrapperPreserveColor();
if (obj) {
mCallback(JS::GCCellPtr(obj), aName, aClosure);
}
}

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

@ -37,7 +37,7 @@ void MozillaUnRegisterDebugFILE(FILE* aFile);
MOZ_END_EXTERN_C
#if defined(XP_MACOSX) || (defined(XP_WIN) && !defined(__MINGW32__))
#if defined(XP_MACOSX) || defined(XP_WIN)
# ifdef __cplusplus
namespace mozilla {
@ -74,7 +74,7 @@ void ClearPoisonIOInterposer();
} // namespace mozilla
# endif /* __cplusplus */
#else /* defined(XP_MACOSX) || (defined(XP_WIN) && !defined(__MINGW32__)) */
#else /* defined(XP_MACOSX) || defined(XP_WIN) */
# ifdef __cplusplus
namespace mozilla {

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

@ -30,14 +30,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
EXPORTS.mozilla += [
'perfprobe.h',
]
SOURCES += ['perfprobe.cpp']
if CONFIG['CC_TYPE'] not in ('gcc', 'clang'):
SOURCES += [
'perfprobe.cpp',
'PoisonIOInterposerBase.cpp',
'PoisonIOInterposerWin.cpp',
]
else:
SOURCES += ['PoisonIOInterposerStub.cpp']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
UNIFIED_SOURCES += [
'PoisonIOInterposerBase.cpp',