mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Merge inbound to central, a=merge
MozReview-Commit-ID: 4cWGBbMEU2x
This commit is contained in:
commit
b1fc5e008c
@ -29,7 +29,7 @@ tasks:
|
||||
description: 'Created by a [cron task](https://tools.taskcluster.net/tasks/${cron.task_id})'
|
||||
|
||||
provisionerId: "aws-provisioner-v1"
|
||||
workerType: "gecko-decision"
|
||||
workerType: "gecko-${repository.level}-decision"
|
||||
|
||||
tags:
|
||||
$if: 'tasks_for == "hg-push"'
|
||||
@ -126,9 +126,12 @@ tasks:
|
||||
|
||||
extra:
|
||||
treeherder:
|
||||
$if: 'tasks_for == "hg-push"'
|
||||
then:
|
||||
symbol: D
|
||||
else:
|
||||
groupSymbol: cron
|
||||
symbol: "${cron.job_symbol}"
|
||||
$merge:
|
||||
- machine:
|
||||
platform: gecko-decision
|
||||
- $if: 'tasks_for == "hg-push"'
|
||||
then:
|
||||
symbol: D
|
||||
else:
|
||||
groupSymbol: cron
|
||||
symbol: "${cron.job_symbol}"
|
||||
|
@ -1,5 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# empty file to block B2G/Gonk from trying to build anything inside mozilla-central
|
@ -44,17 +44,6 @@ var PointerRelay = { // jshint ignore:line
|
||||
"touchend": true };
|
||||
break;
|
||||
|
||||
case "gonk":
|
||||
this._eventsOfInterest = {
|
||||
"touchstart": true,
|
||||
"touchmove": true,
|
||||
"touchend": true,
|
||||
"mousedown": false,
|
||||
"mousemove": false,
|
||||
"mouseup": false,
|
||||
"click": false };
|
||||
break;
|
||||
|
||||
default:
|
||||
// Desktop.
|
||||
this._eventsOfInterest = {
|
||||
|
@ -48,7 +48,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
xbl:inherits="pageproxystate,parentfocused=focused"/>
|
||||
</xul:hbox>
|
||||
<xul:dropmarker anonid="historydropmarker"
|
||||
class="autocomplete-history-dropmarker urlbar-history-dropmarker"
|
||||
class="autocomplete-history-dropmarker urlbar-history-dropmarker urlbar-icon"
|
||||
tooltiptext="&urlbar.openHistoryPopup.tooltip;"
|
||||
allowevents="true"
|
||||
xbl:inherits="open,enablehistory,parentfocused=focused"/>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<box id="customization-content-container">
|
||||
<box flex="1" id="customization-palette-container">
|
||||
<label id="customization-header">
|
||||
&customizeMode.menuAndToolbars.header2;
|
||||
&customizeMode.menuAndToolbars.header3;
|
||||
</label>
|
||||
<hbox id="customization-empty" hidden="true">
|
||||
<label>&customizeMode.menuAndToolbars.empty;</label>
|
||||
|
@ -4,5 +4,13 @@
|
||||
"digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
|
||||
"algorithm": "sha512",
|
||||
"filename": "mozmake.exe"
|
||||
},
|
||||
{
|
||||
"size": 1436488,
|
||||
"visibility": "public",
|
||||
"digest": "8c34a608c83524d3ec3c9ef7f71b94ada9775bf2d7fdc843006e84205760157ae71bfa1f5836782716bbfaf63f2d003b1bb5e45f132bfbdaed3dfe5f10e8ae99",
|
||||
"algorithm": "sha512",
|
||||
"filename": "xz-5.2.3.zip",
|
||||
"unpack": true
|
||||
}
|
||||
]
|
||||
|
@ -4,5 +4,13 @@
|
||||
"digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
|
||||
"algorithm": "sha512",
|
||||
"filename": "mozmake.exe"
|
||||
},
|
||||
{
|
||||
"size": 1436488,
|
||||
"visibility": "public",
|
||||
"digest": "8c34a608c83524d3ec3c9ef7f71b94ada9775bf2d7fdc843006e84205760157ae71bfa1f5836782716bbfaf63f2d003b1bb5e45f132bfbdaed3dfe5f10e8ae99",
|
||||
"algorithm": "sha512",
|
||||
"filename": "xz-5.2.3.zip",
|
||||
"unpack": true
|
||||
}
|
||||
]
|
||||
|
@ -1,5 +1,5 @@
|
||||
This is the PDF.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.8.618
|
||||
Current extension version is: 1.9.441
|
||||
|
||||
Taken from upstream commit: 21cc2c02
|
||||
Taken from upstream commit: 8c8d8fa2
|
||||
|
@ -3826,8 +3826,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
|
||||
}();
|
||||
var version, build;
|
||||
{
|
||||
exports.version = version = '1.8.618';
|
||||
exports.build = build = '21cc2c02';
|
||||
exports.version = version = '1.9.441';
|
||||
exports.build = build = '8c8d8fa2';
|
||||
}
|
||||
exports.getDocument = getDocument;
|
||||
exports.LoopbackPort = LoopbackPort;
|
||||
@ -4877,8 +4877,8 @@ if (!_util.globalScope.PDFJS) {
|
||||
}
|
||||
var PDFJS = _util.globalScope.PDFJS;
|
||||
{
|
||||
PDFJS.version = '1.8.618';
|
||||
PDFJS.build = '21cc2c02';
|
||||
PDFJS.version = '1.9.441';
|
||||
PDFJS.build = '8c8d8fa2';
|
||||
}
|
||||
PDFJS.pdfBug = false;
|
||||
if (PDFJS.verbosity !== undefined) {
|
||||
@ -10444,8 +10444,8 @@ exports.PDFDataTransportStream = PDFDataTransportStream;
|
||||
"use strict";
|
||||
|
||||
|
||||
var pdfjsVersion = '1.8.618';
|
||||
var pdfjsBuild = '21cc2c02';
|
||||
var pdfjsVersion = '1.9.441';
|
||||
var pdfjsBuild = '8c8d8fa2';
|
||||
var pdfjsSharedUtil = __w_pdfjs_require__(0);
|
||||
var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
|
||||
var pdfjsDisplayAPI = __w_pdfjs_require__(3);
|
||||
|
@ -2467,7 +2467,7 @@ var JpxStream = function JpxStreamClosure() {
|
||||
if (tileCount === 1) {
|
||||
this.buffer = jpxImage.tiles[0].items;
|
||||
} else {
|
||||
var data = new Uint8Array(width * height * componentsCount);
|
||||
var data = new Uint8ClampedArray(width * height * componentsCount);
|
||||
for (var k = 0; k < tileCount; k++) {
|
||||
var tileComponents = jpxImage.tiles[k];
|
||||
var tileWidth = tileComponents.width;
|
||||
@ -20860,7 +20860,7 @@ var JpxImage = function JpxImageClosure() {
|
||||
transformedTiles[c] = transformTile(context, tile, c);
|
||||
}
|
||||
var tile0 = transformedTiles[0];
|
||||
var out = new Uint8Array(tile0.items.length * componentsCount);
|
||||
var out = new Uint8ClampedArray(tile0.items.length * componentsCount);
|
||||
var result = {
|
||||
left: tile0.left,
|
||||
top: tile0.top,
|
||||
@ -20868,18 +20868,13 @@ var JpxImage = function JpxImageClosure() {
|
||||
height: tile0.height,
|
||||
items: out
|
||||
};
|
||||
var shift, offset, max, min, maxK;
|
||||
var shift, offset;
|
||||
var pos = 0,
|
||||
j,
|
||||
jj,
|
||||
y0,
|
||||
y1,
|
||||
y2,
|
||||
r,
|
||||
g,
|
||||
b,
|
||||
k,
|
||||
val;
|
||||
y2;
|
||||
if (tile.codingStyleDefaultParameters.multipleComponentTransform) {
|
||||
var fourComponents = componentsCount === 4;
|
||||
var y0items = transformedTiles[0].items;
|
||||
@ -20888,9 +20883,6 @@ var JpxImage = function JpxImageClosure() {
|
||||
var y3items = fourComponents ? transformedTiles[3].items : null;
|
||||
shift = components[0].precision - 8;
|
||||
offset = (128 << shift) + 0.5;
|
||||
max = 255 * (1 << shift);
|
||||
maxK = max * 0.5;
|
||||
min = -maxK;
|
||||
var component0 = tile.components[0];
|
||||
var alpha01 = componentsCount - 3;
|
||||
jj = y0items.length;
|
||||
@ -20899,30 +20891,24 @@ var JpxImage = function JpxImageClosure() {
|
||||
y0 = y0items[j] + offset;
|
||||
y1 = y1items[j];
|
||||
y2 = y2items[j];
|
||||
r = y0 + 1.402 * y2;
|
||||
g = y0 - 0.34413 * y1 - 0.71414 * y2;
|
||||
b = y0 + 1.772 * y1;
|
||||
out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift;
|
||||
out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift;
|
||||
out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift;
|
||||
out[pos++] = y0 + 1.402 * y2 >> shift;
|
||||
out[pos++] = y0 - 0.34413 * y1 - 0.71414 * y2 >> shift;
|
||||
out[pos++] = y0 + 1.772 * y1 >> shift;
|
||||
}
|
||||
} else {
|
||||
for (j = 0; j < jj; j++, pos += alpha01) {
|
||||
y0 = y0items[j] + offset;
|
||||
y1 = y1items[j];
|
||||
y2 = y2items[j];
|
||||
g = y0 - (y2 + y1 >> 2);
|
||||
r = g + y2;
|
||||
b = g + y1;
|
||||
out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift;
|
||||
out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift;
|
||||
out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift;
|
||||
let g = y0 - (y2 + y1 >> 2);
|
||||
out[pos++] = g + y2 >> shift;
|
||||
out[pos++] = g >> shift;
|
||||
out[pos++] = g + y1 >> shift;
|
||||
}
|
||||
}
|
||||
if (fourComponents) {
|
||||
for (j = 0, pos = 3; j < jj; j++, pos += 4) {
|
||||
k = y3items[j];
|
||||
out[pos] = k <= min ? 0 : k >= maxK ? 255 : k + offset >> shift;
|
||||
out[pos] = y3items[j] + offset >> shift;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -20930,11 +20916,8 @@ var JpxImage = function JpxImageClosure() {
|
||||
var items = transformedTiles[c].items;
|
||||
shift = components[c].precision - 8;
|
||||
offset = (128 << shift) + 0.5;
|
||||
max = 127.5 * (1 << shift);
|
||||
min = -max;
|
||||
for (pos = c, j = 0, jj = items.length; j < jj; j++) {
|
||||
val = items[j];
|
||||
out[pos] = val <= min ? 0 : val >= max ? 255 : val + offset >> shift;
|
||||
out[pos] = items[j] + offset >> shift;
|
||||
pos += componentsCount;
|
||||
}
|
||||
}
|
||||
@ -32791,7 +32774,7 @@ var PDFImage = function PDFImageClosure() {
|
||||
}
|
||||
if (inverseDecode) {
|
||||
for (i = 0; i < actualLength; i++) {
|
||||
data[i] = ~data[i];
|
||||
data[i] ^= 0xFF;
|
||||
}
|
||||
}
|
||||
return {
|
||||
@ -34040,7 +34023,7 @@ var Jbig2Image = function Jbig2ImageClosure() {
|
||||
onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) {
|
||||
this.currentPageInfo = info;
|
||||
var rowSize = info.width + 7 >> 3;
|
||||
var buffer = new Uint8Array(rowSize * info.height);
|
||||
var buffer = new Uint8ClampedArray(rowSize * info.height);
|
||||
if (info.defaultPixelValue) {
|
||||
for (var i = 0, ii = buffer.length; i < ii; i++) {
|
||||
buffer[i] = 0xFF;
|
||||
@ -34652,9 +34635,6 @@ var JpegImage = function JpegImageClosure() {
|
||||
}
|
||||
return component.blockData;
|
||||
}
|
||||
function clamp0to255(a) {
|
||||
return a <= 0 ? 0 : a >= 255 ? 255 : a;
|
||||
}
|
||||
function findNextFileMarker(data, currentPos, startPos) {
|
||||
function peekUint16(pos) {
|
||||
return data[pos] << 8 | data[pos + 1];
|
||||
@ -34932,7 +34912,7 @@ var JpegImage = function JpegImageClosure() {
|
||||
var output;
|
||||
var numComponents = this.components.length;
|
||||
var dataLength = width * height * numComponents;
|
||||
var data = new Uint8Array(dataLength);
|
||||
var data = new Uint8ClampedArray(dataLength);
|
||||
var xScaleBlockOffset = new Uint32Array(width);
|
||||
var mask3LSB = 0xfffffff8;
|
||||
for (i = 0; i < numComponents; i++) {
|
||||
@ -34986,9 +34966,9 @@ var JpegImage = function JpegImageClosure() {
|
||||
Y = data[i];
|
||||
Cb = data[i + 1];
|
||||
Cr = data[i + 2];
|
||||
data[i] = clamp0to255(Y - 179.456 + 1.402 * Cr);
|
||||
data[i + 1] = clamp0to255(Y + 135.459 - 0.344 * Cb - 0.714 * Cr);
|
||||
data[i + 2] = clamp0to255(Y - 226.816 + 1.772 * Cb);
|
||||
data[i] = Y - 179.456 + 1.402 * Cr;
|
||||
data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;
|
||||
data[i + 2] = Y - 226.816 + 1.772 * Cb;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
@ -35000,12 +34980,9 @@ var JpegImage = function JpegImageClosure() {
|
||||
Cb = data[i + 1];
|
||||
Cr = data[i + 2];
|
||||
k = data[i + 3];
|
||||
var r = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776);
|
||||
var g = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665);
|
||||
var b = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407);
|
||||
data[offset++] = clamp0to255(r);
|
||||
data[offset++] = clamp0to255(g);
|
||||
data[offset++] = clamp0to255(b);
|
||||
data[offset++] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776);
|
||||
data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665);
|
||||
data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
@ -35015,28 +34992,24 @@ var JpegImage = function JpegImageClosure() {
|
||||
Y = data[i];
|
||||
Cb = data[i + 1];
|
||||
Cr = data[i + 2];
|
||||
data[i] = clamp0to255(434.456 - Y - 1.402 * Cr);
|
||||
data[i + 1] = clamp0to255(119.541 - Y + 0.344 * Cb + 0.714 * Cr);
|
||||
data[i + 2] = clamp0to255(481.816 - Y - 1.772 * Cb);
|
||||
data[i] = 434.456 - Y - 1.402 * Cr;
|
||||
data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr;
|
||||
data[i + 2] = 481.816 - Y - 1.772 * Cb;
|
||||
}
|
||||
return data;
|
||||
},
|
||||
_convertCmykToRgb: function convertCmykToRgb(data) {
|
||||
var c, m, y, k;
|
||||
var offset = 0;
|
||||
var min = -255 * 255 * 255;
|
||||
var scale = 1 / 255 / 255;
|
||||
var scale = 1 / 255;
|
||||
for (var i = 0, length = data.length; i < length; i += 4) {
|
||||
c = data[i];
|
||||
m = data[i + 1];
|
||||
y = data[i + 2];
|
||||
k = data[i + 3];
|
||||
var r = c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k - 72734.4411664936) + m * (1.7149763477362134 * m - 5.6096736904047315 * y - 17.873870861415444 * k - 1401.7366389350734) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 4465.541406466231) - k * (21.86122147463605 * k + 48317.86113160301);
|
||||
var g = c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k - 20220.756542821975) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 48691.05921601825) + y * (4.444339102852739 * y + 9.8632861493405 * k - 6341.191035517494) - k * (20.737325471181034 * k + 47890.15695978492);
|
||||
var b = c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k - 3616.812083916688) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 28620.90484698408) + y * (0.03296041114873217 * y + 115.60384449646641 * k - 49363.43385999684) - k * (22.33816807309886 * k + 45932.16563550634);
|
||||
data[offset++] = r >= 0 ? 255 : r <= min ? 0 : 255 + r * scale | 0;
|
||||
data[offset++] = g >= 0 ? 255 : g <= min ? 0 : 255 + g * scale | 0;
|
||||
data[offset++] = b >= 0 ? 255 : b <= min ? 0 : 255 + b * scale | 0;
|
||||
c = data[i] * scale;
|
||||
m = data[i + 1] * scale;
|
||||
y = data[i + 2] * scale;
|
||||
k = data[i + 3] * scale;
|
||||
data[offset++] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k - 285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y - 17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) - k * (21.86122147463605 * k + 189.48180835922747);
|
||||
data[offset++] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k - 79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) - k * (20.737325471181034 * k + 187.80453709719578);
|
||||
data[offset++] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k - 14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k - 193.58209356861505) - k * (22.33816807309886 * k + 180.12613974708367);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
@ -35047,7 +35020,7 @@ var JpegImage = function JpegImageClosure() {
|
||||
var data = this._getLinearizedBlockData(width, height);
|
||||
if (this.numComponents === 1 && forceRGBoutput) {
|
||||
var dataLength = data.length;
|
||||
var rgbData = new Uint8Array(dataLength * 3);
|
||||
var rgbData = new Uint8ClampedArray(dataLength * 3);
|
||||
var offset = 0;
|
||||
for (var i = 0; i < dataLength; i++) {
|
||||
var grayColor = data[i];
|
||||
@ -39883,8 +39856,8 @@ exports.Type1Parser = Type1Parser;
|
||||
"use strict";
|
||||
|
||||
|
||||
var pdfjsVersion = '1.8.618';
|
||||
var pdfjsBuild = '21cc2c02';
|
||||
var pdfjsVersion = '1.9.441';
|
||||
var pdfjsBuild = '8c8d8fa2';
|
||||
var pdfjsCoreWorker = __w_pdfjs_require__(17);
|
||||
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
|
||||
|
||||
|
@ -35,7 +35,6 @@ See https://github.com/adobe-type-tools/cmap-resources
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="viewer.js"></script>
|
||||
|
||||
</head>
|
||||
|
@ -3980,11 +3980,10 @@ var _pdfjsLib = __webpack_require__(1);
|
||||
|
||||
class PDFAttachmentViewer {
|
||||
constructor({ container, eventBus, downloadManager }) {
|
||||
this.attachments = null;
|
||||
this.container = container;
|
||||
this.eventBus = eventBus;
|
||||
this.downloadManager = downloadManager;
|
||||
this._renderedCapability = (0, _pdfjsLib.createPromiseCapability)();
|
||||
this.reset();
|
||||
this.eventBus.on('fileattachmentannotation', this._appendAttachment.bind(this));
|
||||
}
|
||||
reset(keepRenderedCapability = false) {
|
||||
@ -3995,11 +3994,11 @@ class PDFAttachmentViewer {
|
||||
}
|
||||
}
|
||||
_dispatchEvent(attachmentsCount) {
|
||||
this._renderedCapability.resolve();
|
||||
this.eventBus.dispatch('attachmentsloaded', {
|
||||
source: this,
|
||||
attachmentsCount
|
||||
});
|
||||
this._renderedCapability.resolve();
|
||||
}
|
||||
_bindPdfLink(button, content, filename) {
|
||||
if (_pdfjsLib.PDFJS.disableCreateObjectURL) {
|
||||
@ -4735,11 +4734,10 @@ var _pdfjsLib = __webpack_require__(1);
|
||||
const DEFAULT_TITLE = '\u2013';
|
||||
class PDFOutlineViewer {
|
||||
constructor({ container, linkService, eventBus }) {
|
||||
this.outline = null;
|
||||
this.lastToggleIsShow = true;
|
||||
this.container = container;
|
||||
this.linkService = linkService;
|
||||
this.eventBus = eventBus;
|
||||
this.reset();
|
||||
}
|
||||
reset() {
|
||||
this.outline = null;
|
||||
@ -5897,13 +5895,20 @@ class PDFSidebar {
|
||||
}
|
||||
});
|
||||
this.eventBus.on('attachmentsloaded', evt => {
|
||||
let attachmentsCount = evt.attachmentsCount;
|
||||
this.attachmentsButton.disabled = !attachmentsCount;
|
||||
if (attachmentsCount) {
|
||||
if (evt.attachmentsCount) {
|
||||
this.attachmentsButton.disabled = false;
|
||||
this._showUINotification(SidebarView.ATTACHMENTS);
|
||||
} else if (this.active === SidebarView.ATTACHMENTS) {
|
||||
this.switchView(SidebarView.THUMBS);
|
||||
return;
|
||||
}
|
||||
Promise.resolve().then(() => {
|
||||
if (this.attachmentsView.hasChildNodes()) {
|
||||
return;
|
||||
}
|
||||
this.attachmentsButton.disabled = true;
|
||||
if (this.active === SidebarView.ATTACHMENTS) {
|
||||
this.switchView(SidebarView.THUMBS);
|
||||
}
|
||||
});
|
||||
});
|
||||
this.eventBus.on('presentationmodechanged', evt => {
|
||||
if (!evt.active && !evt.switchInProgress && this.isThumbnailViewVisible) {
|
||||
|
@ -78,6 +78,18 @@
|
||||
@DIR_MACOS@updates/*
|
||||
#endif
|
||||
|
||||
# bug 1391079 - remove this block before 57 uplift to beta
|
||||
#ifdef XP_MACOSX
|
||||
@DIR_MACOS@._firefox-bin.sig
|
||||
@DIR_MACOS@._firefox.sig
|
||||
@DIR_MACOS@._XUL.sig
|
||||
@DIR_MACOS@firefox-bin.sig
|
||||
@DIR_MACOS@firefox.sig
|
||||
@DIR_MACOS@plugin-container.app/Contents/MacOS/._plugin-container.sig
|
||||
@DIR_MACOS@plugin-container.app/Contents/MacOS/plugin-container.sig
|
||||
@DIR_MACOS@XUL.sig
|
||||
#endif
|
||||
|
||||
# Common Directory removals
|
||||
@DIR_MACOS@chrome/
|
||||
#ifdef XP_UNIX
|
||||
|
@ -826,7 +826,7 @@ you can use these alternative items. Otherwise, their values should be empty. -
|
||||
<!ENTITY syncReAuthItem.accesskey "R">
|
||||
<!ENTITY syncToolbarButton.label "Sync">
|
||||
|
||||
<!ENTITY customizeMode.menuAndToolbars.header2 "Additional Tools and Features">
|
||||
<!ENTITY customizeMode.menuAndToolbars.header3 "Drag your favorite items into the toolbar or overflow menu.">
|
||||
<!ENTITY customizeMode.menuAndToolbars.empty "Want more tools?">
|
||||
<!ENTITY customizeMode.menuAndToolbars.emptyLink "Choose from thousands of add-ons">
|
||||
<!ENTITY customizeMode.restoreDefaults "Restore Defaults">
|
||||
|
@ -586,8 +586,15 @@ dataReportingNotification.button.accessKey = C
|
||||
|
||||
# Process hang reporter
|
||||
processHang.label = A web page is slowing down your browser. What would you like to do?
|
||||
# LOCALIZATION NOTE (processHang.add-on.label): The first %S is the name of
|
||||
# an extension. The second %S is the name of the product (e.g., Firefox)
|
||||
processHang.add-on.label = A script in the extension “%S” is causing %S to slow down.
|
||||
processHang.add-on.learn-more.text = Learn more
|
||||
processHang.add-on.learn-more.url = https://support.mozilla.org/en-US/kb/warning-unresponsive-script?cache=no#w_other-causes
|
||||
processHang.button_stop.label = Stop It
|
||||
processHang.button_stop.accessKey = S
|
||||
processHang.button_stop_sandbox.label = Temporarily Disable Extension on Page
|
||||
processHang.button_stop_sandbox.accessKey = A
|
||||
processHang.button_wait.label = Wait
|
||||
processHang.button_wait.accessKey = W
|
||||
processHang.button_debug.label = Debug Script
|
||||
|
@ -150,6 +150,8 @@ this.TabCrashHandler = {
|
||||
let shutdown = env.exists("MOZ_CRASHREPORTER_SHUTDOWN");
|
||||
|
||||
if (shutdown) {
|
||||
dump("A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is " +
|
||||
"set, shutting down\n");
|
||||
Services.startup.quit(Ci.nsIAppStartup.eForceQuit);
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,14 @@ var ProcessHangMonitor = {
|
||||
this.handleUserInput(win, report => report.terminateScript());
|
||||
},
|
||||
|
||||
/**
|
||||
* Terminate Sandbox globals associated with the hang being reported
|
||||
* for the selected browser in |win|.
|
||||
*/
|
||||
terminateGlobal(win) {
|
||||
this.handleUserInput(win, report => report.terminateGlobal());
|
||||
},
|
||||
|
||||
/**
|
||||
* Start devtools debugger for JavaScript associated with the hang
|
||||
* being reported for the selected browser in |win|.
|
||||
@ -111,6 +119,23 @@ var ProcessHangMonitor = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop all scripts from running in the Sandbox global attached to
|
||||
* this window.
|
||||
*/
|
||||
stopGlobal(win) {
|
||||
let report = this.findActiveReport(win.gBrowser.selectedBrowser);
|
||||
if (!report) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (report.hangType) {
|
||||
case report.SLOW_SCRIPT:
|
||||
this.terminateGlobal(win);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Dismiss the notification, clear the report from the active list and set up
|
||||
* a new timer to track a wait period during which we won't notify.
|
||||
@ -304,6 +329,40 @@ var ProcessHangMonitor = {
|
||||
}
|
||||
}];
|
||||
|
||||
let message = bundle.getString("processHang.label");
|
||||
if (report.addonId) {
|
||||
let aps = Cc["@mozilla.org/addons/policy-service;1"].getService(Ci.nsIAddonPolicyService);
|
||||
|
||||
let doc = win.document;
|
||||
let brandBundle = doc.getElementById("bundle_brand");
|
||||
|
||||
let addonName = aps.getExtensionName(report.addonId);
|
||||
|
||||
let label = bundle.getFormattedString("processHang.add-on.label",
|
||||
[addonName, brandBundle.getString("brandShortName")]);
|
||||
|
||||
let linkText = bundle.getString("processHang.add-on.learn-more.text");
|
||||
let linkURL = bundle.getString("processHang.add-on.learn-more.url");
|
||||
|
||||
let link = doc.createElement("label");
|
||||
link.setAttribute("class", "text-link");
|
||||
link.setAttribute("role", "link");
|
||||
link.setAttribute("onclick", `openUILinkIn(${JSON.stringify(linkURL)}, "tab")`);
|
||||
link.setAttribute("value", linkText);
|
||||
|
||||
message = doc.createDocumentFragment();
|
||||
message.appendChild(doc.createTextNode(label + " "));
|
||||
message.appendChild(link);
|
||||
|
||||
buttons.unshift({
|
||||
label: bundle.getString("processHang.button_stop_sandbox.label"),
|
||||
accessKey: bundle.getString("processHang.button_stop_sandbox.accessKey"),
|
||||
callback() {
|
||||
ProcessHangMonitor.stopGlobal(win);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (AppConstants.MOZ_DEV_EDITION && report.hangType == report.SLOW_SCRIPT) {
|
||||
buttons.push({
|
||||
label: bundle.getString("processHang.button_debug.label"),
|
||||
@ -314,8 +373,7 @@ var ProcessHangMonitor = {
|
||||
});
|
||||
}
|
||||
|
||||
nb.appendNotification(bundle.getString("processHang.label"),
|
||||
"process-hang",
|
||||
nb.appendNotification(message, "process-hang",
|
||||
"chrome://browser/content/aboutRobots-icon.png",
|
||||
nb.PRIORITY_WARNING_HIGH, buttons);
|
||||
},
|
||||
|
@ -2,5 +2,5 @@
|
||||
- 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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="context-fill" d="M8,12L3,7,4,6l4,4,4-4,1,1Z"/>
|
||||
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M8,12L3,7,4,6l4,4,4-4,1,1Z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 443 B |
@ -114,8 +114,6 @@
|
||||
.urlbar-history-dropmarker {
|
||||
-moz-appearance: none;
|
||||
list-style-image: url(chrome://browser/skin/arrow-dropdown-16.svg);
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,6 @@ gyp_vars.update({
|
||||
'arm_neon': 0,
|
||||
'arm_neon_optional': 1,
|
||||
|
||||
'moz_widget_toolkit_gonk': 0,
|
||||
'moz_webrtc_omx': 0,
|
||||
'moz_webrtc_mediacodec': 0,
|
||||
|
||||
|
@ -7,7 +7,9 @@
|
||||
@template
|
||||
@imports('textwrap')
|
||||
@imports(_from='mozbuild.configure', _import='SandboxDependsFunction')
|
||||
def compiler_class(compiler):
|
||||
def compiler_class(compiler, host_or_target):
|
||||
is_target = host_or_target is target
|
||||
|
||||
class Compiler(SandboxDependsFunction):
|
||||
# Generates a test program and attempts to compile it. In case of
|
||||
# failure, the resulting check will return None. If the test program
|
||||
@ -47,7 +49,8 @@ def compiler_class(compiler):
|
||||
@checking_fn
|
||||
def func(compiler, flags, extra_flags):
|
||||
flags = flags or []
|
||||
flags += extra_flags or []
|
||||
if is_target:
|
||||
flags += extra_flags or []
|
||||
flags.append('-c')
|
||||
|
||||
if try_invoke_compiler(
|
||||
|
@ -809,7 +809,7 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
|
||||
add_old_configure_assignment(
|
||||
'%s_VERSION' % var, valid_compiler.version)
|
||||
|
||||
valid_compiler = compiler_class(valid_compiler)
|
||||
valid_compiler = compiler_class(valid_compiler, host_or_target)
|
||||
|
||||
def compiler_error():
|
||||
raise FatalCheckError('Failed compiling a simple %s source with %s'
|
||||
|
@ -40,6 +40,19 @@ public:
|
||||
|
||||
explicit BasePrincipal(PrincipalKind aKind);
|
||||
|
||||
template<typename T>
|
||||
bool Is() const
|
||||
{
|
||||
return mKind == T::Kind();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* As()
|
||||
{
|
||||
MOZ_ASSERT(Is<T>());
|
||||
return static_cast<T*>(this);
|
||||
}
|
||||
|
||||
enum DocumentDomainConsideration { DontConsiderDocumentDomain, ConsiderDocumentDomain};
|
||||
bool Subsumes(nsIPrincipal* aOther, DocumentDomainConsideration aConsideration);
|
||||
|
||||
|
@ -30,6 +30,8 @@ public:
|
||||
|
||||
ContentPrincipal();
|
||||
|
||||
static PrincipalKind Kind() { return eCodebasePrincipal; }
|
||||
|
||||
// Init() must be called before the principal is in a usable state.
|
||||
nsresult Init(nsIURI* aCodebase,
|
||||
const mozilla::OriginAttributes& aOriginAttributes,
|
||||
|
@ -20,6 +20,8 @@ public:
|
||||
Create(nsTArray<nsCOMPtr<nsIPrincipal>>& aWhiteList,
|
||||
const mozilla::OriginAttributes& aAttrs);
|
||||
|
||||
static PrincipalKind Kind() { return eExpandedPrincipal; }
|
||||
|
||||
NS_DECL_NSIEXPANDEDPRINCIPAL
|
||||
NS_DECL_NSISERIALIZABLE
|
||||
|
||||
|
@ -41,6 +41,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static PrincipalKind Kind() { return eNullPrincipal; }
|
||||
|
||||
NS_DECL_NSISERIALIZABLE
|
||||
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
||||
|
@ -19,12 +19,10 @@
|
||||
//// NullPrincipalURI
|
||||
|
||||
NullPrincipalURI::NullPrincipalURI()
|
||||
: mPath(mPathBytes, ArrayLength(mPathBytes), ArrayLength(mPathBytes) - 1)
|
||||
{
|
||||
}
|
||||
|
||||
NullPrincipalURI::NullPrincipalURI(const NullPrincipalURI& aOther)
|
||||
: mPath(mPathBytes, ArrayLength(mPathBytes), ArrayLength(mPathBytes) - 1)
|
||||
{
|
||||
mPath.Assign(aOther.mPath);
|
||||
}
|
||||
@ -40,9 +38,9 @@ NullPrincipalURI::Init()
|
||||
nsresult rv = uuidgen->GenerateUUIDInPlace(&id);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
MOZ_ASSERT(mPathBytes == mPath.BeginWriting());
|
||||
|
||||
id.ToProvidedString(mPathBytes);
|
||||
mPath.SetLength(NSID_LENGTH - 1); // -1 because NSID_LENGTH counts the '\0'
|
||||
id.ToProvidedString(
|
||||
*reinterpret_cast<char(*)[NSID_LENGTH]>(mPath.BeginWriting()));
|
||||
|
||||
MOZ_ASSERT(mPath.Length() == NSID_LENGTH - 1);
|
||||
MOZ_ASSERT(strlen(mPath.get()) == NSID_LENGTH - 1);
|
||||
|
@ -52,8 +52,7 @@ private:
|
||||
|
||||
nsresult Init();
|
||||
|
||||
char mPathBytes[NSID_LENGTH];
|
||||
nsFixedCString mPath;
|
||||
nsAutoCStringN<NSID_LENGTH> mPath;
|
||||
};
|
||||
|
||||
#endif // __NullPrincipalURI_h__
|
||||
|
@ -30,6 +30,8 @@ class SystemPrincipal final : public mozilla::BasePrincipal
|
||||
public:
|
||||
static already_AddRefed<SystemPrincipal> Create();
|
||||
|
||||
static PrincipalKind Kind() { return eSystemPrincipal; }
|
||||
|
||||
NS_DECL_NSISERIALIZABLE
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
||||
NS_IMETHOD GetHashValue(uint32_t* aHashValue) override;
|
||||
|
@ -52,6 +52,12 @@ interface nsIAddonPolicyService : nsISupports
|
||||
*/
|
||||
boolean addonMayLoadURI(in AString aAddonId, in nsIURI aURI, [optional] in boolean aExplicit);
|
||||
|
||||
/**
|
||||
* Returns the name of the WebExtension with the given ID, or the ID string
|
||||
* if no matching add-on can be found.
|
||||
*/
|
||||
AString getExtensionName(in AString aAddonId);
|
||||
|
||||
/**
|
||||
* Returns true if a given extension:// URI is web-accessible.
|
||||
*/
|
||||
|
@ -566,6 +566,10 @@ alltags:
|
||||
$(RM) TAGS
|
||||
find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM)
|
||||
|
||||
define EXPAND_CC_OR_CXX
|
||||
$(if $(PROG_IS_C_ONLY_$(1)),$(EXPAND_CC),$(EXPAND_CCC))
|
||||
endef
|
||||
|
||||
#
|
||||
# PROGRAM = Foo
|
||||
# creates OBJS, links with LIBS to create Foo
|
||||
@ -595,7 +599,7 @@ ifdef MOZ_PROFILE_GENERATE
|
||||
touch -t `date +%Y%m%d%H%M.%S -d 'now+5seconds'` pgo.relink
|
||||
endif
|
||||
else # !WINNT || GNU_CC
|
||||
$(EXPAND_CCC) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
|
||||
$(call EXPAND_CC_OR_CXX,$@) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
|
||||
$(call CHECK_BINARY,$@)
|
||||
endif # WINNT && !GNU_CC
|
||||
|
||||
@ -654,7 +658,7 @@ ifdef MSMANIFEST_TOOL
|
||||
fi
|
||||
endif # MSVC with manifest tool
|
||||
else
|
||||
$(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS)
|
||||
$(call EXPAND_CC_OR_CXX,$@) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(BIN_FLAGS)
|
||||
$(call CHECK_BINARY,$@)
|
||||
endif # WINNT && !GNU_CC
|
||||
|
||||
|
@ -392,9 +392,6 @@ DiskInit.h
|
||||
dlfcn.h
|
||||
dlgs.h
|
||||
dl.h
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
dns_sd.h
|
||||
#endif
|
||||
docobj.h
|
||||
dos/dosextens.h
|
||||
dos.h
|
||||
|
@ -60,7 +60,15 @@ const App = createClass({
|
||||
getStr("fontinspector.seeAll")
|
||||
)
|
||||
),
|
||||
FontList({ fonts })
|
||||
fonts.length ?
|
||||
FontList({ fonts })
|
||||
:
|
||||
dom.div(
|
||||
{
|
||||
className: "devtools-sidepanel-no-result"
|
||||
},
|
||||
getStr("fontinspector.noFontsOnSelectedElement")
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -136,24 +136,27 @@ FontInspector.prototype = {
|
||||
|
||||
update: Task.async(function* () {
|
||||
let node = this.inspector.selection.nodeFront;
|
||||
|
||||
if (!node ||
|
||||
!this.isPanelVisible() ||
|
||||
!this.inspector.selection.isConnected() ||
|
||||
!this.inspector.selection.isElementNode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let fonts = [];
|
||||
let { fontOptions } = this.store.getState();
|
||||
let { showAllFonts, previewText } = fontOptions;
|
||||
|
||||
// Clear the list of fonts if the currently selected node is not connected or an
|
||||
// element node unless all fonts are supposed to be shown.
|
||||
if (!showAllFonts &&
|
||||
(!node ||
|
||||
!this.isPanelVisible() ||
|
||||
!this.inspector.selection.isConnected() ||
|
||||
!this.inspector.selection.isElementNode())) {
|
||||
this.store.dispatch(updateFonts(fonts));
|
||||
return;
|
||||
}
|
||||
|
||||
let options = {
|
||||
includePreviews: true,
|
||||
previewText,
|
||||
previewFillStyle: getColor("body-color")
|
||||
};
|
||||
|
||||
let fonts = [];
|
||||
if (showAllFonts) {
|
||||
fonts = yield this.pageStyle.getAllUsedFontFaces(options)
|
||||
.catch(console.error);
|
||||
|
@ -24,6 +24,10 @@ fontinspector.system=system
|
||||
# font.
|
||||
fontinspector.remote=remote
|
||||
|
||||
# LOCALIZATION NOTE (previewHint):
|
||||
# LOCALIZATION NOTE (fontinspector.previewHint):
|
||||
# This is the label shown as the placeholder in font inspector preview text box.
|
||||
fontinspector.previewText=Preview Text
|
||||
|
||||
# LOCALIZATION NOTE (fontinspector.noFontsOnSelectedElement): This label is shown when
|
||||
# no fonts found on the selected element.
|
||||
fontinspector.noFontsOnSelectedElement=No fonts were found for the current element.
|
||||
|
@ -39,7 +39,7 @@ function getAutocompleteValuesForFlag(flag, request) {
|
||||
values.push(request.cause.type);
|
||||
break;
|
||||
case "mime-type":
|
||||
values.push(request.mimeType);
|
||||
values.push(request.mimeType.replace(/;.+/, ""));
|
||||
break;
|
||||
case "set-cookie-name":
|
||||
values = responseCookies.map(c => c.name);
|
||||
|
@ -108,8 +108,12 @@ add_task(async function () {
|
||||
"Typing the exact value closes autocomplete");
|
||||
|
||||
// Check if mime-type has been correctly parsed out and values also get autocomplete
|
||||
EventUtils.synthesizeKey(" mime-type:au", {});
|
||||
testAutocompleteContents(["mime-type:audio/ogg"], document);
|
||||
EventUtils.synthesizeKey(" mime-type:text", {});
|
||||
testAutocompleteContents([
|
||||
"mime-type:text/css",
|
||||
"mime-type:text/html",
|
||||
"mime-type:text/plain"
|
||||
], document);
|
||||
|
||||
// The negative filter flags
|
||||
EventUtils.synthesizeKey(" -", {});
|
||||
|
@ -160,18 +160,7 @@ LocalDevice.prototype = {
|
||||
* Triggers the |name| setter to persist if needed.
|
||||
*/
|
||||
_generate: function () {
|
||||
if (Services.appinfo.widgetToolkit == "gonk") {
|
||||
// For Firefox OS devices, create one from the device name plus a little
|
||||
// randomness. The goal is just to distinguish devices in an office
|
||||
// environment where many people may have the same device model for
|
||||
// testing purposes (which would otherwise all report the same name).
|
||||
let name = libcutils.property_get("ro.product.device");
|
||||
// Pick a random number from [0, 2^32)
|
||||
let randomID = Math.floor(Math.random() * Math.pow(2, 32));
|
||||
// To hex and zero pad
|
||||
randomID = ("00000000" + randomID.toString(16)).slice(-8);
|
||||
this.name = name + "-" + randomID;
|
||||
} else if (Services.appinfo.widgetToolkit == "android") {
|
||||
if (Services.appinfo.widgetToolkit == "android") {
|
||||
// For Firefox for Android, use the device's model name.
|
||||
// TODO: Bug 1180997: Find the right way to expose an editable name
|
||||
this.name = sysInfo.get("device");
|
||||
|
@ -125,6 +125,7 @@
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsIPromptService.h"
|
||||
#include "nsIPromptFactory.h"
|
||||
#include "nsIAddonPolicyService.h"
|
||||
#include "nsIWritablePropertyBag2.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIWebBrowserChrome.h"
|
||||
@ -11682,7 +11683,7 @@ nsGlobalWindow::HandleIdleActiveEvent()
|
||||
}
|
||||
|
||||
nsGlobalWindow::SlowScriptResponse
|
||||
nsGlobalWindow::ShowSlowScriptDialog()
|
||||
nsGlobalWindow::ShowSlowScriptDialog(const nsString& aAddonId)
|
||||
{
|
||||
MOZ_ASSERT(IsInnerWindow());
|
||||
|
||||
@ -11732,10 +11733,14 @@ nsGlobalWindow::ShowSlowScriptDialog()
|
||||
nsIDocShell* docShell = GetDocShell();
|
||||
nsCOMPtr<nsITabChild> child = docShell ? docShell->GetTabChild() : nullptr;
|
||||
action = monitor->NotifySlowScript(child,
|
||||
filename.get());
|
||||
filename.get(),
|
||||
aAddonId);
|
||||
if (action == ProcessHangMonitor::Terminate) {
|
||||
return KillSlowScript;
|
||||
}
|
||||
if (action == ProcessHangMonitor::TerminateGlobal) {
|
||||
return KillScriptGlobal;
|
||||
}
|
||||
|
||||
if (action == ProcessHangMonitor::StartDebugger) {
|
||||
// Spin a nested event loop so that the debugger in the parent can fetch
|
||||
@ -11772,61 +11777,58 @@ nsGlobalWindow::ShowSlowScriptDialog()
|
||||
}
|
||||
}
|
||||
|
||||
bool showDebugButton = !!debugCallback;
|
||||
bool failed = false;
|
||||
auto getString = [&] (const char* name,
|
||||
nsContentUtils::PropertiesFile propFile = nsContentUtils::eDOM_PROPERTIES) {
|
||||
nsAutoString result;
|
||||
nsresult rv = nsContentUtils::GetLocalizedString(
|
||||
propFile, name, result);
|
||||
|
||||
// GetStringFromName can return NS_OK and still give nullptr string
|
||||
failed = failed || NS_FAILED(rv) || result.IsEmpty();
|
||||
return Move(result);
|
||||
};
|
||||
|
||||
bool isAddonScript = !aAddonId.IsEmpty();
|
||||
bool showDebugButton = debugCallback && !isAddonScript;
|
||||
|
||||
// Get localizable strings
|
||||
nsAutoString title, msg, stopButton, waitButton, debugButton, neverShowDlg;
|
||||
|
||||
rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
|
||||
"KillScriptTitle",
|
||||
title);
|
||||
nsAutoString title, checkboxMsg, debugButton, msg;
|
||||
if (isAddonScript) {
|
||||
title = getString("KillAddonScriptTitle");
|
||||
checkboxMsg = getString("KillAddonScriptGlobalMessage");
|
||||
|
||||
nsresult tmp = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
|
||||
"StopScriptButton",
|
||||
stopButton);
|
||||
if (NS_FAILED(tmp)) {
|
||||
rv = tmp;
|
||||
}
|
||||
auto appName = getString("brandShortName", nsContentUtils::eBRAND_PROPERTIES);
|
||||
|
||||
tmp = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
|
||||
"WaitForScriptButton",
|
||||
waitButton);
|
||||
if (NS_FAILED(tmp)) {
|
||||
rv = tmp;
|
||||
}
|
||||
|
||||
tmp = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
|
||||
"DontAskAgain",
|
||||
neverShowDlg);
|
||||
if (NS_FAILED(tmp)) {
|
||||
rv = tmp;
|
||||
}
|
||||
|
||||
if (showDebugButton) {
|
||||
tmp = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
|
||||
"DebugScriptButton",
|
||||
debugButton);
|
||||
if (NS_FAILED(tmp)) {
|
||||
rv = tmp;
|
||||
nsCOMPtr<nsIAddonPolicyService> aps = do_GetService("@mozilla.org/addons/policy-service;1");
|
||||
nsString addonName;
|
||||
if (!aps || NS_FAILED(aps->GetExtensionName(aAddonId, addonName))) {
|
||||
addonName = aAddonId;
|
||||
}
|
||||
|
||||
tmp = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
|
||||
"KillScriptWithDebugMessage",
|
||||
msg);
|
||||
if (NS_FAILED(tmp)) {
|
||||
rv = tmp;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tmp = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
|
||||
"KillScriptMessage",
|
||||
msg);
|
||||
if (NS_FAILED(tmp)) {
|
||||
rv = tmp;
|
||||
const char16_t* params[] = {addonName.get(), appName.get()};
|
||||
rv = nsContentUtils::FormatLocalizedString(
|
||||
nsContentUtils::eDOM_PROPERTIES, "KillAddonScriptMessage",
|
||||
params, msg);
|
||||
|
||||
failed = failed || NS_FAILED(rv);
|
||||
} else {
|
||||
title = getString("KillScriptTitle");
|
||||
checkboxMsg = getString("DontAskAgain");
|
||||
|
||||
if (showDebugButton) {
|
||||
debugButton = getString("DebugScriptButton");
|
||||
msg = getString("KillScriptWithDebugMessage");
|
||||
} else {
|
||||
msg = getString("KillScriptMessage");
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
auto stopButton = getString("StopScriptButton");
|
||||
auto waitButton = getString("WaitForScriptButton");
|
||||
|
||||
if (failed) {
|
||||
NS_ERROR("Failed to get localized strings.");
|
||||
return ContinueSlowScript;
|
||||
}
|
||||
@ -11874,8 +11876,6 @@ nsGlobalWindow::ShowSlowScriptDialog()
|
||||
}
|
||||
}
|
||||
|
||||
int32_t buttonPressed = 0; // In case the user exits dialog by clicking X.
|
||||
bool neverShowDlgChk = false;
|
||||
uint32_t buttonFlags = nsIPrompt::BUTTON_POS_1_DEFAULT +
|
||||
(nsIPrompt::BUTTON_TITLE_IS_STRING *
|
||||
(nsIPrompt::BUTTON_POS_0 + nsIPrompt::BUTTON_POS_1));
|
||||
@ -11884,26 +11884,36 @@ nsGlobalWindow::ShowSlowScriptDialog()
|
||||
if (showDebugButton)
|
||||
buttonFlags += nsIPrompt::BUTTON_TITLE_IS_STRING * nsIPrompt::BUTTON_POS_2;
|
||||
|
||||
bool checkboxValue = false;
|
||||
int32_t buttonPressed = 0; // In case the user exits dialog by clicking X.
|
||||
{
|
||||
// Null out the operation callback while we're re-entering JS here.
|
||||
AutoDisableJSInterruptCallback disabler(cx);
|
||||
|
||||
// Open the dialog.
|
||||
rv = prompt->ConfirmEx(title.get(), msg.get(), buttonFlags,
|
||||
waitButton.get(), stopButton.get(),
|
||||
debugButton.get(), neverShowDlg.get(),
|
||||
&neverShowDlgChk, &buttonPressed);
|
||||
debugButton.get(), checkboxMsg.get(),
|
||||
&checkboxValue, &buttonPressed);
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv) && (buttonPressed == 0)) {
|
||||
return neverShowDlgChk ? AlwaysContinueSlowScript : ContinueSlowScript;
|
||||
if (buttonPressed == 0) {
|
||||
if (checkboxValue && !isAddonScript && NS_SUCCEEDED(rv))
|
||||
return AlwaysContinueSlowScript;
|
||||
return ContinueSlowScript;
|
||||
}
|
||||
|
||||
if (buttonPressed == 2) {
|
||||
if (debugCallback) {
|
||||
rv = debugCallback->HandleSlowScriptDebug(this);
|
||||
return NS_SUCCEEDED(rv) ? ContinueSlowScript : KillSlowScript;
|
||||
}
|
||||
MOZ_RELEASE_ASSERT(debugCallback);
|
||||
|
||||
rv = debugCallback->HandleSlowScriptDebug(this);
|
||||
return NS_SUCCEEDED(rv) ? ContinueSlowScript : KillSlowScript;
|
||||
}
|
||||
|
||||
JS_ClearPendingException(cx);
|
||||
|
||||
if (checkboxValue && isAddonScript)
|
||||
return KillScriptGlobal;
|
||||
return KillSlowScript;
|
||||
}
|
||||
|
||||
|
@ -737,9 +737,10 @@ public:
|
||||
ContinueSlowScript = 0,
|
||||
ContinueSlowScriptAndKeepNotifying,
|
||||
AlwaysContinueSlowScript,
|
||||
KillSlowScript
|
||||
KillSlowScript,
|
||||
KillScriptGlobal
|
||||
};
|
||||
SlowScriptResponse ShowSlowScriptDialog();
|
||||
SlowScriptResponse ShowSlowScriptDialog(const nsString& aAddonId);
|
||||
|
||||
// Inner windows only.
|
||||
void AddGamepad(uint32_t aIndex, mozilla::dom::Gamepad* aGamepad);
|
||||
|
@ -2682,6 +2682,12 @@ nsJSContext::EnsureStatics()
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryPrefChangedCallbackInt,
|
||||
"javascript.options.mem.gc_allocation_threshold_mb",
|
||||
(void *)JSGC_ALLOCATION_THRESHOLD);
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryPrefChangedCallbackInt,
|
||||
"javascript.options.mem.gc_allocation_threshold_factor",
|
||||
(void *)JSGC_ALLOCATION_THRESHOLD_FACTOR);
|
||||
Preferences::RegisterCallbackAndCall(SetMemoryPrefChangedCallbackInt,
|
||||
"javascript.options.mem.gc_allocation_threshold_factor_avoid_interrupt",
|
||||
(void *)JSGC_ALLOCATION_THRESHOLD_FACTOR_AVOID_INTERRUPT);
|
||||
|
||||
Preferences::RegisterCallbackAndCall(SetIncrementalCCPrefChangedCallback,
|
||||
"dom.cycle_collector.incremental");
|
||||
|
@ -6289,7 +6289,7 @@ CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
|
||||
return canvasLayer.forget();
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
CanvasRenderingContext2D::InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderer* aRenderer,
|
||||
bool aMirror)
|
||||
@ -6316,6 +6316,7 @@ CanvasRenderingContext2D::InitializeCanvasRenderer(nsDisplayListBuilder* aBuilde
|
||||
|
||||
aRenderer->Initialize(data);
|
||||
aRenderer->SetDirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -468,7 +468,7 @@ public:
|
||||
Layer* aOldLayer,
|
||||
LayerManager* aManager,
|
||||
bool aMirror = false) override;
|
||||
void InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
bool InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderer* aRenderer,
|
||||
bool aMirror = false) override;
|
||||
virtual bool ShouldForceInactiveLayer(LayerManager* aManager) override;
|
||||
|
@ -236,7 +236,6 @@ private:
|
||||
};
|
||||
|
||||
// TODO: optimize for other platforms.
|
||||
// For GONK: implement GrallocImageImpl, GrallocPlanarYCbCrImpl and GonkCameraImpl.
|
||||
// For Windows: implement D3D9RGB32TextureImpl and D3D11ShareHandleTextureImpl.
|
||||
// Others: SharedBGRImpl, MACIOSrufaceImpl, GLImageImpl, SurfaceTextureImpl
|
||||
// EGLImageImpl and OverlayImegImpl.
|
||||
|
@ -1322,9 +1322,6 @@ WebGLContext::GetCanvasLayer(nsDisplayListBuilder* builder,
|
||||
LayerManager* manager,
|
||||
bool aMirror /*= false*/)
|
||||
{
|
||||
if (IsContextLost())
|
||||
return nullptr;
|
||||
|
||||
if (!mResetLayer && oldLayer &&
|
||||
oldLayer->HasUserData(aMirror ? &gWebGLMirrorLayerUserData : &gWebGLLayerUserData)) {
|
||||
RefPtr<layers::Layer> ret = oldLayer;
|
||||
@ -1345,7 +1342,9 @@ WebGLContext::GetCanvasLayer(nsDisplayListBuilder* builder,
|
||||
canvasLayer->SetUserData(aMirror ? &gWebGLMirrorLayerUserData : &gWebGLLayerUserData, userData);
|
||||
|
||||
CanvasRenderer* canvasRenderer = canvasLayer->CreateOrGetCanvasRenderer();
|
||||
InitializeCanvasRenderer(builder, canvasRenderer, aMirror);
|
||||
if (!InitializeCanvasRenderer(builder, canvasRenderer, aMirror))
|
||||
return nullptr;
|
||||
|
||||
uint32_t flags = gl->Caps().alpha ? 0 : Layer::CONTENT_OPAQUE;
|
||||
canvasLayer->SetContentFlags(flags);
|
||||
|
||||
@ -1358,11 +1357,14 @@ WebGLContext::GetCanvasLayer(nsDisplayListBuilder* builder,
|
||||
return canvasLayer.forget();
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
WebGLContext::InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderer* aRenderer,
|
||||
bool aMirror)
|
||||
{
|
||||
if (IsContextLost())
|
||||
return false;
|
||||
|
||||
CanvasInitializeData data;
|
||||
if (aBuilder->IsPaintingToWindow() && mCanvasElement && !aMirror) {
|
||||
// Make the layer tell us whenever a transaction finishes (including
|
||||
@ -1391,6 +1393,7 @@ WebGLContext::InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
aRenderer->Initialize(data);
|
||||
aRenderer->SetDirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
layers::LayersBackend
|
||||
|
@ -462,7 +462,7 @@ public:
|
||||
GetCanvasLayer(nsDisplayListBuilder* builder, Layer* oldLayer,
|
||||
LayerManager* manager,
|
||||
bool aMirror = false) override;
|
||||
void
|
||||
bool
|
||||
InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderer* aRenderer,
|
||||
bool aMirror = false) override;
|
||||
|
@ -141,9 +141,9 @@ public:
|
||||
Layer *oldLayer,
|
||||
LayerManager *manager,
|
||||
bool aMirror = false) = 0;
|
||||
virtual void InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
virtual bool InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderer* aRenderer,
|
||||
bool aMirror = false) { };
|
||||
bool aMirror = false) { return true; }
|
||||
|
||||
// Return true if the canvas should be forced to be "inactive" to ensure
|
||||
// it can be drawn to the screen even if it's too large to be blitted by
|
||||
|
@ -1188,7 +1188,10 @@ HTMLCanvasElement::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
|
||||
layer->SetUserData(&sOffscreenCanvasLayerUserDataDummy, userData);
|
||||
|
||||
CanvasRenderer* canvasRenderer = layer->CreateOrGetCanvasRenderer();
|
||||
InitializeCanvasRenderer(aBuilder, canvasRenderer);
|
||||
|
||||
if (!InitializeCanvasRenderer(aBuilder, canvasRenderer)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
layer->Updated();
|
||||
return layer.forget();
|
||||
@ -1197,12 +1200,12 @@ HTMLCanvasElement::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
HTMLCanvasElement::InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderer* aRenderer)
|
||||
{
|
||||
if (mCurrentContext) {
|
||||
mCurrentContext->InitializeCanvasRenderer(aBuilder, aRenderer);
|
||||
return mCurrentContext->InitializeCanvasRenderer(aBuilder, aRenderer);
|
||||
}
|
||||
|
||||
if (mOffscreenCanvas) {
|
||||
@ -1210,7 +1213,10 @@ HTMLCanvasElement::InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
data.mRenderer = GetAsyncCanvasRenderer();
|
||||
data.mSize = GetWidthHeight();
|
||||
aRenderer->Initialize(data);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -310,7 +310,7 @@ public:
|
||||
already_AddRefed<Layer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,
|
||||
Layer *aOldLayer,
|
||||
LayerManager *aManager);
|
||||
void InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
bool InitializeCanvasRenderer(nsDisplayListBuilder* aBuilder,
|
||||
CanvasRenderer* aRenderer);
|
||||
// Should return true if the canvas layer should always be marked inactive.
|
||||
// We should return true here if we can't do accelerated compositing with
|
||||
|
@ -1149,6 +1149,7 @@ HTMLInputElement::HTMLInputElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
, mPickerRunning(false)
|
||||
, mSelectionCached(true)
|
||||
, mIsPreviewEnabled(false)
|
||||
, mHasPatternAttribute(false)
|
||||
{
|
||||
// If size is above 512, mozjemalloc allocates 1kB, see
|
||||
// memory/mozjemalloc/jemalloc.c
|
||||
@ -1457,8 +1458,15 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
UpdateTooLongValidityState();
|
||||
} else if (aName == nsGkAtoms::minlength) {
|
||||
UpdateTooShortValidityState();
|
||||
} else if (aName == nsGkAtoms::pattern && mDoneCreating) {
|
||||
UpdatePatternMismatchValidityState();
|
||||
} else if (aName == nsGkAtoms::pattern) {
|
||||
// Although pattern attribute only applies to single line text controls,
|
||||
// we set this flag for all input types to save having to check the type
|
||||
// here.
|
||||
mHasPatternAttribute = !!aValue;
|
||||
|
||||
if (mDoneCreating) {
|
||||
UpdatePatternMismatchValidityState();
|
||||
}
|
||||
} else if (aName == nsGkAtoms::multiple) {
|
||||
UpdateTypeMismatchValidityState();
|
||||
} else if (aName == nsGkAtoms::max) {
|
||||
|
@ -339,6 +339,11 @@ public:
|
||||
return mSelectionProperties;
|
||||
}
|
||||
|
||||
bool HasPatternAttribute() const
|
||||
{
|
||||
return mHasPatternAttribute;
|
||||
}
|
||||
|
||||
// nsIConstraintValidation
|
||||
bool IsTooLong();
|
||||
bool IsTooShort();
|
||||
@ -1667,6 +1672,7 @@ protected:
|
||||
bool mPickerRunning : 1;
|
||||
bool mSelectionCached : 1;
|
||||
bool mIsPreviewEnabled : 1;
|
||||
bool mHasPatternAttribute : 1;
|
||||
|
||||
private:
|
||||
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
|
@ -72,8 +72,12 @@ SingleLineTextInputTypeBase::IsValueMissing() const
|
||||
bool
|
||||
SingleLineTextInputTypeBase::HasPatternMismatch() const
|
||||
{
|
||||
if (!mInputElement->HasPatternAttribute()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsAutoString pattern;
|
||||
if (!mInputElement->GetAttr(kNameSpaceID_None, nsGkAtoms::pattern, pattern)) {
|
||||
if (!mInputElement->GetAttr(kNameSpaceID_None, nsGkAtoms::pattern, pattern)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace dom {
|
||||
namespace indexedDB {
|
||||
|
||||
class MOZ_STACK_CLASS LoggingIdString final
|
||||
: public nsAutoCString
|
||||
: public nsAutoCStringN<NSID_LENGTH>
|
||||
{
|
||||
public:
|
||||
LoggingIdString()
|
||||
@ -61,9 +61,10 @@ public:
|
||||
LoggingIdString(const nsID& aID)
|
||||
{
|
||||
static_assert(NSID_LENGTH > 1, "NSID_LENGTH is set incorrectly!");
|
||||
static_assert(NSID_LENGTH <= kDefaultStorageSize,
|
||||
"nID string won't fit in our storage!");
|
||||
MOZ_ASSERT(Capacity() > NSID_LENGTH);
|
||||
static_assert(NSID_LENGTH <= kStorageSize,
|
||||
"nsID string won't fit in our storage!");
|
||||
// Capacity() excludes the null terminator; NSID_LENGTH includes it.
|
||||
MOZ_ASSERT(Capacity() + 1 == NSID_LENGTH);
|
||||
|
||||
if (IndexedDatabaseManager::GetLoggingMode() !=
|
||||
IndexedDatabaseManager::Logging_Disabled) {
|
||||
|
@ -209,8 +209,8 @@ function verifyWasmModule(module1, module2)
|
||||
let getGlobalForObject = SpecialPowers.Cu.getGlobalForObject;
|
||||
let testingFunctions = SpecialPowers.Cu.getJSTestingFunctions();
|
||||
let wasmExtractCode = SpecialPowers.unwrap(testingFunctions.wasmExtractCode);
|
||||
let exp1 = wasmExtractCode(module1);
|
||||
let exp2 = wasmExtractCode(module2);
|
||||
let exp1 = wasmExtractCode(module1, "ion");
|
||||
let exp2 = wasmExtractCode(module2, "ion");
|
||||
let code1 = exp1.code;
|
||||
let code2 = exp2.code;
|
||||
ok(code1 instanceof getGlobalForObject(code1).Uint8Array, "Instance of Uint8Array");
|
||||
|
@ -6,7 +6,7 @@
|
||||
dupe-manifest =
|
||||
head = xpcshell-head-child-process.js
|
||||
tail =
|
||||
skip-if = toolkit == 'android' || toolkit == 'gonk'
|
||||
skip-if = toolkit == 'android'
|
||||
support-files =
|
||||
GlobalObjectsChild.js
|
||||
GlobalObjectsComponent.js
|
||||
|
@ -507,8 +507,8 @@ function verifyView(view1, view2)
|
||||
function verifyWasmModule(module1, module2)
|
||||
{
|
||||
let testingFunctions = Cu.getJSTestingFunctions();
|
||||
let exp1 = testingFunctions.wasmExtractCode(module1);
|
||||
let exp2 = testingFunctions.wasmExtractCode(module2);
|
||||
let exp1 = testingFunctions.wasmExtractCode(module1, "ion");
|
||||
let exp2 = testingFunctions.wasmExtractCode(module2, "ion");
|
||||
let code1 = exp1.code;
|
||||
let code2 = exp2.code;
|
||||
ok(code1 instanceof Uint8Array, "Instance of Uint8Array");
|
||||
|
@ -6,7 +6,6 @@
|
||||
dupe-manifest =
|
||||
head = xpcshell-head-parent-process.js
|
||||
tail =
|
||||
skip-if = toolkit == 'gonk'
|
||||
support-files =
|
||||
bug1056939_profile.zip
|
||||
defaultStorageUpgrade_profile.zip
|
||||
|
@ -721,8 +721,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
* drag - msg1-n:TOUCH_CONTACT (moving), msgn+1:TOUCH_REMOVE
|
||||
* hover drag - msg1-n:TOUCH_HOVER (moving), msgn+1:TOUCH_REMOVE
|
||||
*
|
||||
* Widget support: Windows 8.0+, Winrt/Win32. Gonk supports CONTACT, REMOVE,
|
||||
* and CANCEL but no HOVER. Other widgets will throw.
|
||||
* Widget support: Windows 8.0+, Winrt/Win32. Other widgets will throw.
|
||||
*
|
||||
* NOTE: The synthesized native event will be fired asynchronously, and upon
|
||||
* completion the observer, if provided, will be notified with a "touchpoint"
|
||||
|
@ -1993,12 +1993,9 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
|
||||
extraArgs.push_back(idStr);
|
||||
extraArgs.push_back(IsForBrowser() ? "-isForBrowser" : "-notForBrowser");
|
||||
|
||||
char boolBuf[1024];
|
||||
char intBuf[1024];
|
||||
char strBuf[1024];
|
||||
nsFixedCString boolPrefs(boolBuf, 1024, 0);
|
||||
nsFixedCString intPrefs(intBuf, 1024, 0);
|
||||
nsFixedCString stringPrefs(strBuf, 1024, 0);
|
||||
nsAutoCStringN<1024> boolPrefs;
|
||||
nsAutoCStringN<1024> intPrefs;
|
||||
nsAutoCStringN<1024> stringPrefs;
|
||||
|
||||
size_t prefsLen;
|
||||
ContentPrefs::GetContentPrefs(&prefsLen);
|
||||
@ -5138,7 +5135,17 @@ ContentParent::AboutToLoadHttpFtpWyciwygDocumentForChild(nsIChannel* aChannel)
|
||||
MOZ_ASSERT(aChannel);
|
||||
|
||||
nsresult rv;
|
||||
if (!aChannel->IsDocument()) {
|
||||
bool isDocument = aChannel->IsDocument();
|
||||
if (!isDocument) {
|
||||
// We may be looking at a nsIHttpChannel which has isMainDocumentChannel set
|
||||
// (e.g. the internal http channel for a view-source: load.).
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
|
||||
if (httpChannel) {
|
||||
rv = httpChannel->GetIsMainDocumentChannel(&isDocument);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
if (!isDocument) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -5158,9 +5165,7 @@ ContentParent::AboutToLoadHttpFtpWyciwygDocumentForChild(nsIChannel* aChannel)
|
||||
|
||||
nsLoadFlags newLoadFlags;
|
||||
aChannel->GetLoadFlags(&newLoadFlags);
|
||||
bool isDocument = false;
|
||||
aChannel->GetIsDocument(&isDocument);
|
||||
if (newLoadFlags & nsIRequest::LOAD_DOCUMENT_NEEDS_COOKIE && isDocument) {
|
||||
if (newLoadFlags & nsIRequest::LOAD_DOCUMENT_NEEDS_COOKIE) {
|
||||
UpdateCookieStatus(aChannel);
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ const char* mozilla::dom::ContentPrefs::gInitPrefs[] = {
|
||||
"dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
|
||||
"dom.ipc.useNativeEventProcessing.content",
|
||||
"dom.max_chrome_script_run_time",
|
||||
"dom.max_ext_content_script_run_time",
|
||||
"dom.max_script_run_time",
|
||||
"dom.mozBrowserFramesEnabled",
|
||||
"dom.performance.enable_notify_performance_timing",
|
||||
@ -113,6 +114,7 @@ const char* mozilla::dom::ContentPrefs::gInitPrefs[] = {
|
||||
"javascript.options.throw_on_debuggee_would_run",
|
||||
"javascript.options.wasm",
|
||||
"javascript.options.wasm_baselinejit",
|
||||
"javascript.options.wasm_ionjit",
|
||||
"javascript.options.werror",
|
||||
"javascript.use_us_english_locale",
|
||||
"layout.idle_period.required_quiescent_frames",
|
||||
|
@ -14,6 +14,7 @@ struct SlowScriptData
|
||||
{
|
||||
TabId tabId;
|
||||
nsCString filename;
|
||||
nsString addonId;
|
||||
};
|
||||
|
||||
struct PluginHangData
|
||||
@ -35,7 +36,7 @@ parent:
|
||||
async ClearHang();
|
||||
|
||||
child:
|
||||
async TerminateScript();
|
||||
async TerminateScript(bool aTerminateGlobal);
|
||||
|
||||
async BeginStartingDebugger();
|
||||
async EndStartingDebugger();
|
||||
|
@ -85,9 +85,11 @@ class HangMonitorChild
|
||||
|
||||
typedef ProcessHangMonitor::SlowScriptAction SlowScriptAction;
|
||||
SlowScriptAction NotifySlowScript(nsITabChild* aTabChild,
|
||||
const char* aFileName);
|
||||
const char* aFileName,
|
||||
const nsString& aAddonId);
|
||||
void NotifySlowScriptAsync(TabId aTabId,
|
||||
const nsCString& aFileName);
|
||||
const nsCString& aFileName,
|
||||
const nsString& aAddonId);
|
||||
|
||||
bool IsDebuggerStartupComplete();
|
||||
|
||||
@ -98,7 +100,7 @@ class HangMonitorChild
|
||||
void ClearHangAsync();
|
||||
void ClearForcePaint();
|
||||
|
||||
mozilla::ipc::IPCResult RecvTerminateScript() override;
|
||||
mozilla::ipc::IPCResult RecvTerminateScript(const bool& aTerminateGlobal) override;
|
||||
mozilla::ipc::IPCResult RecvBeginStartingDebugger() override;
|
||||
mozilla::ipc::IPCResult RecvEndStartingDebugger() override;
|
||||
|
||||
@ -131,6 +133,7 @@ class HangMonitorChild
|
||||
|
||||
// These fields must be accessed with mMonitor held.
|
||||
bool mTerminateScript;
|
||||
bool mTerminateGlobal;
|
||||
bool mStartDebugger;
|
||||
bool mFinishedStartingDebugger;
|
||||
bool mForcePaint;
|
||||
@ -162,10 +165,12 @@ public:
|
||||
NS_IMETHOD GetHangType(uint32_t* aHangType) override;
|
||||
NS_IMETHOD GetScriptBrowser(nsIDOMElement** aBrowser) override;
|
||||
NS_IMETHOD GetScriptFileName(nsACString& aFileName) override;
|
||||
NS_IMETHOD GetAddonId(nsAString& aAddonId) override;
|
||||
|
||||
NS_IMETHOD GetPluginName(nsACString& aPluginName) override;
|
||||
|
||||
NS_IMETHOD TerminateScript() override;
|
||||
NS_IMETHOD TerminateGlobal() override;
|
||||
NS_IMETHOD BeginStartingDebugger() override;
|
||||
NS_IMETHOD EndStartingDebugger() override;
|
||||
NS_IMETHOD TerminatePlugin() override;
|
||||
@ -230,7 +235,7 @@ public:
|
||||
|
||||
void ForcePaint(dom::TabParent* aTabParent, uint64_t aLayerObserverEpoch);
|
||||
|
||||
void TerminateScript();
|
||||
void TerminateScript(bool aTerminateGlobal);
|
||||
void BeginStartingDebugger();
|
||||
void EndStartingDebugger();
|
||||
void CleanupPluginHang(uint32_t aPluginId, bool aRemoveFiles);
|
||||
@ -295,6 +300,7 @@ HangMonitorChild::HangMonitorChild(ProcessHangMonitor* aMonitor)
|
||||
mMonitor("HangMonitorChild lock"),
|
||||
mSentReport(false),
|
||||
mTerminateScript(false),
|
||||
mTerminateGlobal(false),
|
||||
mStartDebugger(false),
|
||||
mFinishedStartingDebugger(false),
|
||||
mForcePaint(false),
|
||||
@ -381,12 +387,16 @@ HangMonitorChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
HangMonitorChild::RecvTerminateScript()
|
||||
HangMonitorChild::RecvTerminateScript(const bool& aTerminateGlobal)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(IsOnThread());
|
||||
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
mTerminateScript = true;
|
||||
if (aTerminateGlobal) {
|
||||
mTerminateGlobal = true;
|
||||
} else {
|
||||
mTerminateScript = true;
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
@ -452,16 +462,18 @@ HangMonitorChild::Bind(Endpoint<PProcessHangMonitorChild>&& aEndpoint)
|
||||
|
||||
void
|
||||
HangMonitorChild::NotifySlowScriptAsync(TabId aTabId,
|
||||
const nsCString& aFileName)
|
||||
const nsCString& aFileName,
|
||||
const nsString& aAddonId)
|
||||
{
|
||||
if (mIPCOpen) {
|
||||
Unused << SendHangEvidence(SlowScriptData(aTabId, aFileName));
|
||||
Unused << SendHangEvidence(SlowScriptData(aTabId, aFileName, aAddonId));
|
||||
}
|
||||
}
|
||||
|
||||
HangMonitorChild::SlowScriptAction
|
||||
HangMonitorChild::NotifySlowScript(nsITabChild* aTabChild,
|
||||
const char* aFileName)
|
||||
const char* aFileName,
|
||||
const nsString& aAddonId)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
@ -475,6 +487,11 @@ HangMonitorChild::NotifySlowScript(nsITabChild* aTabChild,
|
||||
return SlowScriptAction::Terminate;
|
||||
}
|
||||
|
||||
if (mTerminateGlobal) {
|
||||
mTerminateGlobal = false;
|
||||
return SlowScriptAction::TerminateGlobal;
|
||||
}
|
||||
|
||||
if (mStartDebugger) {
|
||||
mStartDebugger = false;
|
||||
return SlowScriptAction::StartDebugger;
|
||||
@ -488,12 +505,12 @@ HangMonitorChild::NotifySlowScript(nsITabChild* aTabChild,
|
||||
}
|
||||
nsAutoCString filename(aFileName);
|
||||
|
||||
Dispatch(NewNonOwningRunnableMethod<TabId, nsCString>(
|
||||
Dispatch(NewNonOwningRunnableMethod<TabId, nsCString, nsString>(
|
||||
"HangMonitorChild::NotifySlowScriptAsync",
|
||||
this,
|
||||
&HangMonitorChild::NotifySlowScriptAsync,
|
||||
id,
|
||||
filename));
|
||||
filename, aAddonId));
|
||||
return SlowScriptAction::Continue;
|
||||
}
|
||||
|
||||
@ -554,6 +571,7 @@ HangMonitorChild::ClearHang()
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
mSentReport = false;
|
||||
mTerminateScript = false;
|
||||
mTerminateGlobal = false;
|
||||
mStartDebugger = false;
|
||||
mFinishedStartingDebugger = false;
|
||||
}
|
||||
@ -836,12 +854,12 @@ HangMonitorParent::RecvClearHang()
|
||||
}
|
||||
|
||||
void
|
||||
HangMonitorParent::TerminateScript()
|
||||
HangMonitorParent::TerminateScript(bool aTerminateGlobal)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(IsOnThread());
|
||||
|
||||
if (mIPCOpen) {
|
||||
Unused << SendTerminateScript();
|
||||
Unused << SendTerminateScript(aTerminateGlobal);
|
||||
}
|
||||
}
|
||||
|
||||
@ -955,6 +973,18 @@ HangMonitoredProcess::GetScriptFileName(nsACString& aFileName)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HangMonitoredProcess::GetAddonId(nsAString& aAddonId)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
if (mHangData.type() != HangData::TSlowScriptData) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
aAddonId = mHangData.get_SlowScriptData().addonId();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HangMonitoredProcess::GetPluginName(nsACString& aPluginName)
|
||||
{
|
||||
@ -988,9 +1018,28 @@ HangMonitoredProcess::TerminateScript()
|
||||
}
|
||||
|
||||
ProcessHangMonitor::Get()->Dispatch(
|
||||
NewNonOwningRunnableMethod("HangMonitorParent::TerminateScript",
|
||||
mActor,
|
||||
&HangMonitorParent::TerminateScript));
|
||||
NewNonOwningRunnableMethod<bool>("HangMonitorParent::TerminateScript",
|
||||
mActor,
|
||||
&HangMonitorParent::TerminateScript, false));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HangMonitoredProcess::TerminateGlobal()
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
if (mHangData.type() != HangData::TSlowScriptData) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (!mActor) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
ProcessHangMonitor::Get()->Dispatch(
|
||||
NewNonOwningRunnableMethod<bool>("HangMonitorParent::TerminateScript",
|
||||
mActor,
|
||||
&HangMonitorParent::TerminateScript, true));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1165,10 +1214,11 @@ ProcessHangMonitor::Observe(nsISupports* aSubject, const char* aTopic, const cha
|
||||
|
||||
ProcessHangMonitor::SlowScriptAction
|
||||
ProcessHangMonitor::NotifySlowScript(nsITabChild* aTabChild,
|
||||
const char* aFileName)
|
||||
const char* aFileName,
|
||||
const nsString& aAddonId)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
return HangMonitorChild::Get()->NotifySlowScript(aTabChild, aFileName);
|
||||
return HangMonitorChild::Get()->NotifySlowScript(aTabChild, aFileName, aAddonId);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -15,6 +15,7 @@
|
||||
class nsIRunnable;
|
||||
class nsITabChild;
|
||||
class nsIThread;
|
||||
class nsString;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -52,10 +53,12 @@ class ProcessHangMonitor final
|
||||
enum SlowScriptAction {
|
||||
Continue,
|
||||
Terminate,
|
||||
StartDebugger
|
||||
StartDebugger,
|
||||
TerminateGlobal,
|
||||
};
|
||||
SlowScriptAction NotifySlowScript(nsITabChild* aTabChild,
|
||||
const char* aFileName);
|
||||
const char* aFileName,
|
||||
const nsString& aAddonId);
|
||||
|
||||
void NotifyPluginHang(uint32_t aPluginId);
|
||||
|
||||
|
@ -32,6 +32,7 @@ interface nsIHangReport : nsISupports
|
||||
// Only valid for SLOW_SCRIPT reports.
|
||||
readonly attribute nsIDOMElement scriptBrowser;
|
||||
readonly attribute ACString scriptFileName;
|
||||
readonly attribute AString addonId;
|
||||
|
||||
// For PLUGIN_HANGs, this field contains information about the plugin.
|
||||
// Only valid for PLUGIN_HANG reports.
|
||||
@ -45,6 +46,11 @@ interface nsIHangReport : nsISupports
|
||||
// Only valid for SLOW_SCRIPT reports.
|
||||
void terminateScript();
|
||||
|
||||
// Terminate all scripts on the global that triggered the slow script
|
||||
// warning.
|
||||
// Only valid for SLOW_SCRIPT reports.
|
||||
void terminateGlobal();
|
||||
|
||||
// Terminate the plugin if it is still hung.
|
||||
// Only valid for PLUGIN_HANG reports.
|
||||
void terminatePlugin();
|
||||
|
@ -6,6 +6,12 @@ KillScriptTitle=Warning: Unresponsive script
|
||||
KillScriptMessage=A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
|
||||
KillScriptWithDebugMessage=A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
|
||||
KillScriptLocation=Script: %S
|
||||
|
||||
KillAddonScriptTitle=Warning: Unresponsive add-on script
|
||||
# LOCALIZATION NOTE (KillAddonScriptMessage): The first %S is the name of an add-on. The second %S is the name of the application (e.g., Firefox).
|
||||
KillAddonScriptMessage=A script from the add-on “%S” is running on this page, and making %S unresponsive.\n\nIt may be busy, or it may have stopped responsing permanently. You can stop the script now, or you can continue to see if it will complete.
|
||||
KillAddonScriptGlobalMessage=Prevent the add-on script from running on this page until it next reloads.
|
||||
|
||||
StopScriptButton=Stop script
|
||||
DebugScriptButton=Debug script
|
||||
WaitForScriptButton=Continue
|
||||
|
@ -82,8 +82,6 @@ public:
|
||||
NS_IMETHOD
|
||||
OnSuccess(nsIVariant* aDevices) override
|
||||
{
|
||||
// Cribbed from MediaPermissionGonk.cpp
|
||||
|
||||
// Create array for nsIMediaDevice
|
||||
nsTArray<nsCOMPtr<nsIMediaDevice>> devices;
|
||||
// Contain the fumes
|
||||
|
@ -116,9 +116,6 @@ private:
|
||||
DECL_MEDIA_PREF("media.eme.enabled", EMEEnabled, bool, false);
|
||||
DECL_MEDIA_PREF("media.use-blank-decoder", PDMUseBlankDecoder, bool, false);
|
||||
DECL_MEDIA_PREF("media.gpu-process-decoder", PDMUseGPUDecoder, bool, false);
|
||||
#ifdef MOZ_GONK_MEDIACODEC
|
||||
DECL_MEDIA_PREF("media.gonk.enabled", PDMGonkDecoderEnabled, bool, true);
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
DECL_MEDIA_PREF("media.android-media-codec.enabled", PDMAndroidMediaCodecEnabled, bool, false);
|
||||
DECL_MEDIA_PREF("media.android-media-codec.preferred", PDMAndroidMediaCodecPreferred, bool, false);
|
||||
|
@ -65,10 +65,6 @@ MP4Decoder::IsSupportedType(const MediaContainerType& aType,
|
||||
|| aType.Type() == MEDIAMIMETYPE("audio/x-m4a");
|
||||
const bool isVideo = aType.Type() == MEDIAMIMETYPE("video/mp4")
|
||||
|| aType.Type() == MEDIAMIMETYPE("video/quicktime")
|
||||
// On B2G, treat 3GPP as MP4 when Gonk PDM is available.
|
||||
#ifdef MOZ_GONK_MEDIACODEC
|
||||
|| aType.Type() == MEDIAMIMETYPE(VIDEO_3GPP)
|
||||
#endif
|
||||
|| aType.Type() == MEDIAMIMETYPE("video/x-m4v");
|
||||
|
||||
if (!isAudio && !isVideo) {
|
||||
|
@ -18,6 +18,3 @@ SOURCES += [
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
if CONFIG['MOZ_GONK_MEDIACODEC']:
|
||||
DEFINES['MOZ_GONK_MEDIACODEC'] = True
|
||||
|
@ -38,9 +38,6 @@ TEST_DIRS += [
|
||||
'gtest',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_GONK_MEDIACODEC']:
|
||||
DEFINES['MOZ_GONK_MEDIACODEC'] = True
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
@ -320,9 +320,6 @@ else:
|
||||
if CONFIG['ANDROID_VERSION'] > '15':
|
||||
DEFINES['MOZ_OMX_WEBM_DECODER'] = True
|
||||
|
||||
if CONFIG['MOZ_GONK_MEDIACODEC']:
|
||||
DEFINES['MOZ_GONK_MEDIACODEC'] = True
|
||||
|
||||
if CONFIG['MOZ_ANDROID_HLS_SUPPORT']:
|
||||
DEFINES['MOZ_ANDROID_HLS_SUPPORT'] = True
|
||||
|
||||
|
@ -18,9 +18,6 @@
|
||||
#ifdef MOZ_APPLEMEDIA
|
||||
#include "AppleDecoderModule.h"
|
||||
#endif
|
||||
#ifdef MOZ_GONK_MEDIACODEC
|
||||
#include "GonkDecoderModule.h"
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "AndroidDecoderModule.h"
|
||||
#endif
|
||||
@ -371,12 +368,6 @@ PDMFactory::CreatePDMs()
|
||||
m = new AppleDecoderModule();
|
||||
StartupPDM(m);
|
||||
#endif
|
||||
#ifdef MOZ_GONK_MEDIACODEC
|
||||
if (MediaPrefs::PDMGonkDecoderEnabled()) {
|
||||
m = new GonkDecoderModule();
|
||||
StartupPDM(m);
|
||||
}
|
||||
#endif
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
if(MediaPrefs::PDMAndroidMediaCodecEnabled()){
|
||||
m = new AndroidDecoderModule();
|
||||
|
@ -300,8 +300,8 @@ OmxDataDecoder::FillBufferDone(BufferData* aData)
|
||||
MOZ_ASSERT(!aData || aData->mStatus == BufferData::BufferStatus::OMX_CLIENT);
|
||||
|
||||
// Don't output sample when flush or shutting down, especially for video
|
||||
// decoded frame. Because video decoded frame has a promise in BufferData
|
||||
// waiting for layer to resolve it via recycle callback on Gonk, if other
|
||||
// decoded frame. Because video decoded frame can have a promise in
|
||||
// BufferData waiting for layer to resolve it via recycle callback, if other
|
||||
// module doesn't send it to layer, it will cause a unresolved promise and
|
||||
// waiting for resolve infinitely.
|
||||
if (mFlushing || mShuttingDown) {
|
||||
@ -336,8 +336,7 @@ OmxDataDecoder::Output(BufferData* aData)
|
||||
|
||||
if (isPlatformData) {
|
||||
// If the MediaData is platform dependnet data, it's mostly a kind of
|
||||
// limited resource, for example, GraphicBuffer on Gonk. So we use promise
|
||||
// to notify when the resource is free.
|
||||
// limited resource, so we use promise to notify when the resource is free.
|
||||
aData->mStatus = BufferData::BufferStatus::OMX_CLIENT_OUTPUT;
|
||||
|
||||
MOZ_RELEASE_ASSERT(aData->mPromise.IsEmpty());
|
||||
|
@ -282,26 +282,7 @@ OmxPlatformLayer::CompressionFormat()
|
||||
}
|
||||
}
|
||||
|
||||
// Implementations for different platforms will be defined in their own files.
|
||||
#ifdef OMX_PLATFORM_GONK
|
||||
|
||||
bool
|
||||
OmxPlatformLayer::SupportsMimeType(const nsACString& aMimeType)
|
||||
{
|
||||
return GonkOmxPlatformLayer::FindComponents(aMimeType);
|
||||
}
|
||||
|
||||
OmxPlatformLayer*
|
||||
OmxPlatformLayer::Create(OmxDataDecoder* aDataDecoder,
|
||||
OmxPromiseLayer* aPromiseLayer,
|
||||
TaskQueue* aTaskQueue,
|
||||
layers::ImageContainer* aImageContainer)
|
||||
{
|
||||
return new GonkOmxPlatformLayer(aDataDecoder, aPromiseLayer, aTaskQueue, aImageContainer);
|
||||
}
|
||||
|
||||
#else // For platforms without OMX IL support.
|
||||
|
||||
// For platforms without OMX IL support.
|
||||
bool
|
||||
OmxPlatformLayer::SupportsMimeType(const nsACString& aMimeType)
|
||||
{
|
||||
@ -317,6 +298,4 @@ OmxPlatformLayer::Create(OmxDataDecoder* aDataDecoder,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ public:
|
||||
OMX_U32 aParam1,
|
||||
OMX_PTR aCmdData) = 0;
|
||||
|
||||
// Buffer could be platform dependent; for example, video decoding needs gralloc
|
||||
// on Gonk. Therefore, derived class needs to implement its owned buffer
|
||||
// allocate/release API according to its platform type.
|
||||
// Buffer could be platform dependent. Therefore, derived class needs to
|
||||
// implement its owned buffer allocate/release API according to its platform
|
||||
// type.
|
||||
virtual nsresult AllocateOmxBuffer(OMX_DIRTYPE aType, BUFFERLIST* aBufferList) = 0;
|
||||
|
||||
virtual nsresult ReleaseOmxBuffer(OMX_DIRTYPE aType, BUFFERLIST* aBufferList) = 0;
|
||||
|
@ -136,7 +136,7 @@ public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BufferData)
|
||||
|
||||
// In most cases, the ID of this buffer is the pointer address of mBuffer.
|
||||
// However, in platform like gonk, it is another value.
|
||||
// However, on some platforms it may be another value.
|
||||
virtual BufferID ID()
|
||||
{
|
||||
return mBuffer;
|
||||
|
@ -30,8 +30,7 @@ enum {
|
||||
* Abstract interface for managing audio and video devices. Each platform
|
||||
* must implement a concrete class that will map these classes and methods
|
||||
* to the appropriate backend. For example, on Desktop platforms, these will
|
||||
* correspond to equivalent webrtc (GIPS) calls, and on B2G they will map to
|
||||
* a Gonk interface.
|
||||
* correspond to equivalent webrtc (GIPS) calls.
|
||||
*/
|
||||
class MediaEngineVideoSource;
|
||||
class MediaEngineAudioSource;
|
||||
@ -306,7 +305,6 @@ public:
|
||||
|
||||
/* If implementation of MediaEngineSource supports TakePhoto(), the picture
|
||||
* should be return via aCallback object. Otherwise, it returns NS_ERROR_NOT_IMPLEMENTED.
|
||||
* Currently, only Gonk MediaEngineSource implementation supports it.
|
||||
*/
|
||||
virtual nsresult TakePhoto(MediaEnginePhotoCallback* aCallback) = 0;
|
||||
|
||||
|
@ -64,15 +64,10 @@ public:
|
||||
void Shutdown() override
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
// Release mImage and it's resources just in case -- also we can be
|
||||
// held by something in a CC chain, and not be deleted until final-cc,
|
||||
// which is too late for releasing images. (This should be null'd on
|
||||
// Stop(), but apparently Stop() may not get called in this case
|
||||
// somehow.) (Bug 1374164)
|
||||
|
||||
// really Stop() *should* be called before it gets here
|
||||
Unused << NS_WARN_IF(mImage);
|
||||
|
||||
mImage = nullptr;
|
||||
mImageContainer = nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -124,10 +119,9 @@ protected:
|
||||
nsTArray<PrincipalHandle> mPrincipalHandles; // Directly mapped to mSources.
|
||||
RefPtr<layers::Image> mImage;
|
||||
RefPtr<layers::ImageContainer> mImageContainer;
|
||||
int mWidth, mHeight; // protected with mMonitor on Gonk due to different threading
|
||||
// end of data protected by mMonitor
|
||||
|
||||
|
||||
int mWidth, mHeight;
|
||||
bool mInitDone;
|
||||
bool mHasDirectListeners;
|
||||
int mCaptureIndex;
|
||||
|
@ -44,7 +44,9 @@ MediaEngineDefaultVideoSource::MediaEngineDefaultVideoSource()
|
||||
: MediaEngineVideoSource()
|
||||
#endif
|
||||
, mTimer(nullptr)
|
||||
#ifndef MOZ_WEBRTC
|
||||
, mMonitor("Fake video")
|
||||
#endif
|
||||
, mCb(16), mCr(16)
|
||||
{
|
||||
mImageContainer =
|
||||
|
@ -87,6 +87,12 @@ public:
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void Shutdown() override {
|
||||
Stop(mSource, mTrackID);
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
mImageContainer = nullptr;
|
||||
}
|
||||
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSITIMERCALLBACK
|
||||
NS_DECL_NSINAMED
|
||||
@ -96,15 +102,18 @@ protected:
|
||||
|
||||
friend class MediaEngineDefault;
|
||||
|
||||
RefPtr<SourceMediaStream> mSource;
|
||||
TrackID mTrackID;
|
||||
nsCOMPtr<nsITimer> mTimer;
|
||||
// mMonitor protects mImage access/changes, and transitions of mState
|
||||
// from kStarted to kStopped (which are combined with EndTrack() and
|
||||
// image changes).
|
||||
|
||||
#ifndef MOZ_WEBRTC
|
||||
// mMonitor protects mImage/mImageContainer access/changes, and
|
||||
// transitions of mState from kStarted to kStopped (which are combined
|
||||
// with EndTrack() and image changes).
|
||||
Monitor mMonitor;
|
||||
RefPtr<layers::Image> mImage;
|
||||
|
||||
RefPtr<layers::ImageContainer> mImageContainer;
|
||||
#endif
|
||||
|
||||
MediaEnginePrefs mOpts;
|
||||
int mCb;
|
||||
@ -199,6 +208,12 @@ public:
|
||||
void Shutdown() override {
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
for (auto& source : mVSources) {
|
||||
source->Shutdown();
|
||||
}
|
||||
for (auto& source : mASources) {
|
||||
source->Shutdown();
|
||||
}
|
||||
mVSources.Clear();
|
||||
mASources.Clear();
|
||||
};
|
||||
@ -208,7 +223,6 @@ private:
|
||||
|
||||
Mutex mMutex;
|
||||
// protected with mMutex:
|
||||
|
||||
nsTArray<RefPtr<MediaEngineVideoSource> > mVSources;
|
||||
nsTArray<RefPtr<MediaEngineAudioSource> > mASources;
|
||||
};
|
||||
|
@ -70,7 +70,6 @@ MediaEngineRemoteVideoSource::Shutdown()
|
||||
if (!mInitDone) {
|
||||
return;
|
||||
}
|
||||
Super::Shutdown();
|
||||
if (mState == kStarted) {
|
||||
SourceMediaStream *source;
|
||||
bool empty;
|
||||
@ -96,6 +95,7 @@ MediaEngineRemoteVideoSource::Shutdown()
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mState == kReleased);
|
||||
Super::Shutdown();
|
||||
mInitDone = false;
|
||||
}
|
||||
|
||||
@ -206,8 +206,10 @@ MediaEngineRemoteVideoSource::Stop(mozilla::SourceMediaStream* aSource,
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
|
||||
// Drop any cached image so we don't start with a stale image on next
|
||||
// usage
|
||||
// usage. Also, gfx gets very upset if these are held until this object
|
||||
// is gc'd in final-cc during shutdown (bug 1374164)
|
||||
mImage = nullptr;
|
||||
// we drop mImageContainer only in MediaEngineCaptureVideoSource::Shutdown()
|
||||
|
||||
size_t i = mSources.IndexOf(aSource);
|
||||
if (i == mSources.NoIndex) {
|
||||
@ -387,32 +389,42 @@ MediaEngineRemoteVideoSource::DeliverFrame(uint8_t* aBuffer ,
|
||||
// Update the dimensions
|
||||
FrameSizeChange(aProps.width(), aProps.height());
|
||||
|
||||
// Create a video frame and append it to the track.
|
||||
RefPtr<layers::PlanarYCbCrImage> image = mImageContainer->CreatePlanarYCbCrImage();
|
||||
|
||||
uint8_t* frame = static_cast<uint8_t*> (aBuffer);
|
||||
const uint8_t lumaBpp = 8;
|
||||
const uint8_t chromaBpp = 4;
|
||||
|
||||
// Take lots of care to round up!
|
||||
layers::PlanarYCbCrData data;
|
||||
data.mYChannel = frame;
|
||||
data.mYSize = IntSize(mWidth, mHeight);
|
||||
data.mYStride = (mWidth * lumaBpp + 7)/ 8;
|
||||
data.mCbCrStride = (mWidth * chromaBpp + 7) / 8;
|
||||
data.mCbChannel = frame + mHeight * data.mYStride;
|
||||
data.mCrChannel = data.mCbChannel + ((mHeight+1)/2) * data.mCbCrStride;
|
||||
data.mCbCrSize = IntSize((mWidth+1)/ 2, (mHeight+1)/ 2);
|
||||
data.mPicX = 0;
|
||||
data.mPicY = 0;
|
||||
data.mPicSize = IntSize(mWidth, mHeight);
|
||||
data.mStereoMode = StereoMode::MONO;
|
||||
RefPtr<layers::PlanarYCbCrImage> image;
|
||||
{
|
||||
// We grab the lock twice, but don't hold it across the (long) CopyData
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
if (!mImageContainer) {
|
||||
LOG(("DeliverFrame() called after Stop()!"));
|
||||
return 0;
|
||||
}
|
||||
// Create a video frame and append it to the track.
|
||||
image = mImageContainer->CreatePlanarYCbCrImage();
|
||||
|
||||
uint8_t* frame = static_cast<uint8_t*> (aBuffer);
|
||||
const uint8_t lumaBpp = 8;
|
||||
const uint8_t chromaBpp = 4;
|
||||
|
||||
// Take lots of care to round up!
|
||||
data.mYChannel = frame;
|
||||
data.mYSize = IntSize(mWidth, mHeight);
|
||||
data.mYStride = (mWidth * lumaBpp + 7)/ 8;
|
||||
data.mCbCrStride = (mWidth * chromaBpp + 7) / 8;
|
||||
data.mCbChannel = frame + mHeight * data.mYStride;
|
||||
data.mCrChannel = data.mCbChannel + ((mHeight+1)/2) * data.mCbCrStride;
|
||||
data.mCbCrSize = IntSize((mWidth+1)/ 2, (mHeight+1)/ 2);
|
||||
data.mPicX = 0;
|
||||
data.mPicY = 0;
|
||||
data.mPicSize = IntSize(mWidth, mHeight);
|
||||
data.mStereoMode = StereoMode::MONO;
|
||||
}
|
||||
|
||||
if (!image->CopyData(data)) {
|
||||
MOZ_ASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
#ifdef DEBUG
|
||||
static uint32_t frame_num = 0;
|
||||
LOGFRAME(("frame %d (%dx%d); timeStamp %u, ntpTimeMs %" PRIu64 ", renderTimeMs %" PRIu64,
|
||||
@ -420,10 +432,6 @@ MediaEngineRemoteVideoSource::DeliverFrame(uint8_t* aBuffer ,
|
||||
aProps.timeStamp(), aProps.ntpTimeMs(), aProps.renderTimeMs()));
|
||||
#endif
|
||||
|
||||
// we don't touch anything in 'this' until here (except for snapshot,
|
||||
// which has it's own lock)
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
|
||||
// implicitly releases last image
|
||||
mImage = image.forget();
|
||||
|
||||
|
@ -52,8 +52,8 @@
|
||||
// Pico's sample rate is always 16000
|
||||
#define PICO_SAMPLE_RATE 16000
|
||||
|
||||
// The path to the language files in Gonk
|
||||
#define GONK_PICO_LANG_PATH "/system/tts/lang_pico"
|
||||
// The path to the language files in Android
|
||||
#define PICO_LANG_PATH "/system/tts/lang_pico"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -514,11 +514,11 @@ nsPicoService::Init()
|
||||
return;
|
||||
}
|
||||
|
||||
// Use environment variable, or default android/b2g path
|
||||
// Use environment variable, or default android path
|
||||
nsAutoCString langPath(PR_GetEnv("PICO_LANG_PATH"));
|
||||
|
||||
if (langPath.IsEmpty()) {
|
||||
langPath.AssignLiteral(GONK_PICO_LANG_PATH);
|
||||
langPath.AssignLiteral(PICO_LANG_PATH);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> voicesDir;
|
||||
|
@ -159,40 +159,91 @@ NPClass nsJSObjWrapper::sJSObjWrapperNPClass =
|
||||
nsJSObjWrapper::NP_Construct
|
||||
};
|
||||
|
||||
static bool
|
||||
NPObjWrapper_AddProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> v);
|
||||
class NPObjWrapperProxyHandler : public js::BaseProxyHandler
|
||||
{
|
||||
static const char family;
|
||||
|
||||
static bool
|
||||
NPObjWrapper_DelProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::ObjectOpResult &result);
|
||||
public:
|
||||
static const NPObjWrapperProxyHandler singleton;
|
||||
|
||||
static bool
|
||||
NPObjWrapper_SetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::Value> vp, JS::ObjectOpResult &result);
|
||||
constexpr NPObjWrapperProxyHandler()
|
||||
: BaseProxyHandler(&family)
|
||||
{}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);
|
||||
bool defineProperty(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||
JS::Handle<JS::PropertyDescriptor> desc,
|
||||
JS::ObjectOpResult& result) const override {
|
||||
::JS_ReportErrorASCII(cx, "Trying to add unsupported property on NPObject!");
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_NewEnumerate(JSContext *cx, JS::Handle<JSObject*> obj, JS::AutoIdVector &properties,
|
||||
bool enumerableOnly);
|
||||
bool getPrototypeIfOrdinary(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
bool* isOrdinary,
|
||||
JS::MutableHandle<JSObject*> proto) const override {
|
||||
*isOrdinary = true;
|
||||
proto.set(js::GetStaticPrototype(proxy));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isExtensible(JSContext *cx, JS::Handle<JSObject*> proxy,
|
||||
bool *extensible) const override {
|
||||
// Needs to be extensible so nsObjectLoadingContent can mutate our
|
||||
// __proto__.
|
||||
*extensible = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool preventExtensions(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::ObjectOpResult& result) const override {
|
||||
result.succeed();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
|
||||
|
||||
bool ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::AutoIdVector& properties) const override;
|
||||
|
||||
bool delete_(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||
JS::ObjectOpResult& result) const override;
|
||||
|
||||
bool get(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<JS::Value> receiver,
|
||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const override;
|
||||
|
||||
bool set(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||
JS::Handle<JS::Value> vp, JS::Handle<JS::Value> receiver, JS::ObjectOpResult& result)
|
||||
const override;
|
||||
|
||||
bool isCallable(JSObject* obj) const override {
|
||||
return true;
|
||||
}
|
||||
bool call(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
const JS::CallArgs& args) const override;
|
||||
|
||||
bool isConstructor(JSObject* obj) const override {
|
||||
return true;
|
||||
}
|
||||
bool construct(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
const JS::CallArgs& args) const override;
|
||||
|
||||
bool finalizeInBackground(const JS::Value& priv) const override {
|
||||
return false;
|
||||
}
|
||||
void finalize(JSFreeOp* fop, JSObject* proxy) const override;
|
||||
};
|
||||
|
||||
const char NPObjWrapperProxyHandler::family = 0;
|
||||
const NPObjWrapperProxyHandler NPObjWrapperProxyHandler::singleton;
|
||||
|
||||
static bool
|
||||
NPObjWrapper_Resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
bool *resolvedp);
|
||||
|
||||
static void
|
||||
NPObjWrapper_Finalize(js::FreeOp *fop, JSObject *obj);
|
||||
bool* resolved, JS::MutableHandle<JSObject*> method);
|
||||
|
||||
static void
|
||||
NPObjWrapper_ObjectMoved(JSObject *obj, const JSObject *old);
|
||||
|
||||
static bool
|
||||
NPObjWrapper_Call(JSContext *cx, unsigned argc, JS::Value *vp);
|
||||
|
||||
static bool
|
||||
NPObjWrapper_Construct(JSContext *cx, unsigned argc, JS::Value *vp);
|
||||
|
||||
static bool
|
||||
NPObjWrapper_toPrimitive(JSContext *cx, unsigned argc, JS::Value *vp);
|
||||
|
||||
@ -201,36 +252,14 @@ CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj,
|
||||
JS::Handle<jsid> id, NPVariant* getPropertyResult,
|
||||
JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
const static js::ClassOps sNPObjectJSWrapperClassOps = {
|
||||
NPObjWrapper_AddProperty,
|
||||
NPObjWrapper_DelProperty,
|
||||
NPObjWrapper_GetProperty,
|
||||
NPObjWrapper_SetProperty,
|
||||
nullptr, /* enumerate */
|
||||
NPObjWrapper_NewEnumerate,
|
||||
NPObjWrapper_Resolve,
|
||||
nullptr, /* mayResolve */
|
||||
NPObjWrapper_Finalize,
|
||||
NPObjWrapper_Call,
|
||||
nullptr, /* hasInstance */
|
||||
NPObjWrapper_Construct,
|
||||
nullptr, /* trace */
|
||||
};
|
||||
|
||||
const static js::ClassExtension sNPObjectJSWrapperClassExtension = {
|
||||
nullptr, /* weakmapKeyDelegateOp */
|
||||
static const js::ClassExtension sNPObjWrapperProxyClassExtension = PROXY_MAKE_EXT(
|
||||
NPObjWrapper_ObjectMoved
|
||||
};
|
||||
);
|
||||
|
||||
const static js::Class sNPObjectJSWrapperClass = {
|
||||
const js::Class sNPObjWrapperProxyClass = PROXY_CLASS_WITH_EXT(
|
||||
NPRUNTIME_JSCLASS_NAME,
|
||||
JSCLASS_HAS_PRIVATE |
|
||||
JSCLASS_FOREGROUND_FINALIZE,
|
||||
&sNPObjectJSWrapperClassOps,
|
||||
JS_NULL_CLASS_SPEC,
|
||||
&sNPObjectJSWrapperClassExtension,
|
||||
JS_NULL_OBJECT_OPS
|
||||
};
|
||||
JSCLASS_HAS_RESERVED_SLOTS(1),
|
||||
&sNPObjWrapperProxyClassExtension);
|
||||
|
||||
typedef struct NPObjectMemberPrivate {
|
||||
JS::Heap<JSObject *> npobjWrapper;
|
||||
@ -1084,7 +1113,7 @@ nsJSObjWrapper::GetNewOrUsed(NPP npp, JS::Handle<JSObject*> obj)
|
||||
// obj is one of our own, its private data is the NPObject we're
|
||||
// looking for.
|
||||
|
||||
NPObject *npobj = (NPObject *)::JS_GetPrivate(obj);
|
||||
NPObject *npobj = (NPObject *)js::GetProxyPrivate(obj).toPrivate();
|
||||
|
||||
// If the private is null, that means that the object has already been torn
|
||||
// down, possible because the owning plugin was destroyed (there can be
|
||||
@ -1171,58 +1200,31 @@ GetNPObject(JSContext *cx, JSObject *obj)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return (NPObject *)::JS_GetPrivate(obj);
|
||||
return (NPObject *)js::GetProxyPrivate(obj).toPrivate();
|
||||
}
|
||||
|
||||
|
||||
// Does not actually add a property because this is always followed by a
|
||||
// SetProperty call.
|
||||
static bool
|
||||
NPObjWrapper_AddProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> v)
|
||||
static JSObject*
|
||||
NPObjWrapper_GetResolvedProps(JSContext* cx, JS::Handle<JSObject*> obj)
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
JS::Value slot = js::GetProxyReservedSlot(obj, 0);
|
||||
if (slot.isObject())
|
||||
return &slot.toObject();
|
||||
|
||||
if (!npobj || !npobj->_class || !npobj->_class->hasProperty ||
|
||||
!npobj->_class->hasMethod) {
|
||||
ThrowJSExceptionASCII(cx, "Bad NPObject as private data!");
|
||||
MOZ_ASSERT(slot.isUndefined());
|
||||
|
||||
return false;
|
||||
}
|
||||
JSObject* res = JS_NewObject(cx, nullptr);
|
||||
if (!res)
|
||||
return nullptr;
|
||||
|
||||
if (NPObjectIsOutOfProcessProxy(npobj)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PluginDestructionGuard pdg(LookupNPP(npobj));
|
||||
|
||||
NPIdentifier identifier = JSIdToNPIdentifier(id);
|
||||
bool hasProperty = npobj->_class->hasProperty(npobj, identifier);
|
||||
if (!ReportExceptionIfPending(cx))
|
||||
return false;
|
||||
|
||||
if (hasProperty)
|
||||
return true;
|
||||
|
||||
// We must permit methods here since JS_DefineUCFunction() will add
|
||||
// the function as a property
|
||||
bool hasMethod = npobj->_class->hasMethod(npobj, identifier);
|
||||
if (!ReportExceptionIfPending(cx))
|
||||
return false;
|
||||
|
||||
if (!hasMethod) {
|
||||
ThrowJSExceptionASCII(cx, "Trying to add unsupported property on NPObject!");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
SetProxyReservedSlot(obj, 0, JS::ObjectValue(*res));
|
||||
return res;
|
||||
}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_DelProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::ObjectOpResult &result)
|
||||
bool
|
||||
NPObjWrapperProxyHandler::delete_(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||
JS::ObjectOpResult& result) const
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
NPObject *npobj = GetNPObject(cx, proxy);
|
||||
|
||||
if (!npobj || !npobj->_class || !npobj->_class->hasProperty ||
|
||||
!npobj->_class->removeProperty) {
|
||||
@ -1231,6 +1233,12 @@ NPObjWrapper_DelProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
return false;
|
||||
}
|
||||
|
||||
JS::Rooted<JSObject*> resolvedProps(cx, NPObjWrapper_GetResolvedProps(cx, proxy));
|
||||
if (!resolvedProps)
|
||||
return false;
|
||||
if (!JS_DeletePropertyById(cx, resolvedProps, id, result))
|
||||
return false;
|
||||
|
||||
PluginDestructionGuard pdg(LookupNPP(npobj));
|
||||
|
||||
NPIdentifier identifier = JSIdToNPIdentifier(id);
|
||||
@ -1254,11 +1262,12 @@ NPObjWrapper_DelProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
return succeeded ? result.succeed() : result.failCantDelete();
|
||||
}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_SetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::Value> vp, JS::ObjectOpResult &result)
|
||||
bool
|
||||
NPObjWrapperProxyHandler::set(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||
JS::Handle<JS::Value> vp, JS::Handle<JS::Value> receiver,
|
||||
JS::ObjectOpResult& result) const
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
NPObject *npobj = GetNPObject(cx, proxy);
|
||||
|
||||
if (!npobj || !npobj->_class || !npobj->_class->hasProperty ||
|
||||
!npobj->_class->setProperty) {
|
||||
@ -1277,6 +1286,18 @@ NPObjWrapper_SetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
bool resolved = false;
|
||||
JS::Rooted<JSObject*> method(cx);
|
||||
if (!NPObjWrapper_Resolve(cx, proxy, id, &resolved, &method))
|
||||
return false;
|
||||
if (!resolved) {
|
||||
// We don't have a property/method with this id. Forward to the prototype
|
||||
// chain.
|
||||
return js::BaseProxyHandler::set(cx, proxy, id, vp, receiver, result);
|
||||
}
|
||||
}
|
||||
|
||||
PluginDestructionGuard pdg(npp);
|
||||
|
||||
NPIdentifier identifier = JSIdToNPIdentifier(id);
|
||||
@ -1315,9 +1336,13 @@ NPObjWrapper_SetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
|
||||
CallNPMethod(JSContext *cx, unsigned argc, JS::Value *vp);
|
||||
|
||||
bool
|
||||
NPObjWrapperProxyHandler::get(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<JS::Value> receiver,
|
||||
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) const
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
NPObject *npobj = GetNPObject(cx, proxy);
|
||||
|
||||
if (!npobj || !npobj->_class || !npobj->_class->hasProperty ||
|
||||
!npobj->_class->hasMethod || !npobj->_class->getProperty) {
|
||||
@ -1349,8 +1374,7 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
return true;
|
||||
}
|
||||
|
||||
vp.setUndefined();
|
||||
return true;
|
||||
return js::BaseProxyHandler::get(cx, proxy, receiver, id, vp);
|
||||
}
|
||||
|
||||
// Find out what plugin (NPP) is the owner of the object we're
|
||||
@ -1362,6 +1386,22 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
bool resolved = false;
|
||||
JS::Rooted<JSObject*> method(cx);
|
||||
if (!NPObjWrapper_Resolve(cx, proxy, id, &resolved, &method))
|
||||
return false;
|
||||
if (method) {
|
||||
vp.setObject(*method);
|
||||
return true;
|
||||
}
|
||||
if (!resolved) {
|
||||
// We don't have a property/method with this id. Forward to the prototype
|
||||
// chain.
|
||||
return js::BaseProxyHandler::get(cx, proxy, receiver, id, vp);
|
||||
}
|
||||
}
|
||||
|
||||
PluginDestructionGuard pdg(npp);
|
||||
|
||||
bool hasProperty, hasMethod;
|
||||
@ -1391,7 +1431,7 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
if (success) {
|
||||
// We return NPObject Member class here to support ambiguous members.
|
||||
if (hasProperty && hasMethod)
|
||||
return CreateNPObjectMember(npp, cx, obj, npobj, id, &npv, vp);
|
||||
return CreateNPObjectMember(npp, cx, proxy, npobj, id, &npv, vp);
|
||||
|
||||
if (hasProperty) {
|
||||
vp.set(NPVariantToJSVal(npp, cx, &npv));
|
||||
@ -1399,9 +1439,10 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
|
||||
if (!ReportExceptionIfPending(cx))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return js::BaseProxyHandler::get(cx, proxy, receiver, id, vp);
|
||||
}
|
||||
|
||||
hasProperty = npobj->_class->hasProperty(npobj, identifier);
|
||||
@ -1414,7 +1455,7 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
|
||||
// We return NPObject Member class here to support ambiguous members.
|
||||
if (hasProperty && hasMethod)
|
||||
return CreateNPObjectMember(npp, cx, obj, npobj, id, nullptr, vp);
|
||||
return CreateNPObjectMember(npp, cx, proxy, npobj, id, nullptr, vp);
|
||||
|
||||
if (hasProperty) {
|
||||
if (npobj->_class->getProperty(npobj, identifier, &npv))
|
||||
@ -1424,9 +1465,10 @@ NPObjWrapper_GetProperty(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<js
|
||||
|
||||
if (!ReportExceptionIfPending(cx))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return js::BaseProxyHandler::get(cx, proxy, receiver, id, vp);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -1568,11 +1610,36 @@ CallNPMethod(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||
return CallNPMethodInternal(cx, obj, args.length(), args.array(), vp, false);
|
||||
}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_NewEnumerate(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
JS::AutoIdVector &properties, bool enumerableOnly)
|
||||
bool
|
||||
NPObjWrapperProxyHandler::getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::PropertyDescriptor> desc) const
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, obj);
|
||||
bool resolved = false;
|
||||
JS::Rooted<JSObject*> method(cx);
|
||||
if (!NPObjWrapper_Resolve(cx, proxy, id, &resolved, &method))
|
||||
return false;
|
||||
if (!resolved) {
|
||||
// No such property.
|
||||
desc.object().set(nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
// This returns a descriptor with |null| JS value if this is a plugin
|
||||
// property (as opposed to a method). That should be fine, hopefully, as the
|
||||
// previous code had very inconsistent behavior in this case as well. The main
|
||||
// reason for returning a descriptor here is to make property enumeration work
|
||||
// correctly (it will call getOwnPropertyDescriptor to check enumerability).
|
||||
JS::Rooted<JS::Value> val(cx, JS::ObjectOrNullValue(method));
|
||||
desc.initFields(proxy, val, JSPROP_ENUMERATE, nullptr, nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
NPObjWrapperProxyHandler::ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::AutoIdVector& properties) const
|
||||
{
|
||||
NPObject *npobj = GetNPObject(cx, proxy);
|
||||
if (!npobj || !npobj->_class) {
|
||||
ThrowJSExceptionASCII(cx, "Bad NPObject as private data!");
|
||||
return false;
|
||||
@ -1610,9 +1677,25 @@ NPObjWrapper_NewEnumerate(JSContext *cx, JS::Handle<JSObject*> obj,
|
||||
return true;
|
||||
}
|
||||
|
||||
// This function is very similar to a resolve hook for native objects. Instead
|
||||
// of defining properties on the object, it defines them on a resolvedProps
|
||||
// object (a plain JS object that's never exposed to script) that's stored in
|
||||
// the NPObjWrapper proxy's reserved slot. The behavior is as follows:
|
||||
//
|
||||
// - *resolvedp is set to true iff the plugin object has a property or method
|
||||
// (or both) with this id.
|
||||
//
|
||||
// - If the plugin object has a *property* with this id, the caller is
|
||||
// responsible for getting/setting its value. In this case we assign |null|
|
||||
// to resolvedProps[id] so we don't have to call hasProperty each time.
|
||||
//
|
||||
// - If the plugin object has a *method* with this id, we create a JSFunction to
|
||||
// call it and assign it to resolvedProps[id]. This function is also assigned
|
||||
// to the |method| outparam so callers can return it directly if we're doing a
|
||||
// |get|.
|
||||
static bool
|
||||
NPObjWrapper_Resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
bool *resolvedp)
|
||||
bool* resolvedp, JS::MutableHandle<JSObject*> method)
|
||||
{
|
||||
if (JSID_IS_SYMBOL(id))
|
||||
return true;
|
||||
@ -1628,6 +1711,18 @@ NPObjWrapper_Resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid>
|
||||
return false;
|
||||
}
|
||||
|
||||
JS::Rooted<JSObject*> resolvedProps(cx, NPObjWrapper_GetResolvedProps(cx, obj));
|
||||
if (!resolvedProps)
|
||||
return false;
|
||||
JS::Rooted<JS::Value> res(cx);
|
||||
if (!JS_GetPropertyById(cx, resolvedProps, id, &res))
|
||||
return false;
|
||||
if (res.isObjectOrNull()) {
|
||||
method.set(res.toObjectOrNull());
|
||||
*resolvedp = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
PluginDestructionGuard pdg(LookupNPP(npobj));
|
||||
|
||||
NPIdentifier identifier = JSIdToNPIdentifier(id);
|
||||
@ -1637,13 +1732,8 @@ NPObjWrapper_Resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid>
|
||||
return false;
|
||||
|
||||
if (hasProperty) {
|
||||
NS_ASSERTION(JSID_IS_STRING(id) || JSID_IS_INT(id),
|
||||
"id must be either string or int!\n");
|
||||
if (!::JS_DefinePropertyById(cx, obj, id, JS::UndefinedHandleValue,
|
||||
JSPROP_ENUMERATE | JSPROP_SHARED)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!JS_SetPropertyById(cx, resolvedProps, id, JS::NullHandleValue))
|
||||
return false;
|
||||
*resolvedp = true;
|
||||
|
||||
return true;
|
||||
@ -1657,31 +1747,33 @@ NPObjWrapper_Resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid>
|
||||
NS_ASSERTION(JSID_IS_STRING(id) || JSID_IS_INT(id),
|
||||
"id must be either string or int!\n");
|
||||
|
||||
JSFunction *fnc = ::JS_DefineFunctionById(cx, obj, id, CallNPMethod, 0,
|
||||
JSFunction *fnc = ::JS_DefineFunctionById(cx, resolvedProps, id, CallNPMethod, 0,
|
||||
JSPROP_ENUMERATE);
|
||||
if (!fnc)
|
||||
return false;
|
||||
|
||||
method.set(JS_GetFunctionObject(fnc));
|
||||
*resolvedp = true;
|
||||
|
||||
return fnc != nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
// no property or method
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
NPObjWrapper_Finalize(js::FreeOp *fop, JSObject *obj)
|
||||
void
|
||||
NPObjWrapperProxyHandler::finalize(JSFreeOp* fop, JSObject* proxy) const
|
||||
{
|
||||
JS::AutoAssertGCCallback inCallback;
|
||||
|
||||
NPObject *npobj = (NPObject *)::JS_GetPrivate(obj);
|
||||
NPObject *npobj = (NPObject *)js::GetProxyPrivate(proxy).toPrivate();
|
||||
if (npobj) {
|
||||
if (sNPObjWrappers) {
|
||||
// If the sNPObjWrappers map contains an entry that refers to this
|
||||
// wrapper, remove it.
|
||||
auto entry =
|
||||
static_cast<NPObjWrapperHashEntry*>(sNPObjWrappers->Search(npobj));
|
||||
if (entry && entry->mJSObj == obj) {
|
||||
if (entry && entry->mJSObj == proxy) {
|
||||
sNPObjWrappers->Remove(npobj);
|
||||
}
|
||||
}
|
||||
@ -1702,7 +1794,7 @@ NPObjWrapper_ObjectMoved(JSObject *obj, const JSObject *old)
|
||||
return;
|
||||
}
|
||||
|
||||
NPObject *npobj = (NPObject *)::JS_GetPrivate(obj);
|
||||
NPObject *npobj = (NPObject *)js::GetProxyPrivate(obj).toPrivate();
|
||||
if (!npobj) {
|
||||
return;
|
||||
}
|
||||
@ -1717,20 +1809,20 @@ NPObjWrapper_ObjectMoved(JSObject *obj, const JSObject *old)
|
||||
entry->mJSObj = obj;
|
||||
}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_Call(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||
bool
|
||||
NPObjWrapperProxyHandler::call(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
const JS::CallArgs& args) const
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
JS::Rooted<JSObject*> obj(cx, &args.callee());
|
||||
return CallNPMethodInternal(cx, obj, args.length(), args.array(), vp, false);
|
||||
return CallNPMethodInternal(cx, proxy, args.length(), args.array(),
|
||||
args.rval().address(), false);
|
||||
}
|
||||
|
||||
static bool
|
||||
NPObjWrapper_Construct(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||
bool
|
||||
NPObjWrapperProxyHandler::construct(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
const JS::CallArgs& args) const
|
||||
{
|
||||
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
|
||||
JS::Rooted<JSObject*> obj(cx, &args.callee());
|
||||
return CallNPMethodInternal(cx, obj, args.length(), args.array(), vp, true);
|
||||
return CallNPMethodInternal(cx, proxy, args.length(), args.array(),
|
||||
args.rval().address(), true);
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -1773,7 +1865,7 @@ NPObjWrapper_toPrimitive(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||
bool
|
||||
nsNPObjWrapper::IsWrapper(JSObject *obj)
|
||||
{
|
||||
return js::GetObjectClass(obj) == &sNPObjectJSWrapperClass;
|
||||
return js::GetObjectClass(obj) == &sNPObjWrapperProxyClass;
|
||||
}
|
||||
|
||||
// An NPObject is going away, make sure we null out the JS object's
|
||||
@ -1807,7 +1899,7 @@ nsNPObjWrapper::OnDestroy(NPObject *npobj)
|
||||
// Found a live NPObject wrapper, null out its JSObjects' private
|
||||
// data.
|
||||
|
||||
::JS_SetPrivate(entry->mJSObj, nullptr);
|
||||
js::SetProxyPrivate(entry->mJSObj, JS::PrivateValue(nullptr));
|
||||
|
||||
// Remove the npobj from the hash now that it went away.
|
||||
sNPObjWrappers->RawRemove(entry);
|
||||
@ -1888,7 +1980,11 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, NPObject *npobj)
|
||||
|
||||
// No existing JSObject, create one.
|
||||
|
||||
JS::Rooted<JSObject*> obj(cx, ::JS_NewObject(cx, js::Jsvalify(&sNPObjectJSWrapperClass)));
|
||||
JS::RootedValue priv(cx, JS::PrivateValue(nullptr));
|
||||
js::ProxyOptions options;
|
||||
options.setClass(&sNPObjWrapperProxyClass);
|
||||
JS::Rooted<JSObject*> obj(cx, js::NewProxyObject(cx, &NPObjWrapperProxyHandler::singleton,
|
||||
priv, nullptr, options));
|
||||
|
||||
if (generation != sNPObjWrappers->Generation()) {
|
||||
// Reload entry if the JS_NewObject call caused a GC and reallocated
|
||||
@ -1911,7 +2007,7 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, NPObject *npobj)
|
||||
|
||||
entry->mJSObj = obj;
|
||||
|
||||
::JS_SetPrivate(obj, npobj);
|
||||
js::SetProxyPrivate(obj, JS::PrivateValue(npobj));
|
||||
|
||||
// The new JSObject now holds on to npobj
|
||||
_retainobject(npobj);
|
||||
@ -1979,7 +2075,7 @@ nsJSNPRuntime::OnPluginDestroy(NPP npp)
|
||||
free(npobj);
|
||||
}
|
||||
|
||||
::JS_SetPrivate(entry->mJSObj, nullptr);
|
||||
js::SetProxyPrivate(entry->mJSObj, JS::PrivateValue(nullptr));
|
||||
|
||||
sNPObjWrappers = tmp;
|
||||
|
||||
|
@ -34,6 +34,12 @@ interface WebExtensionPolicy {
|
||||
[Constant]
|
||||
readonly attribute ByteString baseURL;
|
||||
|
||||
/**
|
||||
* The extension's user-visible name.
|
||||
*/
|
||||
[Constant]
|
||||
readonly attribute DOMString name;
|
||||
|
||||
/**
|
||||
* The content security policy string to apply to all pages loaded from the
|
||||
* extension's moz-extension: protocol.
|
||||
@ -142,6 +148,8 @@ dictionary WebExtensionInit {
|
||||
|
||||
required DOMString baseURL;
|
||||
|
||||
DOMString name = "";
|
||||
|
||||
required WebExtensionLocalizeCallback localizeCallback;
|
||||
|
||||
required MatchPatternSet allowedOrigins;
|
||||
|
@ -353,7 +353,7 @@ Window implements TouchEventHandlers;
|
||||
|
||||
Window implements OnErrorEventHandlerForWindow;
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
// https://compat.spec.whatwg.org/#windoworientation-interface
|
||||
partial interface Window {
|
||||
[NeedsCallerType]
|
||||
|
@ -306,7 +306,8 @@ LoadContextOptions(const char* aPrefName, void* /* aClosure */)
|
||||
JS::ContextOptions contextOptions;
|
||||
contextOptions.setAsmJS(GetWorkerPref<bool>(NS_LITERAL_CSTRING("asmjs")))
|
||||
.setWasm(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm")))
|
||||
.setWasmAlwaysBaseline(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_baselinejit")))
|
||||
.setWasmBaseline(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_baselinejit")))
|
||||
.setWasmIon(GetWorkerPref<bool>(NS_LITERAL_CSTRING("wasm_ionjit")))
|
||||
.setThrowOnAsmJSValidationFailure(GetWorkerPref<bool>(
|
||||
NS_LITERAL_CSTRING("throw_on_asmjs_validation_failure")))
|
||||
.setBaseline(GetWorkerPref<bool>(NS_LITERAL_CSTRING("baselinejit")))
|
||||
|
@ -104,7 +104,7 @@ skip-if = toolkit == 'android'
|
||||
[test_xhr_send.html]
|
||||
[test_xhr_send_readystate.html]
|
||||
[test_XHR_system.html]
|
||||
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(12 total, 2 failing - .mozSystem == true - got false, expected true + ) b2g-desktop(12 total, 2 failing - .mozSystem == true - got false, expected true + )
|
||||
skip-if = (buildapp == 'b2g') # b2g-debug(12 total, 2 failing - .mozSystem == true - got false, expected true + ) b2g-desktop(12 total, 2 failing - .mozSystem == true - got false, expected true + )
|
||||
[test_XHR_timeout.html]
|
||||
skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B2G, bug 960743) b2g-desktop(flaky on B2G, bug 960743)
|
||||
support-files = test_XHR_timeout.js
|
||||
|
@ -600,8 +600,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
||||
// given node.
|
||||
// SynchronizeUsingTemplate contains code used to update textnodes,
|
||||
// so make sure to modify both when changing this
|
||||
char16_t attrbuf[128];
|
||||
nsFixedString attrValue(attrbuf, ArrayLength(attrbuf), 0);
|
||||
nsAutoString attrValue;
|
||||
tmplKid->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue);
|
||||
if (!attrValue.IsEmpty()) {
|
||||
nsAutoString value;
|
||||
@ -737,11 +736,7 @@ nsXULContentBuilder::CopyAttributesToElement(nsIContent* aTemplateNode,
|
||||
|
||||
// XXXndeakin ignore namespaces until bug 321182 is fixed
|
||||
if (attribName != nsGkAtoms::id && attribName != nsGkAtoms::uri) {
|
||||
// Create a buffer here, because there's a chance that an
|
||||
// attribute in the template is going to be an RDF URI, which is
|
||||
// usually longish.
|
||||
char16_t attrbuf[128];
|
||||
nsFixedString attribValue(attrbuf, ArrayLength(attrbuf), 0);
|
||||
nsAutoString attribValue;
|
||||
aTemplateNode->GetAttr(attribNameSpaceID, attribName, attribValue);
|
||||
if (!attribValue.IsEmpty()) {
|
||||
nsAutoString value;
|
||||
@ -878,8 +873,7 @@ nsXULContentBuilder::SynchronizeUsingTemplate(nsIContent* aTemplateNode,
|
||||
// This code is similar to that in BuildContentFromTemplate
|
||||
if (tmplKid->NodeInfo()->Equals(nsGkAtoms::textnode,
|
||||
kNameSpaceID_XUL)) {
|
||||
char16_t attrbuf[128];
|
||||
nsFixedString attrValue(attrbuf, ArrayLength(attrbuf), 0);
|
||||
nsAutoString attrValue;
|
||||
tmplKid->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue);
|
||||
if (!attrValue.IsEmpty()) {
|
||||
nsAutoString value;
|
||||
|
@ -241,8 +241,7 @@ nsXULContentUtils::GetResource(int32_t aNameSpaceID, const nsAString& aAttribute
|
||||
|
||||
nsresult rv;
|
||||
|
||||
char16_t buf[256];
|
||||
nsFixedString uri(buf, ArrayLength(buf), 0);
|
||||
nsAutoStringN<256> uri;
|
||||
if (aNameSpaceID != kNameSpaceID_Unknown && aNameSpaceID != kNameSpaceID_None) {
|
||||
rv = nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, uri);
|
||||
// XXX ignore failure; treat as "no namespace"
|
||||
|
@ -647,6 +647,10 @@ RangeItem::~RangeItem()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION(RangeItem, mStartContainer, mEndContainer)
|
||||
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(RangeItem, AddRef)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(RangeItem, Release)
|
||||
|
||||
void
|
||||
RangeItem::StoreRange(nsRange* aRange)
|
||||
{
|
||||
@ -668,18 +672,4 @@ RangeItem::GetRange()
|
||||
return range.forget();
|
||||
}
|
||||
|
||||
void
|
||||
RangeItem::Unlink()
|
||||
{
|
||||
ImplCycleCollectionUnlink(mStartContainer);
|
||||
ImplCycleCollectionUnlink(mEndContainer);
|
||||
}
|
||||
|
||||
void
|
||||
RangeItem::Traverse(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
|
||||
{
|
||||
CycleCollectionNoteChild(aCallback, mStartContainer.get(), "mStartContainer", aFlags);
|
||||
CycleCollectionNoteChild(aCallback, mEndContainer.get(), "mEndContainer", aFlags);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -37,10 +37,8 @@ public:
|
||||
void StoreRange(nsRange* aRange);
|
||||
already_AddRefed<nsRange> GetRange();
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(RangeItem)
|
||||
|
||||
void Unlink();
|
||||
void Traverse(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags);
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(RangeItem)
|
||||
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(RangeItem)
|
||||
|
||||
nsCOMPtr<nsINode> mStartContainer;
|
||||
int32_t mStartOffset;
|
||||
@ -48,36 +46,6 @@ public:
|
||||
int32_t mEndOffset;
|
||||
};
|
||||
|
||||
inline void
|
||||
ImplCycleCollectionUnlink(RangeItem& aItem)
|
||||
{
|
||||
aItem.Unlink();
|
||||
}
|
||||
|
||||
inline void
|
||||
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||
RangeItem& aItem,
|
||||
const char* aName,
|
||||
uint32_t aFlags = 0)
|
||||
{
|
||||
aItem.Traverse(aCallback, aFlags);
|
||||
}
|
||||
|
||||
inline void
|
||||
ImplCycleCollectionUnlink(RefPtr<RangeItem>& aItem)
|
||||
{
|
||||
aItem->Unlink();
|
||||
}
|
||||
|
||||
inline void
|
||||
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||
RefPtr<RangeItem>& aItem,
|
||||
const char* aName,
|
||||
uint32_t aFlags = 0)
|
||||
{
|
||||
aItem->Traverse(aCallback, aFlags);
|
||||
}
|
||||
|
||||
/**
|
||||
* mozilla::SelectionState
|
||||
*
|
||||
|
@ -372,11 +372,10 @@ TextEditRules::DocumentIsEmpty()
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t childCount = rootElement->GetChildCount();
|
||||
for (uint32_t i = 0; i < childCount; i++) {
|
||||
nsINode* node = rootElement->GetChildAt(i);
|
||||
if (!EditorBase::IsTextNode(node) ||
|
||||
node->Length()) {
|
||||
for (nsIContent* child = rootElement->GetFirstChild();
|
||||
child; child = child->GetNextSibling()) {
|
||||
if (!EditorBase::IsTextNode(child) ||
|
||||
child->Length()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
1
editor/libeditor/tests/file_bug289384-1.html
Normal file
1
editor/libeditor/tests/file_bug289384-1.html
Normal file
@ -0,0 +1 @@
|
||||
<a href="file_bug289384-2.html">link</a>
|
1
editor/libeditor/tests/file_bug289384-2.html
Normal file
1
editor/libeditor/tests/file_bug289384-2.html
Normal file
@ -0,0 +1 @@
|
||||
<body contenteditable onload='opener.continueTest(window);'>foo bar</body>
|
@ -5,6 +5,8 @@ support-files =
|
||||
data/cfhtml-ie.txt
|
||||
data/cfhtml-ooo.txt
|
||||
data/cfhtml-nocontext.txt
|
||||
file_bug289384-1.html
|
||||
file_bug289384-2.html
|
||||
file_bug549262.html
|
||||
file_bug586662.html
|
||||
file_bug611182.html
|
||||
|
@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=289384
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
var win = window.open("data:text/html,<a href=\"data:text/html,<body contenteditable onload='opener.continueTest(window);'>foo bar</body>\">link</a>", "", "test-289384");
|
||||
var win = window.open("file_bug289384-1.html", "", "test-289384");
|
||||
win.addEventListener("load", function() {
|
||||
win.document.querySelector("a").click();
|
||||
}, {once: true});
|
||||
|
@ -7,3 +7,4 @@
|
||||
# nsPermissionManager::PermissionKey::CreateFromPrincipal. Because of this, it
|
||||
# is only run in e10s opt builds.
|
||||
skip-if = debug || !e10s
|
||||
[browser_permmgr_viewsrc.js]
|
||||
|
19
extensions/cookie/test/browser_permmgr_viewsrc.js
Normal file
19
extensions/cookie/test/browser_permmgr_viewsrc.js
Normal file
@ -0,0 +1,19 @@
|
||||
add_task(async function() {
|
||||
// Add a permission for example.com, start a new content process, and make
|
||||
// sure that the permission has been sent down.
|
||||
Services.perms.add(Services.io.newURI("http://example.com"),
|
||||
"viewsourceTestingPerm",
|
||||
Services.perms.ALLOW_ACTION);
|
||||
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
|
||||
"view-source:http://example.com",
|
||||
/* waitForLoad */ true,
|
||||
/* waitForStateStop */ false,
|
||||
/* forceNewProcess */ true);
|
||||
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
|
||||
is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
|
||||
"viewsourceTestingPerm"),
|
||||
Services.perms.ALLOW_ACTION);
|
||||
});
|
||||
await BrowserTestUtils.removeTab(tab);
|
||||
});
|
@ -73,16 +73,20 @@ InlineTranslator::TranslateRecording(char *aData, size_t aLen)
|
||||
int32_t eventType;
|
||||
ReadElement(reader, eventType);
|
||||
while (reader.good()) {
|
||||
UniquePtr<RecordedEvent> recordedEvent(
|
||||
RecordedEvent::LoadEvent(reader,
|
||||
static_cast<RecordedEvent::EventType>(eventType)));
|
||||
bool success = RecordedEvent::DoWithEvent(reader, static_cast<RecordedEvent::EventType>(eventType),
|
||||
[&] (RecordedEvent *recordedEvent) {
|
||||
// Make sure that the whole event was read from the stream successfully.
|
||||
if (!reader.good()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure that the whole event was read from the stream successfully.
|
||||
if (!reader.good() || !recordedEvent) {
|
||||
return false;
|
||||
}
|
||||
if (!recordedEvent->PlayEvent(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!recordedEvent->PlayEvent(this)) {
|
||||
return true;
|
||||
});
|
||||
if (!success) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -293,6 +293,11 @@ public:
|
||||
static RecordedEvent *LoadEvent(S &aStream, EventType aType);
|
||||
static RecordedEvent *LoadEventFromStream(std::istream &aStream, EventType aType);
|
||||
|
||||
// An alternative to LoadEvent that avoids a heap allocation for the event.
|
||||
// This accepts a callable `f' that will take a RecordedEvent* as a single parameter
|
||||
template<class S, class F>
|
||||
static bool DoWithEvent(S &aStream, EventType aType, F f);
|
||||
|
||||
EventType GetType() { return (EventType)mType; }
|
||||
protected:
|
||||
friend class DrawEventRecorderPrivate;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user