This commit is contained in:
Wes Kocher 2014-02-24 17:45:16 -08:00
Родитель 9535b293cc 1b60c67eea
Коммит 3f720dc89f
212 изменённых файлов: 2472 добавлений и 1988 удалений

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

@ -47,12 +47,6 @@ endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,version)
endif
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
endif #LIBXUL_SDK
UA_UPDATE_FILE = ua-update.json

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

@ -12,6 +12,10 @@ if not CONFIG['LIBXUL_SDK']:
SOURCES += [
'nsBrowserApp.cpp',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
if CONFIG['ENABLE_MARIONETTE']:
DEFINES['ENABLE_MARIONETTE'] = 1

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

@ -54,12 +54,6 @@ NSDISTMODE = copy
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifeq ($(OS_ARCH),WINNT)
RCINCLUDE = splash.rc
# Rebuild firefox.exe if the manifest changes - it's included by splash.rc.

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

@ -32,3 +32,8 @@ LOCAL_INCLUDES += [
'/xpcom/base',
'/xpcom/build',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

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

@ -1381,6 +1381,11 @@ pref("identity.fxaccounts.settings.uri", "https://accounts.firefox.com/settings"
// The URL of the Firefox Accounts auth server backend
pref("identity.fxaccounts.auth.uri", "https://api.accounts.firefox.com/v1");
// On GTK, we now default to showing the menubar only when alt is pressed:
#ifdef MOZ_WIDGET_GTK
pref("ui.key.menuAccessKeyFocuses", true);
#endif
// Temporarily turn the new http cache v2 on for Desktop Firefox only
pref("browser.cache.use_new_backend_temp", true);

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

@ -4278,8 +4278,15 @@ function onViewToolbarCommand(aEvent) {
}
function setToolbarVisibility(toolbar, isVisible) {
var hidingAttribute = toolbar.getAttribute("type") == "menubar" ?
"autohide" : "collapsed";
let hidingAttribute;
if (toolbar.getAttribute("type") == "menubar") {
hidingAttribute = "autohide";
#ifdef MOZ_WIDGET_GTK
Services.prefs.setBoolPref("ui.key.menuAccessKeyFocuses", !isVisible);
#endif
} else {
hidingAttribute = "collapsed";
}
toolbar.setAttribute(hidingAttribute, !isVisible);
document.persist(toolbar.id, hidingAttribute);

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

@ -52,7 +52,7 @@ WebVTTParserWrapper.prototype =
processCues: function(window, cues, overlay)
{
WebVTTParser.processCues(window, cues, null, overlay);
WebVTTParser.processCues(window, cues, overlay);
},
classDescription: "Wrapper for the JS WebVTTParser (vtt.js)",

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

@ -8,7 +8,7 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
* Code below is vtt.js the JS WebVTTParser.
* Current source code can be found at http://github.com/andreasgal/vtt.js
*
* Code taken from commit d819872e198d051dfcebcfb7ecf260462c9a9c6f
* Code taken from commit b812cd783d4284de1bc6b0349b7bda151052a1df
*/
/**
* Copyright 2013 vtt.js Contributors
@ -101,20 +101,18 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
// Accept a setting if its a valid (signed) integer.
integer: function(k, v) {
if (/^-?\d+$/.test(v)) { // integer
this.set(k, parseInt(v, 10));
// Only take values in the range of -1000 ~ 1000
this.set(k, Math.min(Math.max(parseInt(v, 10), -1000), 1000));
}
},
// Accept a setting if its a valid percentage.
percent: function(k, v, frac) {
percent: function(k, v) {
var m;
if ((m = v.match(/^([\d]{1,3})(\.[\d]*)?%$/))) {
v = v.replace("%", "");
if (!m[2] || (m[2] && frac)) {
v = parseFloat(v);
if (v >= 0 && v <= 100) {
this.set(k, v);
return true;
}
v = parseFloat(v);
if (v >= 0 && v <= 100) {
this.set(k, v);
return true;
}
}
return false;
@ -664,25 +662,59 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
return ++count * -1;
}
function BoundingBox() {
function StyleBox() {
}
BoundingBox.prototype.applyStyles = function(styles) {
var div = this.div;
// Apply styles to a div. If there is no div passed then it defaults to the
// div on 'this'.
StyleBox.prototype.applyStyles = function(styles, div) {
div = div || this.div;
Object.keys(styles).forEach(function(style) {
div.style[style] = styles[style];
});
};
BoundingBox.prototype.formatStyle = function(val, unit) {
StyleBox.prototype.formatStyle = function(val, unit) {
return val === 0 ? 0 : val + unit;
};
function BasicBoundingBox(window, cue) {
BoundingBox.call(this);
// Constructs the computed display state of the cue (a div). Places the div
// into the overlay which should be a block level element (usually a div).
function CueStyleBox(window, cue, styleOptions) {
StyleBox.call(this);
this.cue = cue;
// Parse our cue's text into a DOM tree rooted at 'div'.
this.div = parseContent(window, cue.text);
// Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will
// have inline positioning and will function as the cue background box.
this.cueDiv = parseContent(window, cue.text);
this.applyStyles({
color: "rgba(255, 255, 255, 1)",
backgroundColor: "rgba(0, 0, 0, 0.8)",
position: "relative",
left: 0,
right: 0,
top: 0,
bottom: 0,
display: "inline"
}, this.cueDiv);
// Create an absolutely positioned div that will be used to position the cue
// div. Note, all WebVTT cue-setting alignments are equivalent to the CSS
// mirrors of them except "middle" which is "center" in CSS.
this.div = window.document.createElement("div");
this.applyStyles({
textAlign: cue.align === "middle" ? "center" : cue.align,
direction: determineBidi(this.cueDiv),
writingMode: cue.vertical === "" ? "horizontal-tb"
: cue.vertical === "lr" ? "vertical-lr"
: "vertical-rl",
unicodeBidi: "plaintext",
font: styleOptions.font,
whiteSpace: "pre-line",
position: "absolute"
});
this.div.appendChild(this.cueDiv);
// Calculate the distance from the reference edge of the viewport to the text
// position of the cue box. The reference edge will be resolved later when
@ -718,149 +750,277 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
});
}
// All WebVTT cue-setting alignments are equivalent to the CSS mirrors of
// them except "middle" which is "center" in CSS.
this.applyStyles({
"textAlign": cue.align === "middle" ? "center" : cue.align
});
}
BasicBoundingBox.prototype = Object.create(BoundingBox.prototype);
BasicBoundingBox.prototype.constructor = BasicBoundingBox;
const CUE_FONT_SIZE = 2.5;
const SCROLL_DURATION = 0.433;
const LINE_HEIGHT = 0.0533;
const REGION_FONT_SIZE = 1.3;
// Constructs the computed display state of the cue (a div). Places the div
// into the overlay which should be a block level element (usually a div).
function CueBoundingBox(window, cue, overlay) {
BasicBoundingBox.call(this, window, cue);
this.applyStyles({
direction: determineBidi(this.div),
writingMode: cue.vertical === "" ? "horizontal-tb"
: cue.vertical === "lr" ? "vertical-lr"
: "vertical-rl",
position: "absolute",
unicodeBidi: "plaintext",
fontSize: CUE_FONT_SIZE + "vh",
fontFamily: "sans-serif",
color: "rgba(255, 255, 255, 1)",
backgroundColor: "rgba(0, 0, 0, 0.8)",
whiteSpace: "pre-line"
});
// Append the div to the overlay so we can get the computed styles of the
// element in order to position for overlap avoidance.
overlay.appendChild(this.div);
// Calculate the distance from the reference edge of the viewport to the line
// position of the cue box. The reference edge will be resolved later when
// the box orientation styles are applied. Default if snapToLines is not set
// is 85.
var linePos = 85;
if (!cue.snapToLines) {
var computedLinePos = computeLinePos(cue),
boxComputedStyle = window.getComputedStyle(this.div),
size = cue.vertical === "" ? boxComputedStyle.getPropertyValue("height") :
boxComputedStyle.getPropertyValue("width"),
// Get the percentage value of the computed height as getPropertyValue
// returns pixels.
overlayHeight = window.getComputedStyle(overlay).getPropertyValue("height"),
calculatedPercentage = (size.replace("px", "") / overlayHeight.replace("px", "")) * 100;
switch (cue.lineAlign) {
case "start":
linePos = computedLinePos;
break;
case "middle":
linePos = computedLinePos - (calculatedPercentage / 2);
break;
case "end":
linePos = computedLinePos - calculatedPercentage;
break;
}
}
switch (cue.vertical) {
case "":
this.move = function(box) {
this.applyStyles({
top: this.formatStyle(linePos, "%")
top: this.formatStyle(box.top, "px"),
bottom: this.formatStyle(box.bottom, "px"),
left: this.formatStyle(box.left, "px"),
right: this.formatStyle(box.right, "px"),
height: this.formatStyle(box.height, "px"),
width: this.formatStyle(box.width, "px"),
});
break;
case "rl":
this.applyStyles({
left: this.formatStyle(linePos, "%")
});
break;
case "lr":
this.applyStyles({
right: this.formatStyle(linePos, "%")
});
break;
}
cue.displayState = this.div;
}
CueBoundingBox.prototype = Object.create(BasicBoundingBox.prototype);
CueBoundingBox.prototype.constuctor = CueBoundingBox;
function RegionBoundingBox(window, region) {
BoundingBox.call(this);
this.div = window.document.createElement("div");
var left = region.viewportAnchorX -
region.regionAnchorX * region.width / 100,
top = region.viewportAnchorY -
region.regionAnchorY * region.lines * LINE_HEIGHT / 100;
this.applyStyles({
position: "absolute",
writingMode: "horizontal-tb",
backgroundColor: "rgba(0, 0, 0, 0.8)",
wordWrap: "break-word",
overflowWrap: "break-word",
font: REGION_FONT_SIZE + "vh/" + LINE_HEIGHT + "vh sans-serif",
lineHeight: LINE_HEIGHT + "vh",
color: "rgba(255, 255, 255, 1)",
overflow: "hidden",
width: this.formatStyle(region.width, "%"),
minHeight: "0",
// TODO: This value is undefined in the spec, but I am assuming that they
// refer to lines * line height to get the max height See issue #107.
maxHeight: this.formatStyle(region.lines * LINE_HEIGHT, "px"),
left: this.formatStyle(left, "%"),
top: this.formatStyle(top, "%"),
display: "inline-flex",
flexFlow: "column",
justifyContent: "flex-end"
});
this.maybeAddCue = function(cue) {
if (region.id !== cue.regionId) {
return false;
}
var basicBox = new BasicBoundingBox(window, cue);
basicBox.applyStyles({
position: "relative",
unicodeBidi: "plaintext",
width: "auto"
});
if (this.div.childNodes.length === 1 && region.scroll === "up") {
this.applyStyles({
transitionProperty: "top",
transitionDuration: SCROLL_DURATION + "s"
});
}
this.div.appendChild(basicBox.div);
return true;
};
}
RegionBoundingBox.prototype = Object.create(BoundingBox.prototype);
RegionBoundingBox.prototype.constructor = RegionBoundingBox;
CueStyleBox.prototype = Object.create(StyleBox.prototype);
CueStyleBox.prototype.constructor = CueStyleBox;
// Represents the co-ordinates of an Element in a way that we can easily
// compute things with such as if it overlaps or intersects with another Element.
// Can initialize it with either a StyleBox or another BoxPosition.
function BoxPosition(obj) {
var self = this;
// Either a BoxPosition was passed in and we need to copy it, or a StyleBox
// was passed in and we need to copy the results of 'getBoundingClientRect'
// as the object returned is readonly. All co-ordinate values are in reference
// to the viewport origin (top left).
var lh;
if (obj.div) {
var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&
rects.getClientRects && rects.getClientRects();
obj = obj.div.getBoundingClientRect();
// In certain cases the outter div will be slightly larger then the sum of
// the inner div's lines. This could be due to bold text, etc, on some platforms.
// In this case we should get the average line height and use that. This will
// result in the desired behaviour.
lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)
: 0;
}
this.left = obj.left;
this.right = obj.right;
this.top = obj.top;
this.height = obj.height;
this.bottom = obj.bottom;
this.width = obj.width;
this.lineHeight = lh !== undefined ? lh : obj.lineHeight;
}
// Move the box along a particular axis. If no amount to move is passed, via
// the val parameter, then the default amount is the line height of the box.
BoxPosition.prototype.move = function(axis, val) {
val = val !== undefined ? val : this.lineHeight;
switch (axis) {
case "+x":
this.left += val;
this.right += val;
break;
case "-x":
this.left -= val;
this.right -= val;
break;
case "+y":
this.top += val;
this.bottom += val;
break;
case "-y":
this.top -= val;
this.bottom -= val;
break;
}
};
// Check if this box overlaps another box, b2.
BoxPosition.prototype.overlaps = function(b2) {
return this.left < b2.right &&
this.right > b2.left &&
this.top < b2.bottom &&
this.bottom > b2.top;
};
// Check if this box overlaps any other boxes in boxes.
BoxPosition.prototype.overlapsAny = function(boxes) {
for (var i = 0; i < boxes.length; i++) {
if (this.overlaps(boxes[i])) {
return true;
}
}
return false;
};
// Check if this box is within another box.
BoxPosition.prototype.within = function(container) {
return this.top >= container.top &&
this.bottom <= container.bottom &&
this.left >= container.left &&
this.right <= container.right;
};
// Check if this box is entirely within the container or it is overlapping
// on the edge opposite of the axis direction passed. For example, if "+x" is
// passed and the box is overlapping on the left edge of the container, then
// return true.
BoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {
switch (axis) {
case "+x":
return this.left < container.left;
case "-x":
return this.right > container.right;
case "+y":
return this.top < container.top;
case "-y":
return this.bottom > container.bottom;
}
};
// Find the percentage of the area that this box is overlapping with another
// box.
BoxPosition.prototype.intersectPercentage = function(b2) {
var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),
y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),
intersectArea = x * y;
return intersectArea / (this.height * this.width);
};
// Convert the positions from this box to CSS compatible positions using
// the reference container's positions. This has to be done because this
// box's positions are in reference to the viewport origin, whereas, CSS
// values are in referecne to their respective edges.
BoxPosition.prototype.toCSSCompatValues = function(reference) {
return {
top: this.top - reference.top,
bottom: reference.bottom - this.bottom,
left: this.left - reference.left,
right: reference.right - this.right,
height: this.height,
width: this.width
};
};
// Get an object that represents the box's position without anything extra.
// Can pass a StyleBox, HTMLElement, or another BoxPositon.
BoxPosition.getSimpleBoxPosition = function(obj) {
obj = obj.div ? obj.div.getBoundingClientRect() :
obj.tagName ? obj.getBoundingClientRect() : obj;
return {
left: obj.left,
right: obj.right,
top: obj.top,
height: obj.height,
bottom: obj.bottom,
width: obj.width
};
};
// Move a StyleBox to its specified, or next best, position. The containerBox
// is the box that contains the StyleBox, such as a div. boxPositions are
// a list of other boxes that the styleBox can't overlap with.
function moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {
// Find the best position for a cue box, b, on the video. The axis parameter
// is a list of axis, the order of which, it will move the box along. For example:
// Passing ["+x", "-x"] will move the box first along the x axis in the positive
// direction. If it doesn't find a good position for it there it will then move
// it along the x axis in the negative direction.
function findBestPosition(b, axis) {
var bestPosition,
specifiedPosition = new BoxPosition(b),
percentage = 1; // Highest possible so the first thing we get is better.
for (var i = 0; i < axis.length; i++) {
while (b.overlapsOppositeAxis(containerBox, axis[i]) ||
(b.within(containerBox) && b.overlapsAny(boxPositions))) {
b.move(axis[i]);
}
// We found a spot where we aren't overlapping anything. This is our
// best position.
if (b.within(containerBox)) {
return b;
}
var p = b.intersectPercentage(containerBox);
// If we're outside the container box less then we were on our last try
// then remember this position as the best position.
if (percentage > p) {
bestPosition = new BoxPosition(b);
percentage = p;
}
// Reset the box position to the specified position.
b = new BoxPosition(specifiedPosition);
}
return bestPosition || specifiedPosition;
}
function reverseAxis(axis) {
return axis.map(function(a) {
return a.indexOf("+") !== -1 ? a.replace("+", "-") : a.replace("-", "+");
});
}
var boxPosition = new BoxPosition(styleBox),
cue = styleBox.cue,
linePos = computeLinePos(cue),
axis = [];
// If we have a line number to align the cue to.
if (cue.snapToLines) {
switch (cue.vertical) {
case "":
axis = [ "+y", "-y" ];
break;
case "rl":
axis = [ "+x", "-x" ];
break;
case "lr":
axis = [ "-x", "+x" ];
break;
}
// If computed line position returns negative then line numbers are
// relative to the bottom of the video instead of the top. Therefore, we
// need to increase our initial position by the length or width of the
// video, depending on the writing direction, and reverse our axis directions.
var initialPosition = boxPosition.lineHeight * Math.floor(linePos + 0.5),
initialAxis = axis[0];
if (linePos < 0) {
initialPosition += cue.vertical === "" ? containerBox.height : containerBox.width;
axis = reverseAxis(axis);
}
// Move the box to the specified position. This may not be its best
// position.
boxPosition.move(initialAxis, initialPosition);
} else {
// If we have a percentage line value for the cue.
var calculatedPercentage = (boxPosition.lineHeight / containerBox.height) * 100;
switch (cue.lineAlign) {
case "middle":
linePos -= (calculatedPercentage / 2);
break;
case "end":
linePos -= calculatedPercentage;
break;
}
// Apply initial line position to the cue box.
switch (cue.vertical) {
case "":
styleBox.applyStyles({
top: styleBox.formatStyle(linePos, "%")
});
break;
case "rl":
styleBox.applyStyles({
left: styleBox.formatStyle(linePos, "%")
});
break;
case "lr":
styleBox.applyStyles({
right: styleBox.formatStyle(linePos, "%")
});
break;
}
axis = [ "+y", "-x", "+x", "-y" ];
// Get the box position again after we've applied the specified positioning
// to it.
boxPosition = new BoxPosition(styleBox);
}
var bestPosition = findBestPosition(boxPosition, axis);
styleBox.move(bestPosition.toCSSCompatValues(containerBox));
}
function WebVTTParser(window, decoder) {
this.window = window;
@ -891,10 +1051,14 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
return parseContent(window, cuetext);
};
const FONT_SIZE_PERCENT = 0.05;
const FONT_STYLE = "sans-serif";
const CUE_BACKGROUND_PADDING = "1.5%";
// Runs the processing model over the cues and regions passed to it.
// @param overlay A block level element (usually a div) that the computed cues
// and regions will be placed into.
WebVTTParser.processCues = function(window, cues, regions, overlay) {
WebVTTParser.processCues = function(window, cues, overlay) {
if (!window || !cues || !overlay) {
return null;
}
@ -904,32 +1068,56 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
overlay.removeChild(overlay.firstChild);
}
var regionBoxes = regions ? regions.map(function(region) {
return new RegionBoundingBox(window, region);
}) : null;
var paddedOverlay = window.document.createElement("div");
paddedOverlay.style.position = "absolute";
paddedOverlay.style.left = "0";
paddedOverlay.style.right = "0";
paddedOverlay.style.top = "0";
paddedOverlay.style.bottom = "0";
paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;
overlay.appendChild(paddedOverlay);
function mapCueToRegion(cue) {
for (var i = 0; i < regionBoxes.length; i++) {
if (regionBoxes[i].maybeAddCue(cue)) {
// Determine if we need to compute the display states of the cues. This could
// be the case if a cue's state has been changed since the last computation or
// if it has not been computed yet.
function shouldCompute(cues) {
for (var i = 0; i < cues.length; i++) {
if (cues[i].hasBeenReset || !cues[i].displayState) {
return true;
}
}
return false;
}
for (var i = 0; i < cues.length; i++) {
// Check to see if this cue is contained within a VTTRegion.
if (regionBoxes && mapCueToRegion(cues[i])) {
continue;
}
// Check to see if we can just reuse the last computed styles of the cue.
if (cues[i].hasBeenReset !== true && cues[i].displayState) {
overlay.appendChild(cues[i].displayState);
continue;
}
// Compute the position of the cue box on the cue overlay.
var cueBox = new CueBoundingBox(window, cues[i], overlay);
// We don't need to recompute the cues' display states. Just reuse them.
if (!shouldCompute(cues)) {
cues.forEach(function(cue) {
paddedOverlay.appendChild(cue.displayState);
});
return;
}
var boxPositions = [],
containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),
fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;
var styleOptions = {
font: fontSize + "px " + FONT_STYLE
};
cues.forEach(function(cue) {
// Compute the intial position and styles of the cue div.
var styleBox = new CueStyleBox(window, cue, styleOptions);
paddedOverlay.appendChild(styleBox.div);
// Move the cue div to it's correct line position.
moveBoxToLinePosition(window, styleBox, containerBox, boxPositions);
// Remember the computed div so that we don't have to recompute it later
// if we don't have too.
cue.displayState = styleBox.div;
boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));
});
};
WebVTTParser.prototype = {
@ -972,7 +1160,7 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
settings.set(k, v);
break;
case "width":
settings.percent(k, v, true);
settings.percent(k, v);
break;
case "lines":
settings.integer(k, v);
@ -986,8 +1174,8 @@ this.EXPORTED_SYMBOLS = ["WebVTTParser"];
// We have to make sure both x and y parse, so use a temporary
// settings object here.
var anchor = new Settings();
anchor.percent("x", xy[0], true);
anchor.percent("y", xy[1], true);
anchor.percent("x", xy[0]);
anchor.percent("y", xy[1]);
if (!anchor.has("x") || !anchor.has("y")) {
break;
}

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

@ -1770,17 +1770,33 @@ WindowsHashToArrayFunc (const uint64_t& aId,
StreamListeners* aData,
void *userArg)
{
nsISupportsArray *array =
static_cast<nsISupportsArray *>(userArg);
nsPIDOMWindow *window = static_cast<nsPIDOMWindow*>
(nsGlobalWindow::GetInnerWindowWithId(aId));
(void) aData;
nsISupportsArray *array =
static_cast<nsISupportsArray *>(userArg);
nsPIDOMWindow *window = static_cast<nsPIDOMWindow*>
(nsGlobalWindow::GetInnerWindowWithId(aId));
MOZ_ASSERT(window);
if (window) {
array->AppendElement(window);
MOZ_ASSERT(window);
if (window) {
// mActiveWindows contains both windows that have requested device
// access and windows that are currently capturing media. We want
// to return only the latter. See bug 975177.
bool capturing = false;
if (aData) {
uint32_t length = aData->Length();
for (uint32_t i = 0; i < length; ++i) {
nsRefPtr<GetUserMediaCallbackMediaStreamListener> listener =
aData->ElementAt(i);
if (listener->CapturingVideo() || listener->CapturingAudio()) {
capturing = true;
break;
}
}
}
return PL_DHASH_NEXT;
if (capturing)
array->AppendElement(window);
}
return PL_DHASH_NEXT;
}

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

@ -13,7 +13,3 @@ STL_FLAGS = \
MOZ_GLUE_LDFLAGS =
include $(topsrcdir)/config/rules.mk
ifdef GNU_CC
WIN32_EXE_LDFLAGS = -municode
endif

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

@ -15,3 +15,6 @@ UNIFIED_SOURCES += [
include('/ipc/chromium/chromium-config.mozbuild')
DEFINES['NS_NO_XPCOM'] = True
if CONFIG['GNU_CC']:
WIN32_EXE_LDFLAGS += ['-municode']

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

@ -223,20 +223,22 @@ nsXBLDocGlobalObject::GetPrincipal()
/* Implementation file */
static PLDHashOperator
TraverseProtos(const nsACString &aKey, nsXBLPrototypeBinding *aProto, void* aClosure)
static bool
TraverseProtos(nsHashKey *aKey, void *aData, void* aClosure)
{
nsCycleCollectionTraversalCallback *cb =
nsCycleCollectionTraversalCallback *cb =
static_cast<nsCycleCollectionTraversalCallback*>(aClosure);
aProto->Traverse(*cb);
return PL_DHASH_NEXT;
nsXBLPrototypeBinding *proto = static_cast<nsXBLPrototypeBinding*>(aData);
proto->Traverse(*cb);
return kHashEnumerateNext;
}
static PLDHashOperator
UnlinkProtoJSObjects(const nsACString &aKey, nsXBLPrototypeBinding *aProto, void* aClosure)
static bool
UnlinkProtoJSObjects(nsHashKey *aKey, void *aData, void* aClosure)
{
aProto->UnlinkJSObjects();
return PL_DHASH_NEXT;
nsXBLPrototypeBinding *proto = static_cast<nsXBLPrototypeBinding*>(aData);
proto->UnlinkJSObjects();
return kHashEnumerateNext;
}
struct ProtoTracer
@ -245,19 +247,20 @@ struct ProtoTracer
void *mClosure;
};
static PLDHashOperator
TraceProtos(const nsACString &aKey, nsXBLPrototypeBinding *aProto, void* aClosure)
static bool
TraceProtos(nsHashKey *aKey, void *aData, void* aClosure)
{
ProtoTracer* closure = static_cast<ProtoTracer*>(aClosure);
aProto->Trace(closure->mCallbacks, closure->mClosure);
return PL_DHASH_NEXT;
nsXBLPrototypeBinding *proto = static_cast<nsXBLPrototypeBinding*>(aData);
proto->Trace(closure->mCallbacks, closure->mClosure);
return kHashEnumerateNext;
}
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXBLDocumentInfo)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXBLDocumentInfo)
if (tmp->mBindingTable) {
tmp->mBindingTable->EnumerateRead(UnlinkProtoJSObjects, nullptr);
tmp->mBindingTable->Enumerate(UnlinkProtoJSObjects, nullptr);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobalObject)
@ -270,7 +273,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXBLDocumentInfo)
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument)
if (tmp->mBindingTable) {
tmp->mBindingTable->EnumerateRead(TraverseProtos, &cb);
tmp->mBindingTable->Enumerate(TraverseProtos, &cb);
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobalObject)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
@ -278,7 +281,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsXBLDocumentInfo)
if (tmp->mBindingTable) {
ProtoTracer closure = { aCallbacks, aClosure };
tmp->mBindingTable->EnumerateRead(TraceProtos, &closure);
tmp->mBindingTable->Enumerate(TraceProtos, &closure);
}
NS_IMPL_CYCLE_COLLECTION_TRACE_END
@ -288,11 +291,12 @@ UnmarkXBLJSObject(void* aP, const char* aName, void* aClosure)
JS::ExposeObjectToActiveJS(static_cast<JSObject*>(aP));
}
static PLDHashOperator
UnmarkProtos(const nsACString &aKey, nsXBLPrototypeBinding *aProto, void* aClosure)
static bool
UnmarkProtos(nsHashKey* aKey, void* aData, void* aClosure)
{
aProto->Trace(TraceCallbackFunc(UnmarkXBLJSObject), nullptr);
return PL_DHASH_NEXT;
nsXBLPrototypeBinding* proto = static_cast<nsXBLPrototypeBinding*>(aData);
proto->Trace(TraceCallbackFunc(UnmarkXBLJSObject), nullptr);
return kHashEnumerateNext;
}
void
@ -303,7 +307,7 @@ nsXBLDocumentInfo::MarkInCCGeneration(uint32_t aGeneration)
}
// Unmark any JS we hold
if (mBindingTable) {
mBindingTable->EnumerateRead(UnmarkProtos, nullptr);
mBindingTable->Enumerate(UnmarkProtos, nullptr);
}
if (mGlobalObject) {
mGlobalObject->UnmarkCompilationGlobal();
@ -322,6 +326,7 @@ nsXBLDocumentInfo::nsXBLDocumentInfo(nsIDocument* aDocument)
: mDocument(aDocument),
mScriptAccess(true),
mIsChrome(false),
mBindingTable(nullptr),
mFirstBinding(nullptr)
{
nsIURI* uri = aDocument->GetDocumentURI();
@ -362,7 +367,11 @@ nsXBLDocumentInfo::~nsXBLDocumentInfo()
if (mGlobalObject) {
mGlobalObject->ClearGlobalObjectOwner(); // just in case
}
mozilla::DropJSObjects(this);
if (mBindingTable) {
delete mBindingTable;
mBindingTable = nullptr;
mozilla::DropJSObjects(this);
}
}
nsXBLPrototypeBinding*
@ -376,19 +385,32 @@ nsXBLDocumentInfo::GetPrototypeBinding(const nsACString& aRef)
return mFirstBinding;
}
return mBindingTable->Get(aRef);
const nsPromiseFlatCString& flat = PromiseFlatCString(aRef);
nsCStringKey key(flat.get());
return static_cast<nsXBLPrototypeBinding*>(mBindingTable->Get(&key));
}
static bool
DeletePrototypeBinding(nsHashKey* aKey, void* aData, void* aClosure)
{
nsXBLPrototypeBinding* binding = static_cast<nsXBLPrototypeBinding*>(aData);
delete binding;
return true;
}
nsresult
nsXBLDocumentInfo::SetPrototypeBinding(const nsACString& aRef, nsXBLPrototypeBinding* aBinding)
{
if (!mBindingTable) {
mBindingTable = new nsClassHashtable<nsCStringHashKey, nsXBLPrototypeBinding>();
mBindingTable = new nsObjectHashtable(nullptr, nullptr, DeletePrototypeBinding, nullptr);
mozilla::HoldJSObjects(this);
}
NS_ENSURE_STATE(!mBindingTable->Get(aRef));
mBindingTable->Put(aRef, aBinding);
const nsPromiseFlatCString& flat = PromiseFlatCString(aRef);
nsCStringKey key(flat.get());
NS_ENSURE_STATE(!mBindingTable->Get(&key));
mBindingTable->Put(&key, aBinding);
return NS_OK;
}
@ -397,18 +419,22 @@ void
nsXBLDocumentInfo::RemovePrototypeBinding(const nsACString& aRef)
{
if (mBindingTable) {
mBindingTable->Remove(aRef);
// Use a flat string to avoid making a copy.
const nsPromiseFlatCString& flat = PromiseFlatCString(aRef);
nsCStringKey key(flat);
mBindingTable->Remove(&key);
}
}
// Callback to enumerate over the bindings from this document and write them
// out to the cache.
static PLDHashOperator
WriteBinding(const nsACString &aKey, nsXBLPrototypeBinding *aProto, void* aClosure)
bool
WriteBinding(nsHashKey *aKey, void *aData, void* aClosure)
{
aProto->Write((nsIObjectOutputStream*)aClosure);
nsXBLPrototypeBinding* binding = static_cast<nsXBLPrototypeBinding *>(aData);
binding->Write((nsIObjectOutputStream*)aClosure);
return PL_DHASH_NEXT;
return kHashEnumerateNext;
}
// static
@ -504,9 +530,8 @@ nsXBLDocumentInfo::WritePrototypeBindings()
rv = stream->Write32(XBLBinding_Serialize_Version);
NS_ENSURE_SUCCESS(rv, rv);
if (mBindingTable) {
mBindingTable->EnumerateRead(WriteBinding, stream);
}
if (mBindingTable)
mBindingTable->Enumerate(WriteBinding, stream);
// write a end marker at the end
rv = stream->Write8(XBLBinding_Serialize_NoMoreBindings);
@ -529,19 +554,18 @@ nsXBLDocumentInfo::SetFirstPrototypeBinding(nsXBLPrototypeBinding* aBinding)
mFirstBinding = aBinding;
}
static PLDHashOperator
FlushScopedSkinSheets(const nsACString &aKey, nsXBLPrototypeBinding *aProto, void* aClosure)
bool FlushScopedSkinSheets(nsHashKey* aKey, void* aData, void* aClosure)
{
aProto->FlushSkinSheets();
return PL_DHASH_NEXT;
nsXBLPrototypeBinding* proto = (nsXBLPrototypeBinding*)aData;
proto->FlushSkinSheets();
return true;
}
void
nsXBLDocumentInfo::FlushSkinStylesheets()
{
if (mBindingTable) {
mBindingTable->EnumerateRead(FlushScopedSkinSheets, nullptr);
}
if (mBindingTable)
mBindingTable->Enumerate(FlushScopedSkinSheets);
}
JSObject*

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

@ -13,6 +13,7 @@
#include "nsCycleCollectionParticipant.h"
class nsXBLPrototypeBinding;
class nsObjectHashtable;
class nsXBLDocGlobalObject;
class nsXBLDocumentInfo : public nsSupportsWeakReference
@ -40,7 +41,7 @@ public:
nsresult WritePrototypeBindings();
void SetFirstPrototypeBinding(nsXBLPrototypeBinding* aBinding);
void FlushSkinStylesheets();
bool IsChrome() { return mIsChrome; }
@ -59,8 +60,7 @@ private:
bool mScriptAccess;
bool mIsChrome;
// the binding table owns each nsXBLPrototypeBinding
nsAutoPtr<nsClassHashtable<nsCStringHashKey, nsXBLPrototypeBinding>> mBindingTable;
nsObjectHashtable* mBindingTable;
// non-owning pointer to the first binding in the table
nsXBLPrototypeBinding* mFirstBinding;

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

@ -164,7 +164,7 @@ struct DrawSurfaceOptions {
class GradientStops : public RefCounted<GradientStops>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(GradientStops)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStops)
virtual ~GradientStops() {}
virtual BackendType GetBackendType() const = 0;
@ -317,7 +317,7 @@ public:
class SourceSurface : public RefCounted<SourceSurface>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(SourceSurface)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurface)
virtual ~SourceSurface() {}
virtual SurfaceType GetType() const = 0;
@ -341,6 +341,7 @@ public:
class DataSourceSurface : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurface)
DataSourceSurface()
: mIsMapped(false)
{
@ -398,7 +399,7 @@ public:
class PathSink : public RefCounted<PathSink>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(PathSink)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSink)
virtual ~PathSink() {}
/* Move the current point in the path, any figure currently being drawn will
@ -437,7 +438,7 @@ class FlattenedPath;
class Path : public RefCounted<Path>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(Path)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(Path)
virtual ~Path();
virtual BackendType GetBackendType() const = 0;
@ -506,6 +507,7 @@ protected:
class PathBuilder : public PathSink
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilder)
/* Finish writing to the path and return a Path object that can be used for
* drawing. Future use of the builder results in a crash!
*/
@ -537,7 +539,7 @@ struct GlyphBuffer
class ScaledFont : public RefCounted<ScaledFont>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(ScaledFont)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFont)
virtual ~ScaledFont() {}
typedef void (*FontFileDataOutput)(const uint8_t *aData, uint32_t aLength, uint32_t aIndex, Float aGlyphSize, void *aBaton);
@ -596,7 +598,7 @@ struct FontOptions
class GlyphRenderingOptions : public RefCounted<GlyphRenderingOptions>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(GlyphRenderingOptions)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GlyphRenderingOptions)
virtual ~GlyphRenderingOptions() {}
virtual FontType GetType() const = 0;
@ -613,7 +615,7 @@ protected:
class DrawTarget : public RefCounted<DrawTarget>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(DrawTarget)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTarget)
DrawTarget() : mTransformDirty(false), mPermitSubpixelAA(false) {}
virtual ~DrawTarget() {}
@ -996,7 +998,7 @@ protected:
class DrawEventRecorder : public RefCounted<DrawEventRecorder>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(DrawEventRecorder)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorder)
virtual ~DrawEventRecorder() { }
};

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

@ -16,6 +16,7 @@ namespace gfx {
class DataSourceSurfaceWrapper : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceWrapper)
DataSourceSurfaceWrapper(DataSourceSurface *aSurface)
: mSurface(aSurface)
{}

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

@ -25,6 +25,7 @@ class PathRecording;
class DrawEventRecorderPrivate : public DrawEventRecorder
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderPrivate)
DrawEventRecorderPrivate(std::ostream *aStream);
virtual ~DrawEventRecorderPrivate() { }
@ -64,6 +65,7 @@ protected:
class DrawEventRecorderFile : public DrawEventRecorderPrivate
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderFile)
DrawEventRecorderFile(const char *aFilename);
~DrawEventRecorderFile();

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

@ -351,6 +351,7 @@ static CGColorRef ColorToCGColor(CGColorSpaceRef aColorSpace, const Color& aColo
class GradientStopsCG : public GradientStops
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsCG)
//XXX: The skia backend uses a vector and passes in aNumStops. It should do better
GradientStopsCG(GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode)
{

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

@ -95,6 +95,7 @@ SetStrokeOptions(CGContextRef cg, const StrokeOptions &aStrokeOptions)
class DrawTargetCG : public DrawTarget
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetCG)
friend class BorrowedCGContext;
DrawTargetCG();
virtual ~DrawTargetCG();

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

@ -20,6 +20,7 @@ class SourceSurfaceCairo;
class GradientStopsCairo : public GradientStops
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsCairo)
GradientStopsCairo(GradientStop* aStops, uint32_t aNumStops,
ExtendMode aExtendMode)
: mExtendMode(aExtendMode)
@ -51,6 +52,7 @@ class GradientStopsCairo : public GradientStops
class DrawTargetCairo : public DrawTarget
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetCairo)
friend class BorrowedCairoContext;
DrawTargetCairo();

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

@ -43,6 +43,7 @@ struct PrivateD3D10DataD2D
class DrawTargetD2D : public DrawTarget
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetD2D)
DrawTargetD2D();
virtual ~DrawTargetD2D();

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

@ -35,6 +35,7 @@ const int32_t kLayerCacheSize1 = 5;
class DrawTargetD2D1 : public DrawTarget
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetD2D1)
DrawTargetD2D1();
virtual ~DrawTargetD2D1();

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

@ -35,6 +35,7 @@ namespace gfx {
class DrawTargetDual : public DrawTarget
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetDual)
DrawTargetDual(DrawTarget *aA, DrawTarget *aB)
: mA(aA)
, mB(aB)

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

@ -17,6 +17,7 @@ namespace gfx {
class SourceSurfaceRecording : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceRecording)
SourceSurfaceRecording(SourceSurface *aFinalSurface, DrawEventRecorderPrivate *aRecorder)
: mFinalSurface(aFinalSurface), mRecorder(aRecorder)
{
@ -39,6 +40,7 @@ public:
class GradientStopsRecording : public GradientStops
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsRecording)
GradientStopsRecording(GradientStops *aFinalGradientStops, DrawEventRecorderPrivate *aRecorder)
: mFinalGradientStops(aFinalGradientStops), mRecorder(aRecorder)
{
@ -78,6 +80,7 @@ GetGradientStops(GradientStops *aStops)
class FilterNodeRecording : public FilterNode
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeRecording)
using FilterNode::SetAttribute;
FilterNodeRecording(FilterNode *aFinalFilterNode, DrawEventRecorderPrivate *aRecorder)

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

@ -15,6 +15,7 @@ namespace gfx {
class DrawTargetRecording : public DrawTarget
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetRecording)
DrawTargetRecording(DrawEventRecorder *aRecorder, DrawTarget *aDT, bool aHasData = false);
~DrawTargetRecording();

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

@ -36,6 +36,7 @@ namespace gfx {
class GradientStopsSkia : public GradientStops
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsSkia)
GradientStopsSkia(const std::vector<GradientStop>& aStops, uint32_t aNumStops, ExtendMode aExtendMode)
: mCount(aNumStops)
, mExtendMode(aExtendMode)

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

@ -26,6 +26,7 @@ class SourceSurfaceSkia;
class DrawTargetSkia : public DrawTarget
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetSkia)
DrawTargetSkia();
virtual ~DrawTargetSkia();

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

@ -17,6 +17,7 @@ namespace gfx {
class FilterNodeD2D1 : public FilterNode
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeD2D1)
static TemporaryRef<FilterNode> Create(DrawTarget* aDT, ID2D1DeviceContext *aDC, FilterType aType);
FilterNodeD2D1(DrawTarget* aDT, ID2D1Effect *aEffect, FilterType aType)
@ -65,6 +66,7 @@ protected:
class FilterNodeConvolveD2D1 : public FilterNodeD2D1
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveD2D1)
FilterNodeConvolveD2D1(DrawTarget *aDT, ID2D1DeviceContext *aDC);
virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface);
@ -95,6 +97,7 @@ private:
class FilterNodeComponentTransferD2D1 : public FilterNodeD2D1
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeComponentTransferD2D1)
FilterNodeComponentTransferD2D1(DrawTarget *aDT, ID2D1DeviceContext *aDC, ID2D1Effect *aEffect, FilterType aType);
protected:

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

@ -38,6 +38,7 @@ class FilterNodeSoftware : public FilterNode,
public FilterInvalidationListener
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeSoftware)
virtual ~FilterNodeSoftware();
// Factory method, intended to be called from DrawTarget*::CreateFilter.
@ -217,6 +218,7 @@ protected:
class FilterNodeTransformSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTransformSoftware)
FilterNodeTransformSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "Transform"; }
using FilterNodeSoftware::SetAttribute;
@ -238,6 +240,7 @@ private:
class FilterNodeBlendSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlendSoftware)
FilterNodeBlendSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "Blend"; }
using FilterNodeSoftware::SetAttribute;
@ -256,6 +259,7 @@ private:
class FilterNodeMorphologySoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeMorphologySoftware)
FilterNodeMorphologySoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "Morphology"; }
using FilterNodeSoftware::SetAttribute;
@ -276,6 +280,7 @@ private:
class FilterNodeColorMatrixSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeColorMatrixSoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "ColorMatrix"; }
using FilterNodeSoftware::SetAttribute;
virtual void SetAttribute(uint32_t aIndex, const Matrix5x4 &aMatrix) MOZ_OVERRIDE;
@ -295,6 +300,7 @@ private:
class FilterNodeFloodSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeFloodSoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "Flood"; }
using FilterNodeSoftware::SetAttribute;
virtual void SetAttribute(uint32_t aIndex, const Color &aColor) MOZ_OVERRIDE;
@ -311,6 +317,7 @@ private:
class FilterNodeTileSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTileSoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "Tile"; }
using FilterNodeSoftware::SetAttribute;
virtual void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) MOZ_OVERRIDE;
@ -331,6 +338,7 @@ private:
class FilterNodeComponentTransferSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeComponentTransferSoftware)
FilterNodeComponentTransferSoftware();
using FilterNodeSoftware::SetAttribute;
@ -354,6 +362,7 @@ protected:
class FilterNodeTableTransferSoftware : public FilterNodeComponentTransferSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTableTransferSoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "TableTransfer"; }
using FilterNodeComponentTransferSoftware::SetAttribute;
virtual void SetAttribute(uint32_t aIndex, const Float* aFloat, uint32_t aSize) MOZ_OVERRIDE;
@ -373,6 +382,7 @@ private:
class FilterNodeDiscreteTransferSoftware : public FilterNodeComponentTransferSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDiscreteTransferSoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "DiscreteTransfer"; }
using FilterNodeComponentTransferSoftware::SetAttribute;
virtual void SetAttribute(uint32_t aIndex, const Float* aFloat, uint32_t aSize) MOZ_OVERRIDE;
@ -392,6 +402,7 @@ private:
class FilterNodeLinearTransferSoftware : public FilterNodeComponentTransferSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeLinearTransformSoftware)
FilterNodeLinearTransferSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "LinearTransfer"; }
using FilterNodeComponentTransferSoftware::SetAttribute;
@ -416,6 +427,7 @@ private:
class FilterNodeGammaTransferSoftware : public FilterNodeComponentTransferSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGammaTransferSoftware)
FilterNodeGammaTransferSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "GammaTransfer"; }
using FilterNodeComponentTransferSoftware::SetAttribute;
@ -444,6 +456,7 @@ private:
class FilterNodeConvolveMatrixSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveMatrixSoftware)
FilterNodeConvolveMatrixSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "ConvolveMatrix"; }
using FilterNodeSoftware::SetAttribute;
@ -485,6 +498,7 @@ private:
class FilterNodeDisplacementMapSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDisplacementMapSoftware)
FilterNodeDisplacementMapSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "DisplacementMap"; }
using FilterNodeSoftware::SetAttribute;
@ -508,6 +522,7 @@ private:
class FilterNodeTurbulenceSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTurbulenceSoftware)
FilterNodeTurbulenceSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "Turbulence"; }
using FilterNodeSoftware::SetAttribute;
@ -533,6 +548,7 @@ private:
class FilterNodeArithmeticCombineSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeArithmeticCombineSoftware)
FilterNodeArithmeticCombineSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "ArithmeticCombine"; }
using FilterNodeSoftware::SetAttribute;
@ -554,6 +570,7 @@ private:
class FilterNodeCompositeSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCompositeSoftware)
FilterNodeCompositeSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "Composite"; }
using FilterNodeSoftware::SetAttribute;
@ -573,6 +590,8 @@ private:
// FilterNodeDirectionalBlurSoftware.
class FilterNodeBlurXYSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlurXYSoftware)
protected:
virtual TemporaryRef<DataSourceSurface> Render(const IntRect& aRect) MOZ_OVERRIDE;
virtual IntRect GetOutputRectInRect(const IntRect& aRect) MOZ_OVERRIDE;
@ -587,6 +606,7 @@ protected:
class FilterNodeGaussianBlurSoftware : public FilterNodeBlurXYSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGaussianBlurSoftware)
FilterNodeGaussianBlurSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "GaussianBlur"; }
using FilterNodeSoftware::SetAttribute;
@ -602,6 +622,7 @@ private:
class FilterNodeDirectionalBlurSoftware : public FilterNodeBlurXYSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDirectionalBlurSoftware)
FilterNodeDirectionalBlurSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "DirectionalBlur"; }
using FilterNodeSoftware::SetAttribute;
@ -619,6 +640,7 @@ private:
class FilterNodeCropSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCropSoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "Crop"; }
using FilterNodeSoftware::SetAttribute;
virtual void SetAttribute(uint32_t aIndex, const Rect &aSourceRect) MOZ_OVERRIDE;
@ -636,6 +658,7 @@ private:
class FilterNodePremultiplySoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodePremultiplySoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "Premultiply"; }
protected:
virtual TemporaryRef<DataSourceSurface> Render(const IntRect& aRect) MOZ_OVERRIDE;
@ -647,6 +670,7 @@ protected:
class FilterNodeUnpremultiplySoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeUnpremultiplySoftware)
virtual const char* GetName() MOZ_OVERRIDE { return "Unpremultiply"; }
protected:
virtual TemporaryRef<DataSourceSurface> Render(const IntRect& aRect) MOZ_OVERRIDE;
@ -659,6 +683,7 @@ template<typename LightType, typename LightingType>
class FilterNodeLightingSoftware : public FilterNodeSoftware
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeLightingSoftware)
FilterNodeLightingSoftware();
virtual const char* GetName() MOZ_OVERRIDE { return "Lighting"; }
using FilterNodeSoftware::SetAttribute;

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

@ -466,7 +466,7 @@ enum UnpremultiplyInputs
class FilterNode : public RefCounted<FilterNode>
{
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(FilterMode)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNode)
virtual ~FilterNode() {}
virtual FilterBackend GetBackendType() = 0;

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

@ -16,6 +16,7 @@ namespace gfx {
class GradientStopsD2D : public GradientStops
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsD2D)
GradientStopsD2D(ID2D1GradientStopCollection *aStopCollection)
: mStopCollection(aStopCollection)
{}

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

@ -62,7 +62,7 @@ CGContextType GetContextType(CGContextRef ref);
class MacIOSurface : public mozilla::RefCounted<MacIOSurface> {
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(MacIOSurface)
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(MacIOSurface)
typedef mozilla::gfx::SourceSurface SourceSurface;
static mozilla::TemporaryRef<MacIOSurface> CreateIOSurface(int aWidth, int aHeight,
@ -75,7 +75,7 @@ public:
MacIOSurface(const void *aIOSurfacePtr, double aContentsScaleFactor = 1.0, bool aHasAlpha = true)
: mIOSurfacePtr(aIOSurfacePtr), mContentsScaleFactor(aContentsScaleFactor), mHasAlpha(aHasAlpha) {}
~MacIOSurface();
virtual ~MacIOSurface();
IOSurfaceID GetIOSurfaceID();
void *GetBaseAddress();
// GetWidth() and GetHeight() return values in "display pixels". A
@ -112,6 +112,7 @@ private:
class MacIOSurfaceLib: public MacIOSurface {
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(MacIOSurfaceLib)
static void *sIOSurfaceFramework;
static void *sOpenGLFramework;
static void *sCoreGraphicsFramework;

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

@ -23,6 +23,7 @@ struct FlatPathOp
class FlattenedPath : public PathSink
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FlattenedPath)
FlattenedPath() : mCachedLength(0)
, mCalculatedLength(false)
{

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

@ -17,6 +17,7 @@ class PathCG;
class PathBuilderCG : public PathBuilder
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderCG)
// absorbs a reference of aPath
PathBuilderCG(CGMutablePathRef aPath, FillRule aFillRule)
: mFillRule(aFillRule)
@ -61,6 +62,7 @@ private:
class PathCG : public Path
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathCG)
PathCG(CGMutablePathRef aPath, FillRule aFillRule)
: mPath(aPath)
, mFillRule(aFillRule)

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

@ -19,6 +19,7 @@ class PathCairo;
class PathBuilderCairo : public PathBuilder
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderCairo)
PathBuilderCairo(FillRule aFillRule);
virtual void MoveTo(const Point &aPoint);
@ -48,6 +49,7 @@ private: // data
class PathCairo : public Path
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathCairo)
PathCairo(FillRule aFillRule, std::vector<cairo_path_data_t> &aPathData, const Point &aCurrentPoint);
PathCairo(cairo_t *aContext);
~PathCairo();

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

@ -18,6 +18,7 @@ class PathD2D;
class PathBuilderD2D : public PathBuilder
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderD2D)
PathBuilderD2D(ID2D1GeometrySink *aSink, ID2D1PathGeometry *aGeom, FillRule aFillRule)
: mSink(aSink)
, mGeometry(aGeom)
@ -60,6 +61,7 @@ private:
class PathD2D : public Path
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathD2D)
PathD2D(ID2D1PathGeometry *aGeometry, bool aEndedActive,
const Point &aEndPoint, FillRule aFillRule)
: mGeometry(aGeometry)

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

@ -37,6 +37,7 @@ class DrawEventRecorderPrivate;
class PathBuilderRecording : public PathBuilder
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderRecording)
PathBuilderRecording(PathBuilder *aBuilder, FillRule aFillRule)
: mPathBuilder(aBuilder), mFillRule(aFillRule)
{
@ -82,6 +83,7 @@ private:
class PathRecording : public Path
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathRecording)
PathRecording(Path *aPath, const std::vector<PathOp> aOps, FillRule aFillRule)
: mPath(aPath), mPathOps(aOps), mFillRule(aFillRule)
{

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

@ -17,6 +17,7 @@ class PathSkia;
class PathBuilderSkia : public PathBuilder
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderSkia)
PathBuilderSkia(const Matrix& aTransform, const SkPath& aPath, FillRule aFillRule);
PathBuilderSkia(FillRule aFillRule);
@ -46,6 +47,7 @@ private:
class PathSkia : public Path
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSkia)
PathSkia(SkPath& aPath, FillRule aFillRule)
: mFillRule(aFillRule)
{

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

@ -29,6 +29,7 @@ namespace gfx {
class ScaledFontBase : public ScaledFont
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontBase)
ScaledFontBase(Float aSize);
virtual ~ScaledFontBase();

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

@ -16,6 +16,7 @@ namespace gfx {
class ScaledFontCairo : public ScaledFontBase
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontCairo)
ScaledFontCairo(cairo_scaled_font_t* aScaledFont, Float aSize);
@ -32,6 +33,7 @@ public:
class GlyphRenderingOptionsCairo : public GlyphRenderingOptions
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GlyphRenderingOptionsCairo)
GlyphRenderingOptionsCairo()
: mHinting(FontHinting::NORMAL)
, mAutoHinting(false)

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

@ -17,6 +17,7 @@ namespace gfx {
class ScaledFontDWrite MOZ_FINAL : public ScaledFontBase
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontDwrite)
ScaledFontDWrite(IDWriteFontFace *aFont, Float aSize)
: mFontFace(aFont)
, ScaledFontBase(aSize)
@ -48,6 +49,7 @@ public:
class GlyphRenderingOptionsDWrite : public GlyphRenderingOptions
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GlyphRenderingOptionsDWrite)
GlyphRenderingOptionsDWrite(IDWriteRenderingParams *aParams)
: mParams(aParams)
{

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

@ -17,6 +17,7 @@ namespace gfx {
class ScaledFontMac : public ScaledFontBase
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontMac)
ScaledFontMac(CGFontRef aFont, Float aSize);
virtual ~ScaledFontMac();

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

@ -15,6 +15,7 @@ namespace gfx {
class ScaledFontWin : public ScaledFontBase
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontWin)
ScaledFontWin(LOGFONT* aFont, Float aSize);
virtual FontType GetType() const { return FontType::GDI; }

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

@ -26,6 +26,7 @@ class DrawTargetCG;
class SourceSurfaceCG : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceCG)
SourceSurfaceCG() {}
SourceSurfaceCG(CGImageRef aImage) : mImage(aImage) {}
~SourceSurfaceCG();
@ -54,6 +55,7 @@ private:
class DataSourceSurfaceCG : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceCG)
DataSourceSurfaceCG() {}
DataSourceSurfaceCG(CGImageRef aImage);
~DataSourceSurfaceCG();
@ -88,6 +90,7 @@ private:
class SourceSurfaceCGContext : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceCGContext)
virtual void DrawTargetWillChange() = 0;
virtual CGImageRef GetImage() = 0;
};
@ -95,6 +98,7 @@ public:
class SourceSurfaceCGBitmapContext : public SourceSurfaceCGContext
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceCGBitmapContext)
SourceSurfaceCGBitmapContext(DrawTargetCG *);
~SourceSurfaceCGBitmapContext();
@ -150,6 +154,7 @@ private:
class SourceSurfaceCGIOSurfaceContext : public SourceSurfaceCGContext
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceCGIOSurfaceContext)
SourceSurfaceCGIOSurfaceContext(DrawTargetCG *);
~SourceSurfaceCGIOSurfaceContext();

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

@ -16,6 +16,7 @@ class DrawTargetCairo;
class SourceSurfaceCairo : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceCairo)
// Create a SourceSurfaceCairo. The surface will not be copied, but simply
// referenced.
// If aDrawTarget is non-nullptr, it is assumed that this is a snapshot source
@ -47,6 +48,7 @@ private: // data
class DataSourceSurfaceCairo : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceCairo)
DataSourceSurfaceCairo(cairo_surface_t* imageSurf);
virtual ~DataSourceSurfaceCairo();
virtual unsigned char *GetData();

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

@ -18,6 +18,7 @@ class DataSourceSurfaceD2D;
class SourceSurfaceD2D : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceD2D)
SourceSurfaceD2D();
~SourceSurfaceD2D();
@ -55,6 +56,7 @@ private:
class DataSourceSurfaceD2D : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceD2D)
DataSourceSurfaceD2D(SourceSurfaceD2D* aSourceSurface);
virtual ~DataSourceSurfaceD2D();

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

@ -20,6 +20,7 @@ class DrawTargetD2D1;
class SourceSurfaceD2D1 : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceD2D1)
SourceSurfaceD2D1(ID2D1Image* aImage, ID2D1DeviceContext *aDC,
SurfaceFormat aFormat, const IntSize &aSize,
DrawTargetD2D1 *aDT = nullptr);
@ -62,6 +63,7 @@ private:
class DataSourceSurfaceD2D1 : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceD2D1)
DataSourceSurfaceD2D1(ID2D1Bitmap1 *aMappableBitmap, SurfaceFormat aFormat);
~DataSourceSurfaceD2D1();

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

@ -19,6 +19,7 @@ class DrawTargetD2D;
class SourceSurfaceD2DTarget : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceD2DTarget)
SourceSurfaceD2DTarget(DrawTargetD2D* aDrawTarget, ID3D10Texture2D* aTexture,
SurfaceFormat aFormat);
~SourceSurfaceD2DTarget();
@ -60,6 +61,7 @@ private:
class DataSourceSurfaceD2DTarget : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceD2DTarget)
DataSourceSurfaceD2DTarget(SurfaceFormat aFormat);
~DataSourceSurfaceD2DTarget();

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

@ -17,6 +17,7 @@ class DualPattern;
class SourceSurfaceDual : public SourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceDual)
SourceSurfaceDual(DrawTarget *aDTA, DrawTarget *aDTB)
: mA(aDTA->Snapshot())
, mB(aDTB->Snapshot())

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

@ -15,6 +15,7 @@ namespace gfx {
class SourceSurfaceRawData : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceRawData)
SourceSurfaceRawData() {}
~SourceSurfaceRawData() { if(mOwnData) delete [] mRawData; }
@ -42,6 +43,7 @@ private:
class SourceSurfaceAlignedRawData : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceAlignedRawData)
SourceSurfaceAlignedRawData() {}
virtual uint8_t *GetData() { return mArray; }

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

@ -19,6 +19,7 @@ class DrawTargetSkia;
class SourceSurfaceSkia : public DataSourceSurface
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceSkia)
SourceSurfaceSkia();
~SourceSurfaceSkia();

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

@ -41,8 +41,8 @@ TextureClientX11::Lock(OpenMode aMode)
{
// XXX - Turn this into a fatal assertion as soon as Bug 952507 is fixed
NS_WARN_IF_FALSE(!mLocked, "The TextureClient is already Locked!");
mLocked = true;
return IsValid() && IsAllocated();
mLocked = IsValid() && IsAllocated();
return mLocked;
}
void

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

@ -55,12 +55,16 @@ static nsIntRect
GetOpaqueRect(Layer* aLayer)
{
nsIntRect result;
gfx::Matrix matrix;
bool is2D = aLayer->GetBaseTransform().Is2D(&matrix);
// Just bail if there's anything difficult to handle.
if (!aLayer->GetEffectiveTransform().IsIdentity() ||
aLayer->GetEffectiveOpacity() != 1.0f ||
aLayer->GetMaskLayer()) {
if (!is2D || aLayer->GetMaskLayer() ||
aLayer->GetEffectiveOpacity() != 1.0f ||
matrix.HasNonIntegerTranslation()) {
return result;
}
if (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE) {
result = aLayer->GetEffectiveVisibleRegion().GetLargestRectangle();
} else {
@ -72,10 +76,16 @@ GetOpaqueRect(Layer* aLayer)
result = GetOpaqueRect(refLayer->GetFirstChild());
}
}
// Translate our opaque region to cover the child
gfx::Point point = matrix.GetTranslation();
result.MoveBy(static_cast<int>(point.x), static_cast<int>(point.y));
const nsIntRect* clipRect = aLayer->GetEffectiveClipRect();
if (clipRect) {
result.IntersectRect(result, *clipRect);
}
return result;
}

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

@ -1978,7 +1978,7 @@ void AsyncPanZoomController::TimeoutContentResponse() {
void AsyncPanZoomController::UpdateZoomConstraints(const ZoomConstraints& aConstraints) {
APZC_LOG("%p updating zoom constraints to %d %f %f\n", this, aConstraints.mAllowZoom,
aConstraints.mMinZoom.scale, aConstraints.mMaxZoom.scale);
if (IsFloatNaN(aConstraints.mMinZoom.scale) || IsFloatNaN(aConstraints.mMinZoom.scale)) {
if (IsFloatNaN(aConstraints.mMinZoom.scale) || IsFloatNaN(aConstraints.mMaxZoom.scale)) {
NS_WARNING("APZC received zoom constraints with NaN values; dropping...\n");
return;
}

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

@ -97,12 +97,12 @@ ShadowAfter(const OpInsertAfter& op)
}
static ShadowLayerParent*
ShadowContainer(const OpAppendChild& op)
ShadowContainer(const OpPrependChild& op)
{
return cast(op.containerParent());
}
static ShadowLayerParent*
ShadowChild(const OpAppendChild& op)
ShadowChild(const OpPrependChild& op)
{
return cast(op.childLayerParent());
}
@ -416,10 +416,10 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
}
break;
}
case Edit::TOpAppendChild: {
MOZ_LAYERS_LOG(("[ParentSide] AppendChild"));
case Edit::TOpPrependChild: {
MOZ_LAYERS_LOG(("[ParentSide] PrependChild"));
const OpAppendChild& oac = edit.get_OpAppendChild();
const OpPrependChild& oac = edit.get_OpPrependChild();
Layer* child = ShadowChild(oac)->AsLayer();
if (!child) {
return false;

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

@ -247,7 +247,7 @@ struct OpSetLayerAttributes {
// Monkey with the tree structure
struct OpSetRoot { PLayer root; };
struct OpInsertAfter { PLayer container; PLayer childLayer; PLayer after; };
struct OpAppendChild { PLayer container; PLayer childLayer; };
struct OpPrependChild { PLayer container; PLayer childLayer; };
struct OpRemoveChild { PLayer container; PLayer childLayer; };
struct OpRepositionChild { PLayer container; PLayer childLayer; PLayer after; };
struct OpRaiseToTopChild { PLayer container; PLayer childLayer; };
@ -371,7 +371,7 @@ union Edit {
OpSetRoot;
OpInsertAfter;
OpAppendChild;
OpPrependChild;
OpRemoveChild;
OpRepositionChild;
OpRaiseToTopChild;

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

@ -276,8 +276,8 @@ ShadowLayerForwarder::InsertAfter(ShadowableLayer* aContainer,
nullptr, Shadow(aChild),
nullptr, Shadow(aAfter)));
else
mTxn->AddEdit(OpAppendChild(nullptr, Shadow(aContainer),
nullptr, Shadow(aChild)));
mTxn->AddEdit(OpPrependChild(nullptr, Shadow(aContainer),
nullptr, Shadow(aChild)));
}
void
ShadowLayerForwarder::RemoveChild(ShadowableLayer* aContainer,

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

@ -824,8 +824,15 @@ CompositorOGL::GetShaderConfigFor(Effect *aEffect, MaskType aMask) const
config.SetYCbCr(true);
break;
case EFFECT_COMPONENT_ALPHA:
{
config.SetComponentAlpha(true);
EffectComponentAlpha* effectComponentAlpha =
static_cast<EffectComponentAlpha*>(aEffect);
gfx::SurfaceFormat format = effectComponentAlpha->mOnWhite->GetFormat();
config.SetRBSwap(format == gfx::SurfaceFormat::B8G8R8A8 ||
format == gfx::SurfaceFormat::B8G8R8X8);
break;
}
case EFFECT_RENDER_TARGET:
config.SetTextureTarget(mFBOTextureTarget);
break;

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

@ -744,7 +744,6 @@ if CONFIG['MOZ_WIDGET_QT']:
'trunk/src/ports/SkTime_Unix.cpp',
'trunk/src/ports/SkTLS_pthread.cpp',
'trunk/src/utils/SkThreadUtils_pthread.cpp',
'trunk/src/utils/SkThreadUtils_pthread_linux.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
SOURCES += [

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

@ -36,12 +36,6 @@ NSDISTMODE = copy
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
include $(topsrcdir)/config/rules.mk
LDFLAGS += $(MOZ_ALLOW_HEAP_EXECUTE_FLAGS)

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

@ -29,3 +29,8 @@ if CONFIG['MOZ_CONTENT_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
'/security/sandbox',
'/security/sandbox/chromium',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

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

@ -12,8 +12,4 @@ LIBS = \
include $(topsrcdir)/config/config.mk
ifdef _MSC_VER
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
include $(topsrcdir)/config/rules.mk

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

@ -16,3 +16,5 @@ LOCAL_INCLUDES += [
'/xpcom/base',
]
if CONFIG['_MSC_VER']:
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

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

@ -78,6 +78,10 @@ class ProfileEntry
// a pc into a script's code. To signify a nullptr pc, use a -1 index. This
// is checked against in pc() and setPC() to set/get the right pc.
static const int32_t NullPCIndex = -1;
// This bit is added to the stack address to indicate that copying the
// frame label is not necessary when taking a sample of the pseudostack.
static const uintptr_t NoCopyBit = 1;
};
JS_FRIEND_API(void)

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

@ -1048,7 +1048,7 @@ InitClass(JSContext *cx, Handle<GlobalObject*> global, const Class *clasp, JSPro
return nullptr;
proto->setPrivate(nullptr);
Rooted<JSFunction*> ctor(cx, global->createConstructor(cx, construct, ClassName(key, cx), 1));
Rooted<JSFunction*> ctor(cx, global->createConstructor(cx, construct, ClassName(key, cx), 0));
if (!ctor ||
!LinkConstructorAndPrototype(cx, ctor, proto) ||
!DefinePropertiesAndBrand(cx, proto, properties, methods) ||

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

@ -636,10 +636,9 @@ js::regexp_exec(JSContext *cx, unsigned argc, Value *vp)
/* Separate interface for use by IonMonkey. */
bool
js::regexp_exec_raw(JSContext *cx, HandleObject regexp, HandleString input, Value *vp)
js::regexp_exec_raw(JSContext *cx, HandleObject regexp, HandleString input, MutableHandleValue output)
{
MutableHandleValue vpHandle = MutableHandleValue::fromMarkedLocation(vp);
return regexp_exec_impl(cx, regexp, input, UpdateRegExpStatics, vpHandle);
return regexp_exec_impl(cx, regexp, input, UpdateRegExpStatics, output);
}
bool

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

@ -45,7 +45,7 @@ CreateRegExpMatchResult(JSContext *cx, HandleString input, const MatchPairs &mat
MutableHandleValue rval);
extern bool
regexp_exec_raw(JSContext *cx, HandleObject regexp, HandleString input, Value *vp);
regexp_exec_raw(JSContext *cx, HandleObject regexp, HandleString input, MutableHandleValue output);
extern bool
regexp_exec(JSContext *cx, unsigned argc, Value *vp);

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

@ -2427,6 +2427,11 @@ TypedObject::constructUnsized(JSContext *cx, unsigned int argc, Value *vp)
// Length constructor.
if (args[0].isInt32()) {
int32_t length = args[0].toInt32();
if (length < 0) {
JS_ReportErrorNumber(cx, js_GetErrorMessage,
nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS);
return nullptr;
}
Rooted<TypedObject*> obj(cx, createZeroed(cx, callee, length));
if (!obj)
return false;

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

@ -3,7 +3,7 @@
# 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/.
import os, posixpath, shlex, shutil, subprocess, sys, traceback
import math, os, posixpath, shlex, shutil, subprocess, sys, traceback
def add_libdir_to_path():
from os.path import dirname, exists, join, realpath
@ -97,6 +97,10 @@ def main(argv):
help='The location of libraries to push -- preferably stripped')
op.add_option('--repeat', type=int, default=1,
help='Repeat tests the given number of times.')
op.add_option('--this-chunk', type=int, default=1,
help='The test chunk to run.')
op.add_option('--total-chunks', type=int, default=1,
help='The total number of test chunks.')
options, args = op.parse_args(argv)
if len(args) < 1:
@ -160,6 +164,15 @@ def main(argv):
if not options.run_slow:
test_list = [ _ for _ in test_list if not _.slow ]
# If chunking is enabled, determine which tests are part of this chunk.
# This code was adapted from testing/mochitest/runtestsremote.py.
if options.total_chunks > 1:
total_tests = len(test_list)
tests_per_chunk = math.ceil(total_tests / float(options.total_chunks))
start = int(round((options.this_chunk - 1) * tests_per_chunk))
end = int(round(options.this_chunk * tests_per_chunk))
test_list = test_list[start:end]
# The full test list is ready. Now create copies for each JIT configuration.
job_list = []
if options.tbpl:

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

@ -0,0 +1,21 @@
// This test exposed a bug in float32 optimization.
// The (inlined and optimized) code for `add()` created
// MDiv instructions specialized to integers, which was
// then "respecialized" to float32, leading to internal
// assertion errors.
//
// Public domain.
if (!this.hasOwnProperty("TypedObject"))
quit();
var {StructType,uint8,float32} = TypedObject;
var RgbColor2 = new StructType({r: uint8, g: float32, b: uint8});
RgbColor2.prototype.add = function(c) {
this.g += c;
this.b += c;
};
var gray = new RgbColor2({r: 129, g: 128, b: 127});
gray.add(1);
gray.add(2);

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

@ -0,0 +1,11 @@
// |jit-test| error:TypeError
if (!this.hasOwnProperty("TypedObject"))
throw new TypeError();
// Test that we detect invalid lengths supplied to unsized array
// constructor. Public domain.
var AA = TypedObject.uint8.array(2147483647).array();
var aa = new AA(-1);

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

@ -0,0 +1,18 @@
Function("\
g = (function(t,foreign){\
\"use asm\";\
var ff = foreign.ff;\
function f() {\
+ff()\
}\
return f\
})(this, {\
ff: arguments.callee\
}, ArrayBuffer(4096))\
")()
function m(f) {
for (var j = 0; j < 6000; ++j) {
f();
}
}
m(g);

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

@ -9,7 +9,7 @@ assertEq(desc.writable, true);
assertEq(typeof Map, 'function');
assertEq(Object.keys(Map).length, 0);
assertEq(Map.length, 1);
assertEq(Map.length, 0);
assertEq(Map.name, "Map");
assertEq(Object.getPrototypeOf(Map.prototype), Object.prototype);

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

@ -9,7 +9,7 @@ assertEq(desc.writable, true);
assertEq(typeof Set, 'function');
assertEq(Object.keys(Set).length, 0);
assertEq(Set.length, 1);
assertEq(Set.length, 0);
assertEq(Set.name, "Set");
assertEq(Object.getPrototypeOf(Set.prototype), Object.prototype);

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

@ -833,9 +833,40 @@ AsmJSModule::deserialize(ExclusiveContext *cx, const uint8_t *cursor)
return cursor;
}
bool
AsmJSModule::clone(ExclusiveContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) const
// When a module is cloned, we memcpy its executable code. If, right before or
// during the clone, another thread calls AsmJSModule::protectCode() then the
// executable code will become inaccessible. In theory, we could take away only
// PROT_EXEC, but this seems to break emulators.
class AutoUnprotectCodeForClone
{
JSRuntime *rt_;
JSRuntime::AutoLockForOperationCallback lock_;
const AsmJSModule &module_;
const bool protectedBefore_;
public:
AutoUnprotectCodeForClone(JSContext *cx, const AsmJSModule &module)
: rt_(cx->runtime()),
lock_(rt_),
module_(module),
protectedBefore_(module_.codeIsProtected(rt_))
{
if (protectedBefore_)
module_.unprotectCode(rt_);
}
~AutoUnprotectCodeForClone()
{
if (protectedBefore_)
module_.protectCode(rt_);
}
};
bool
AsmJSModule::clone(JSContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) const
{
AutoUnprotectCodeForClone cloneGuard(cx, *this);
*moduleOut = cx->new_<AsmJSModule>(scriptSource_, charsBegin_);
if (!*moduleOut)
return false;
@ -871,6 +902,48 @@ AsmJSModule::clone(ExclusiveContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleO
return true;
}
void
AsmJSModule::protectCode(JSRuntime *rt) const
{
JS_ASSERT(rt->currentThreadOwnsOperationCallbackLock());
// Technically, we should be able to only take away the execute permissions,
// however this seems to break our emulators which don't always check
// execute permissions while executing code.
#if defined(XP_WIN)
DWORD oldProtect;
if (!VirtualProtect(codeBase(), functionBytes(), PAGE_NOACCESS, &oldProtect))
MOZ_CRASH();
#else // assume Unix
if (mprotect(codeBase(), functionBytes(), PROT_NONE))
MOZ_CRASH();
#endif
codeIsProtected_ = true;
}
void
AsmJSModule::unprotectCode(JSRuntime *rt) const
{
#if defined(XP_WIN)
DWORD oldProtect;
if (!VirtualProtect(codeBase(), functionBytes(), PAGE_EXECUTE_READWRITE, &oldProtect))
MOZ_CRASH();
#else // assume Unix
if (mprotect(codeBase(), functionBytes(), PROT_READ | PROT_WRITE | PROT_EXEC))
MOZ_CRASH();
#endif
codeIsProtected_ = false;
}
bool
AsmJSModule::codeIsProtected(JSRuntime *rt) const
{
JS_ASSERT(rt->currentThreadOwnsOperationCallbackLock());
return codeIsProtected_;
}
static bool
GetCPUID(uint32_t *cpuId)
{

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

@ -416,6 +416,11 @@ class AsmJSModule
FunctionCountsVector functionCounts_;
// This field is accessed concurrently when triggering the operation
// callback and access must be sychronized via the runtime's operation
// callback lock.
mutable bool codeIsProtected_;
public:
explicit AsmJSModule(ScriptSource *scriptSource, uint32_t charsBegin);
~AsmJSModule();
@ -806,7 +811,13 @@ class AsmJSModule
const uint8_t *deserialize(ExclusiveContext *cx, const uint8_t *cursor);
bool loadedFromCache() const { return loadedFromCache_; }
bool clone(ExclusiveContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) const;
bool clone(JSContext *cx, ScopedJSDeletePtr<AsmJSModule> *moduleOut) const;
// These methods may only be called while holding the Runtime's operation
// callback lock.
void protectCode(JSRuntime *rt) const;
void unprotectCode(JSRuntime *rt) const;
bool codeIsProtected(JSRuntime *rt) const;
};
// Store the just-parsed module in the cache using AsmJSCacheOps.

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

@ -458,9 +458,7 @@ HandleException(PEXCEPTION_POINTERS exception)
if (module.containsPC(faultingAddress)) {
activation->setResumePC(pc);
*ppc = module.operationCallbackExit();
DWORD oldProtect;
if (!VirtualProtect(module.codeBase(), module.functionBytes(), PAGE_EXECUTE, &oldProtect))
MOZ_CRASH();
module.unprotectCode(rt);
return true;
}
@ -645,7 +643,7 @@ HandleMachException(JSRuntime *rt, const ExceptionRequest &request)
const AsmJSModule &module = activation->module();
if (HandleSimulatorInterrupt(rt, activation, faultingAddress)) {
mprotect(module.codeBase(), module.functionBytes(), PROT_EXEC);
module.unprotectCode(rt);
return true;
}
@ -660,7 +658,7 @@ HandleMachException(JSRuntime *rt, const ExceptionRequest &request)
if (module.containsPC(faultingAddress)) {
activation->setResumePC(pc);
*ppc = module.operationCallbackExit();
mprotect(module.codeBase(), module.functionBytes(), PROT_EXEC);
module.unprotectCode(rt);
// Update the thread state with the new pc.
kret = thread_set_state(rtThread, x86_THREAD_STATE, (thread_state_t)&state, x86_THREAD_STATE_COUNT);
@ -892,7 +890,7 @@ HandleSignal(int signum, siginfo_t *info, void *ctx)
const AsmJSModule &module = activation->module();
if (HandleSimulatorInterrupt(rt, activation, faultingAddress)) {
mprotect(module.codeBase(), module.functionBytes(), PROT_EXEC);
module.unprotectCode(rt);
return true;
}
@ -907,7 +905,7 @@ HandleSignal(int signum, siginfo_t *info, void *ctx)
if (module.containsPC(faultingAddress)) {
activation->setResumePC(pc);
*ppc = module.operationCallbackExit();
mprotect(module.codeBase(), module.functionBytes(), PROT_EXEC);
module.unprotectCode(rt);
return true;
}
@ -1027,16 +1025,7 @@ js::TriggerOperationCallbackForAsmJSCode(JSRuntime *rt)
if (!activation)
return;
const AsmJSModule &module = activation->module();
#if defined(XP_WIN)
DWORD oldProtect;
if (!VirtualProtect(module.codeBase(), module.functionBytes(), PAGE_NOACCESS, &oldProtect))
MOZ_CRASH();
#else // assume Unix
if (mprotect(module.codeBase(), module.functionBytes(), PROT_NONE))
MOZ_CRASH();
#endif
activation->module().protectCode(rt);
}
#if defined(MOZ_ASAN) && defined(JS_STANDALONE)

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

@ -2481,23 +2481,23 @@ DoBinaryArithFallback(JSContext *cx, BaselineFrame *frame, ICBinaryArith_Fallbac
switch(op) {
case JSOP_ADD:
// Do an add.
if (!AddValues(cx, &lhsCopy, &rhsCopy, ret.address()))
if (!AddValues(cx, &lhsCopy, &rhsCopy, ret))
return false;
break;
case JSOP_SUB:
if (!SubValues(cx, &lhsCopy, &rhsCopy, ret.address()))
if (!SubValues(cx, &lhsCopy, &rhsCopy, ret))
return false;
break;
case JSOP_MUL:
if (!MulValues(cx, &lhsCopy, &rhsCopy, ret.address()))
if (!MulValues(cx, &lhsCopy, &rhsCopy, ret))
return false;
break;
case JSOP_DIV:
if (!DivValues(cx, &lhsCopy, &rhsCopy, ret.address()))
if (!DivValues(cx, &lhsCopy, &rhsCopy, ret))
return false;
break;
case JSOP_MOD:
if (!ModValues(cx, &lhsCopy, &rhsCopy, ret.address()))
if (!ModValues(cx, &lhsCopy, &rhsCopy, ret))
return false;
break;
case JSOP_BITOR: {
@ -2536,7 +2536,7 @@ DoBinaryArithFallback(JSContext *cx, BaselineFrame *frame, ICBinaryArith_Fallbac
break;
}
case JSOP_URSH: {
if (!UrshOperation(cx, lhs, rhs, ret.address()))
if (!UrshOperation(cx, lhs, rhs, ret))
return false;
break;
}

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

@ -877,7 +877,7 @@ CodeGenerator::visitRegExp(LRegExp *lir)
}
typedef bool (*RegExpExecRawFn)(JSContext *cx, HandleObject regexp,
HandleString input, Value *vp);
HandleString input, MutableHandleValue output);
static const VMFunction RegExpExecRawInfo = FunctionInfo<RegExpExecRawFn>(regexp_exec_raw);
bool
@ -4366,8 +4366,8 @@ CodeGenerator::visitModD(LModD *ins)
return true;
}
typedef bool (*BinaryFn)(JSContext *, MutableHandleValue, MutableHandleValue, Value *);
typedef bool (*BinaryParFn)(ForkJoinContext *, HandleValue, HandleValue, Value *);
typedef bool (*BinaryFn)(JSContext *, MutableHandleValue, MutableHandleValue, MutableHandleValue);
typedef bool (*BinaryParFn)(ForkJoinContext *, HandleValue, HandleValue, MutableHandleValue);
static const VMFunction AddInfo = FunctionInfo<BinaryFn>(js::AddValues);
static const VMFunction SubInfo = FunctionInfo<BinaryFn>(js::SubValues);

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

@ -799,7 +799,7 @@ TypeAnalyzer::markPhiConsumers()
bool canConsumeFloat32 = true;
for (MUseDefIterator use(*phi); canConsumeFloat32 && use; use++) {
MDefinition *usedef = use.def();
canConsumeFloat32 &= usedef->isPhi() || usedef->canConsumeFloat32();
canConsumeFloat32 &= usedef->isPhi() || usedef->canConsumeFloat32(use.use());
}
phi->setCanConsumeFloat32(canConsumeFloat32);
if (canConsumeFloat32 && !addPhiToWorklist(*phi))
@ -812,12 +812,12 @@ TypeAnalyzer::markPhiConsumers()
return false;
MPhi *phi = popPhi();
JS_ASSERT(phi->canConsumeFloat32());
JS_ASSERT(phi->canConsumeFloat32(nullptr /* unused */));
bool validConsumer = true;
for (MUseDefIterator use(phi); use; use++) {
MDefinition *def = use.def();
if (def->isPhi() && !def->canConsumeFloat32()) {
if (def->isPhi() && !def->canConsumeFloat32(use.use())) {
validConsumer = false;
break;
}
@ -830,7 +830,7 @@ TypeAnalyzer::markPhiConsumers()
phi->setCanConsumeFloat32(false);
for (size_t i = 0, e = phi->numOperands(); i < e; ++i) {
MDefinition *input = phi->getOperand(i);
if (input->isPhi() && !input->isInWorklist() && input->canConsumeFloat32())
if (input->isPhi() && !input->isInWorklist() && input->canConsumeFloat32(nullptr /* unused */))
{
if (!addPhiToWorklist(input->toPhi()))
return false;
@ -976,7 +976,7 @@ TypeAnalyzer::checkFloatCoherency()
for (MUseDefIterator use(*def); use; use++) {
MDefinition *consumer = use.def();
JS_ASSERT(consumer->isConsistentFloat32Use());
JS_ASSERT(consumer->isConsistentFloat32Use(use.use()));
}
}
}

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

@ -43,7 +43,7 @@ CheckUsesAreFloat32Consumers(MInstruction *ins)
{
bool allConsumerUses = true;
for (MUseDefIterator use(ins); allConsumerUses && use; use++)
allConsumerUses &= use.def()->canConsumeFloat32();
allConsumerUses &= use.def()->canConsumeFloat32(use.use());
return allConsumerUses;
}

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

@ -470,12 +470,12 @@ class MDefinition : public MNode
// specialization algorithm).
virtual bool isFloat32Commutative() const { return false; }
virtual bool canProduceFloat32() const { return false; }
virtual bool canConsumeFloat32() const { return false; }
virtual bool canConsumeFloat32(MUse *use) const { return false; }
virtual void trySpecializeFloat32(TempAllocator &alloc) {}
#ifdef DEBUG
// Used during the pass that checks that Float32 flow into valid MDefinitions
virtual bool isConsistentFloat32Use() const {
return type() == MIRType_Float32 || canConsumeFloat32();
virtual bool isConsistentFloat32Use(MUse *use) const {
return type() == MIRType_Float32 || canConsumeFloat32(use);
}
#endif
@ -1329,7 +1329,7 @@ class MTest
return operandMightEmulateUndefined_;
}
#ifdef DEBUG
bool isConsistentFloat32Use() const {
bool isConsistentFloat32Use(MUse *use) const {
return true;
}
#endif
@ -2060,7 +2060,7 @@ class MAssertFloat32 : public MUnaryInstruction
return new(alloc) MAssertFloat32(value, mustBeFloat32);
}
bool canConsumeFloat32() const { return true; }
bool canConsumeFloat32(MUse *use) const { return true; }
bool mustBeFloat32() const { return mustBeFloat32_; }
};
@ -2336,7 +2336,8 @@ class MCompare
bool isOperandTruncated(size_t index) const;
# ifdef DEBUG
bool isConsistentFloat32Use() const {
bool isConsistentFloat32Use(MUse *use) const {
// Both sides of the compare can be Float32
return compareType_ == Compare_Float32;
}
# endif
@ -2902,7 +2903,7 @@ class MToDouble
bool isOperandTruncated(size_t index) const;
#ifdef DEBUG
bool isConsistentFloat32Use() const { return true; }
bool isConsistentFloat32Use(MUse *use) const { return true; }
#endif
};
@ -2961,7 +2962,7 @@ class MToFloat32
void computeRange(TempAllocator &alloc);
bool canConsumeFloat32() const { return true; }
bool canConsumeFloat32(MUse *use) const { return true; }
bool canProduceFloat32() const { return true; }
};
@ -3077,7 +3078,7 @@ class MToInt32
void computeRange(TempAllocator &alloc);
#ifdef DEBUG
bool isConsistentFloat32Use() const { return true; }
bool isConsistentFloat32Use(MUse *use) const { return true; }
#endif
};
@ -3113,7 +3114,7 @@ class MTruncateToInt32 : public MUnaryInstruction
void computeRange(TempAllocator &alloc);
bool isOperandTruncated(size_t index) const;
# ifdef DEBUG
bool isConsistentFloat32Use() const {
bool isConsistentFloat32Use(MUse *use) const {
return true;
}
#endif
@ -4574,7 +4575,7 @@ class MPhi MOZ_FINAL : public MDefinition, public InlineForwardListNode<MPhi>
canProduceFloat32_ = can;
}
bool canConsumeFloat32() const {
bool canConsumeFloat32(MUse *use) const {
return canConsumeFloat32_;
}
@ -5666,7 +5667,7 @@ class MNot
void trySpecializeFloat32(TempAllocator &alloc);
bool isFloat32Commutative() const { return true; }
#ifdef DEBUG
bool isConsistentFloat32Use() const {
bool isConsistentFloat32Use(MUse *use) const {
return true;
}
#endif
@ -6358,7 +6359,9 @@ class MStoreTypedArrayElement
}
bool isOperandTruncated(size_t index) const;
bool canConsumeFloat32() const { return arrayType_ == ScalarTypeDescr::TYPE_FLOAT32; }
bool canConsumeFloat32(MUse *use) const {
return use->index() == 2 && arrayType_ == ScalarTypeDescr::TYPE_FLOAT32;
}
};
class MStoreTypedArrayElementHole
@ -6424,7 +6427,9 @@ class MStoreTypedArrayElementHole
}
bool isOperandTruncated(size_t index) const;
bool canConsumeFloat32() const { return arrayType_ == ScalarTypeDescr::TYPE_FLOAT32; }
bool canConsumeFloat32(MUse *use) const {
return use->index() == 3 && arrayType_ == ScalarTypeDescr::TYPE_FLOAT32;
}
};
// Store a value infallibly to a statically known typed array.
@ -6469,7 +6474,9 @@ class MStoreTypedArrayElementStatic :
}
bool isOperandTruncated(size_t index) const;
bool canConsumeFloat32() const { return typedArray_->type() == ScalarTypeDescr::TYPE_FLOAT32; }
bool canConsumeFloat32(MUse *use) const {
return use->index() == 1 && typedArray_->type() == ScalarTypeDescr::TYPE_FLOAT32;
}
};
// Compute an "effective address", i.e., a compound computation of the form:
@ -7857,7 +7864,7 @@ class MSetElementCache
return this;
}
bool canConsumeFloat32() const { return true; }
bool canConsumeFloat32(MUse *use) const { return use->index() == 2; }
};
class MCallGetProperty
@ -8243,7 +8250,7 @@ class MFloor
}
void trySpecializeFloat32(TempAllocator &alloc);
#ifdef DEBUG
bool isConsistentFloat32Use() const {
bool isConsistentFloat32Use(MUse *use) const {
return true;
}
#endif
@ -8888,10 +8895,10 @@ class MPostWriteBarrier
return getOperand(1);
}
#ifdef DEBUG
bool isConsistentFloat32Use() const {
bool isConsistentFloat32Use(MUse *use) const {
// During lowering, values that neither have object nor value MIR type
// are ignored, thus Float32 can show up at this point without any issue.
return true;
return use->index() == 1;
}
#endif
};

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

@ -541,7 +541,7 @@ jit::BitRshPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *o
bool
jit::UrshValuesPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs,
Value *out)
MutableHandleValue out)
{
uint32_t left;
int32_t right;
@ -550,7 +550,7 @@ jit::UrshValuesPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs,
if (!NonObjectToUint32(cx, lhs, &left) || !NonObjectToInt32(cx, rhs, &right))
return false;
left >>= right & 31;
out->setNumber(uint32_t(left));
out.setNumber(uint32_t(left));
return true;
}

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

@ -63,7 +63,7 @@ bool BitAndPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *o
bool BitLshPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
bool BitRshPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
bool UrshValuesPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, Value *out);
bool UrshValuesPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue out);
// Make a new rest parameter in parallel.
JSObject *InitRestParameterPar(ForkJoinContext *cx, uint32_t length, Value *rest,

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

@ -622,14 +622,14 @@ BitRsh(JSContext *cx, HandleValue lhs, HandleValue rhs, int *out)
}
static MOZ_ALWAYS_INLINE bool
UrshOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *out)
UrshOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue out)
{
uint32_t left;
int32_t right;
if (!ToUint32(cx, lhs, &left) || !ToInt32(cx, rhs, &right))
return false;
left >>= right & 31;
out->setNumber(uint32_t(left));
out.setNumber(uint32_t(left));
return true;
}

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

@ -1204,13 +1204,13 @@ ComputeImplicitThis(JSContext *cx, HandleObject obj, MutableHandleValue vp)
}
static MOZ_ALWAYS_INLINE bool
AddOperation(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res)
AddOperation(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res)
{
if (lhs.isInt32() && rhs.isInt32()) {
int32_t l = lhs.toInt32(), r = rhs.toInt32();
int32_t t;
if (MOZ_LIKELY(SafeAdd(l, r, &t))) {
res->setInt32(t);
res.setInt32(t);
return true;
}
}
@ -1247,55 +1247,55 @@ AddOperation(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Valu
if (!str)
return false;
}
res->setString(str);
res.setString(str);
} else {
double l, r;
if (!ToNumber(cx, lhs, &l) || !ToNumber(cx, rhs, &r))
return false;
res->setNumber(l + r);
res.setNumber(l + r);
}
return true;
}
static MOZ_ALWAYS_INLINE bool
SubOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
SubOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue res)
{
double d1, d2;
if (!ToNumber(cx, lhs, &d1) || !ToNumber(cx, rhs, &d2))
return false;
res->setNumber(d1 - d2);
res.setNumber(d1 - d2);
return true;
}
static MOZ_ALWAYS_INLINE bool
MulOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
MulOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue res)
{
double d1, d2;
if (!ToNumber(cx, lhs, &d1) || !ToNumber(cx, rhs, &d2))
return false;
res->setNumber(d1 * d2);
res.setNumber(d1 * d2);
return true;
}
static MOZ_ALWAYS_INLINE bool
DivOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
DivOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue res)
{
double d1, d2;
if (!ToNumber(cx, lhs, &d1) || !ToNumber(cx, rhs, &d2))
return false;
res->setNumber(NumberDiv(d1, d2));
res.setNumber(NumberDiv(d1, d2));
return true;
}
static MOZ_ALWAYS_INLINE bool
ModOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
ModOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue res)
{
int32_t l, r;
if (lhs.isInt32() && rhs.isInt32() &&
(l = lhs.toInt32()) >= 0 && (r = rhs.toInt32()) > 0) {
int32_t mod = l % r;
res->setInt32(mod);
res.setInt32(mod);
return true;
}
@ -1303,7 +1303,7 @@ ModOperation(JSContext *cx, HandleValue lhs, HandleValue rhs, Value *res)
if (!ToNumber(cx, lhs, &d1) || !ToNumber(cx, rhs, &d2))
return false;
res->setNumber(NumberMod(d1, d2));
res.setNumber(NumberMod(d1, d2));
return true;
}
@ -2199,7 +2199,8 @@ CASE(JSOP_URSH)
{
HandleValue lval = REGS.stackHandleAt(-2);
HandleValue rval = REGS.stackHandleAt(-1);
if (!UrshOperation(cx, lval, rval, &REGS.sp[-2]))
MutableHandleValue res = REGS.stackHandleAt(-2);
if (!UrshOperation(cx, lval, rval, res))
goto error;
REGS.sp--;
}
@ -2209,7 +2210,8 @@ CASE(JSOP_ADD)
{
MutableHandleValue lval = REGS.stackHandleAt(-2);
MutableHandleValue rval = REGS.stackHandleAt(-1);
if (!AddOperation(cx, lval, rval, &REGS.sp[-2]))
MutableHandleValue res = REGS.stackHandleAt(-2);
if (!AddOperation(cx, lval, rval, res))
goto error;
REGS.sp--;
}
@ -2220,7 +2222,8 @@ CASE(JSOP_SUB)
RootedValue &lval = rootValue0, &rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
if (!SubOperation(cx, lval, rval, &REGS.sp[-2]))
MutableHandleValue res = REGS.stackHandleAt(-2);
if (!SubOperation(cx, lval, rval, res))
goto error;
REGS.sp--;
}
@ -2231,7 +2234,8 @@ CASE(JSOP_MUL)
RootedValue &lval = rootValue0, &rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
if (!MulOperation(cx, lval, rval, &REGS.sp[-2]))
MutableHandleValue res = REGS.stackHandleAt(-2);
if (!MulOperation(cx, lval, rval, res))
goto error;
REGS.sp--;
}
@ -2242,7 +2246,8 @@ CASE(JSOP_DIV)
RootedValue &lval = rootValue0, &rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
if (!DivOperation(cx, lval, rval, &REGS.sp[-2]))
MutableHandleValue res = REGS.stackHandleAt(-2);
if (!DivOperation(cx, lval, rval, res))
goto error;
REGS.sp--;
}
@ -2253,7 +2258,8 @@ CASE(JSOP_MOD)
RootedValue &lval = rootValue0, &rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
if (!ModOperation(cx, lval, rval, &REGS.sp[-2]))
MutableHandleValue res = REGS.stackHandleAt(-2);
if (!ModOperation(cx, lval, rval, res))
goto error;
REGS.sp--;
}
@ -3826,37 +3832,37 @@ js::InitElementArray(JSContext *cx, jsbytecode *pc, HandleObject obj, uint32_t i
}
bool
js::AddValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res)
js::AddValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res)
{
return AddOperation(cx, lhs, rhs, res);
}
bool
js::SubValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res)
js::SubValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res)
{
return SubOperation(cx, lhs, rhs, res);
}
bool
js::MulValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res)
js::MulValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res)
{
return MulOperation(cx, lhs, rhs, res);
}
bool
js::DivValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res)
js::DivValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res)
{
return DivOperation(cx, lhs, rhs, res);
}
bool
js::ModValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res)
js::ModValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res)
{
return ModOperation(cx, lhs, rhs, res);
}
bool
js::UrshValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res)
js::UrshValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res)
{
return UrshOperation(cx, lhs, rhs, res);
}

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

@ -388,22 +388,22 @@ InitElementArray(JSContext *cx, jsbytecode *pc,
HandleObject obj, uint32_t index, HandleValue value);
bool
AddValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res);
AddValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res);
bool
SubValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res);
SubValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res);
bool
MulValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res);
MulValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res);
bool
DivValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res);
DivValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res);
bool
ModValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res);
ModValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res);
bool
UrshValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, Value *res);
UrshValues(JSContext *cx, MutableHandleValue lhs, MutableHandleValue rhs, MutableHandleValue res);
template <bool strict>
bool

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

@ -212,7 +212,7 @@ SPSProfiler::push(const char *string, void *sp, JSScript *script, jsbytecode *pc
volatile uint32_t *size = size_;
uint32_t current = *size;
JS_ASSERT(enabled());
JS_ASSERT(installed());
if (current < max_) {
stack[current].setLabel(string);
stack[current].setStackAddress(sp);
@ -291,12 +291,12 @@ SPSEntryMarker::SPSEntryMarker(JSRuntime *rt
: profiler(&rt->spsProfiler)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
if (!profiler->enabled()) {
if (!profiler->installed()) {
profiler = nullptr;
return;
}
size_before = *profiler->size_;
profiler->push("js::RunScript", this, nullptr, nullptr);
profiler->pushNoCopy("js::RunScript", this, nullptr, nullptr);
}
SPSEntryMarker::~SPSEntryMarker()

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

@ -128,6 +128,12 @@ class SPSProfiler
const char *allocProfileString(JSScript *script, JSFunction *function);
void push(const char *string, void *sp, JSScript *script, jsbytecode *pc);
void pushNoCopy(const char *string, void *sp,
JSScript *script, jsbytecode *pc) {
push(string, reinterpret_cast<void*>(
reinterpret_cast<uintptr_t>(sp) | ProfileEntry::NoCopyBit),
script, pc);
}
void pop();
public:

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

@ -21,12 +21,6 @@ endif
include $(topsrcdir)/config/rules.mk
ifdef _MSC_VER
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
endif
ifdef MOZ_VTUNE
CXXFLAGS += -IC:/Program\ Files/Intel/VTune/Analyzer/Include
LIBS += C:/Program\ Files/Intel/VTune/Analyzer/Lib/VtuneApi.lib

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

@ -32,3 +32,7 @@ LOCAL_INCLUDES += [
'/toolkit/xre',
]
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
# a console application.
WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']

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

@ -2031,20 +2031,20 @@ public:
virtual void SetText(const char16_t* aText,
int32_t aLength,
nsBidiDirection aDirection)
nsBidiDirection aDirection) MOZ_OVERRIDE
{
mTextRunConstructionContext->SetTextRunRTL(aDirection==NSBIDI_RTL);
mText = aText;
mLength = aLength;
}
virtual nscoord GetWidth()
virtual nscoord GetWidth() MOZ_OVERRIDE
{
return mTextRunConstructionContext->GetWidth(mText, mLength);
}
virtual void DrawText(nscoord aXOffset,
nscoord)
nscoord) MOZ_OVERRIDE
{
mCtx->FontMetrics()->DrawString(mText, mLength, mPt.x + aXOffset, mPt.y,
mCtx, mTextRunConstructionContext);

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

@ -4893,17 +4893,16 @@ nsDisplaySVGEffects::BuildLayer(nsDisplayListBuilder* aBuilder,
nsSVGEffects::EffectProperties effectProperties =
nsSVGEffects::GetEffectProperties(firstFrame);
bool isOK = true;
bool isOK = effectProperties.HasNoFilterOrHasValidFilter();
effectProperties.GetClipPathFrame(&isOK);
effectProperties.GetMaskFrame(&isOK);
bool hasFilter = effectProperties.GetFilterFrame(&isOK) != nullptr;
if (!isOK) {
return nullptr;
}
ContainerLayerParameters newContainerParameters = aContainerParameters;
if (hasFilter) {
if (effectProperties.HasValidFilter()) {
newContainerParameters.mDisableSubpixelAntialiasingInDescendants = true;
}
@ -4972,7 +4971,7 @@ nsDisplaySVGEffects::PrintEffects(nsACString& aTo)
aTo += nsPrintfCString("clip(%s)", clipPathFrame->IsTrivial() ? "trivial" : "non-trivial");
first = false;
}
if (effectProperties.GetFilterFrame(&isOK)) {
if (effectProperties.HasValidFilter()) {
if (!first) {
aTo += ", ";
}

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

@ -1731,12 +1731,13 @@ public:
}
#endif
virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE {
virtual void Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx) MOZ_OVERRIDE {
mPaint(mFrame, aCtx, mVisibleRect, ToReferenceFrame());
}
NS_DISPLAY_DECL_NAME(mName, mType)
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) {
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE {
if (mType == nsDisplayItem::TYPE_HEADER_FOOTER) {
bool snap;
return GetBounds(aBuilder, &snap);
@ -1908,7 +1909,7 @@ public:
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
NS_DISPLAY_DECL_NAME("Border", TYPE_BORDER)
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder);
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE;
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
@ -2227,9 +2228,9 @@ public:
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion);
nsRegion* aInvalidRegion) MOZ_OVERRIDE;
virtual bool ApplyOpacity(float aOpacity)
virtual bool ApplyOpacity(float aOpacity) MOZ_OVERRIDE
{
mOpacity = aOpacity;
return true;
@ -2264,7 +2265,7 @@ public:
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
NS_DISPLAY_DECL_NAME("BoxShadowInner", TYPE_BOX_SHADOW_INNER)
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder)
virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE
{
return new nsDisplayBoxShadowInnerGeometry(this, aBuilder);
}
@ -2465,7 +2466,7 @@ public:
}
NS_DISPLAY_DECL_NAME("WrapList", TYPE_WRAP_LIST)
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder);
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE;
virtual nsDisplayList* GetSameCoordinateSystemChildren() MOZ_OVERRIDE
{
@ -2596,7 +2597,8 @@ public:
virtual ~nsDisplayMixBlendMode();
#endif
nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap);
nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
bool* aSnap) MOZ_OVERRIDE;
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
@ -2923,20 +2925,23 @@ public:
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
bool* aSnap) MOZ_OVERRIDE;
virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames) MOZ_OVERRIDE;
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE {
HitTestState* aState,
nsTArray<nsIFrame*> *aOutFrames) MOZ_OVERRIDE;
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
bool* aSnap) MOZ_OVERRIDE {
*aSnap = false;
return mEffectsBounds + ToReferenceFrame();
}
virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem) MOZ_OVERRIDE;
NS_DISPLAY_DECL_NAME("SVGEffects", TYPE_SVG_EFFECTS)
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters);
const ContainerLayerParameters& aParameters) MOZ_OVERRIDE;
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
@ -3004,7 +3009,7 @@ public:
NS_DISPLAY_DECL_NAME("nsDisplayTransform", TYPE_TRANSFORM)
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder)
virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE
{
if (mStoredList.GetComponentAlphaBounds(aBuilder).IsEmpty())
return nsRect();

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

@ -447,7 +447,7 @@ public:
nsDocumentShownDispatcher(nsCOMPtr<nsIDocument> aDocument)
: mDocument(aDocument) {}
NS_IMETHOD Run();
NS_IMETHOD Run() MOZ_OVERRIDE;
private:
nsCOMPtr<nsIDocument> mDocument;

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

@ -19,13 +19,13 @@ public:
virtual ~nsFrameIterator() {}
virtual void First();
virtual void Next();
virtual nsIFrame* CurrentItem();
virtual bool IsDone();
virtual void First() MOZ_OVERRIDE;
virtual void Next() MOZ_OVERRIDE;
virtual nsIFrame* CurrentItem() MOZ_OVERRIDE;
virtual bool IsDone() MOZ_OVERRIDE;
virtual void Last();
virtual void Prev();
virtual void Last() MOZ_OVERRIDE;
virtual void Prev() MOZ_OVERRIDE;
nsFrameIterator(nsPresContext* aPresContext, nsIFrame *aStart,
nsIteratorType aType, bool aLockScroll, bool aFollowOOFs);
@ -106,11 +106,11 @@ public:
nsFrameIterator(aPresContext, aStart, aType, aLockScroll, aFollowOOFs) {}
protected:
nsIFrame* GetFirstChildInner(nsIFrame* aFrame);
nsIFrame* GetLastChildInner(nsIFrame* aFrame);
nsIFrame* GetFirstChildInner(nsIFrame* aFrame) MOZ_OVERRIDE;
nsIFrame* GetLastChildInner(nsIFrame* aFrame) MOZ_OVERRIDE;
nsIFrame* GetNextSiblingInner(nsIFrame* aFrame);
nsIFrame* GetPrevSiblingInner(nsIFrame* aFrame);
nsIFrame* GetNextSiblingInner(nsIFrame* aFrame) MOZ_OVERRIDE;
nsIFrame* GetPrevSiblingInner(nsIFrame* aFrame) MOZ_OVERRIDE;
};
/************IMPLEMENTATIONS**************/

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

@ -27,22 +27,22 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD SetShowFrameBorders(bool aEnable);
NS_IMETHOD SetShowFrameBorders(bool aEnable) MOZ_OVERRIDE;
NS_IMETHOD GetShowFrameBorders(bool* aResult);
NS_IMETHOD GetShowFrameBorders(bool* aResult) MOZ_OVERRIDE;
NS_IMETHOD SetShowEventTargetFrameBorder(bool aEnable);
NS_IMETHOD SetShowEventTargetFrameBorder(bool aEnable) MOZ_OVERRIDE;
NS_IMETHOD GetShowEventTargetFrameBorder(bool* aResult);
NS_IMETHOD GetShowEventTargetFrameBorder(bool* aResult) MOZ_OVERRIDE;
NS_IMETHOD GetContentSize(nsIDocument* aDocument,
int32_t* aSizeInBytesResult);
int32_t* aSizeInBytesResult) MOZ_OVERRIDE;
NS_IMETHOD GetFrameSize(nsIPresShell* aPresentation,
int32_t* aSizeInBytesResult);
int32_t* aSizeInBytesResult) MOZ_OVERRIDE;
NS_IMETHOD GetStyleSize(nsIPresShell* aPresentation,
int32_t* aSizeInBytesResult);
int32_t* aSizeInBytesResult) MOZ_OVERRIDE;
};

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

@ -2562,7 +2562,7 @@ struct BoxToRect : public nsLayoutUtils::BoxCallback {
uint32_t aFlags)
: mRelativeTo(aRelativeTo), mCallback(aCallback), mFlags(aFlags) {}
virtual void AddBox(nsIFrame* aFrame) {
virtual void AddBox(nsIFrame* aFrame) MOZ_OVERRIDE {
nsRect r;
nsIFrame* outer = nsSVGUtils::GetOuterSVGFrameAndCoveredRegion(aFrame, &r);
if (!outer) {

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

@ -2462,7 +2462,7 @@ public:
"DOMPaintEvent requested for a detached pres context");
mList.TakeFrom(aList);
}
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
// The pres context might have been detached during the delay -
// that's fine, just don't fire the event.

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

@ -448,7 +448,7 @@ class MOZ_STACK_CLASS nsPresShellEventCB : public nsDispatchingCallback
public:
nsPresShellEventCB(PresShell* aPresShell) : mPresShell(aPresShell) {}
virtual void HandleEvent(nsEventChainPostVisitor& aVisitor)
virtual void HandleEvent(nsEventChainPostVisitor& aVisitor) MOZ_OVERRIDE
{
if (aVisitor.mPresContext && aVisitor.mEvent->eventStructType != NS_EVENT) {
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN ||
@ -501,7 +501,7 @@ public:
// Fires the "before-first-paint" event so that interested parties (right now, the
// mobile browser) are aware of it.
NS_IMETHOD Run()
NS_IMETHOD Run() MOZ_OVERRIDE
{
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();

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

@ -73,6 +73,8 @@
#include "nsXULTooltipListener.h"
#include "inDOMView.h"
#include "nsMenuBarListener.h"
#endif
#include "nsHTMLEditor.h"
@ -281,6 +283,10 @@ nsLayoutStatics::Initialize()
HTMLVideoElement::Init();
#ifdef MOZ_XUL
nsMenuBarListener::InitializeStatics();
#endif
CacheObserver::Init();
return NS_OK;

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