Merge autoland to mozilla-central. a=merge

This commit is contained in:
Bogdan Tara 2018-12-23 23:49:35 +02:00
Родитель eecebbbfe5 825dbc97c0
Коммит 77d799d52e
26 изменённых файлов: 168 добавлений и 55 удалений

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

@ -99,6 +99,17 @@ jobs:
mozilla-central: [{hour: 10, minute: 0}]
# No default
- name: customv8-update
job:
type: decision-task
treeherder-symbol: customv8
target-tasks-method: customv8_update
run-on-projects:
- mozilla-central
when:
by-project:
mozilla-central: [{hour: 10, minute: 30}]
- name: bouncer-check
job:
type: decision-task

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

@ -18,7 +18,7 @@ element to which code is attached (if any), and how.
"use strict";
ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
addDebuggerToGlobal(this);
addSandboxedDebuggerToGlobal(this);
window.onload = function() {
SimpleTest.waitForExplicitFinish();

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

@ -19,7 +19,7 @@ JavaScrip appearing in an inline event handler attribute.
"use strict";
ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
addDebuggerToGlobal(this);
addSandboxedDebuggerToGlobal(this);
let dbg;
let iframeDO, doc;

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

@ -18,13 +18,16 @@ Debugger.prototype.makeGlobalObjectReference should dereference WindowProxy
"use strict";
ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
addDebuggerToGlobal(this);
addSandboxedDebuggerToGlobal(this);
window.onload = function() {
SimpleTest.waitForExplicitFinish();
// Load one of our iframes over http to force it in a different compartment
// from the current window and the other iframe.
const iframe = document.createElement("iframe");
iframe.src = "iframe1_makeGlobalObjectReference.html";
const baseURL = "http://mochi.test:8888/chrome/devtools/server/tests/mochitest/";
iframe.src = baseURL + "iframe1_makeGlobalObjectReference.html";
iframe.onload = iframeOnLoad;
document.body.appendChild(iframe);

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

@ -5,7 +5,7 @@
// Hook up the debugger statement to extract the calling script's
// introductionType and set it in a property on the parent global.
ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
addDebuggerToGlobal(this);
addSandboxedDebuggerToGlobal(this);
var dbg = new Debugger;
dbg.addDebuggee(parent);
dbg.onDebuggerStatement = function (frame) {

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

@ -26,7 +26,8 @@ Debugger.prototype.onNewPromise.
"We should have the native DOM promise implementation.");
ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal);
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal,
{freshCompartment: true});
addDebuggerToGlobal(dbgGlobal);
var dbg = new dbgGlobal.Debugger(this);

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

@ -28,7 +28,8 @@ Debugger.prototype.onPromiseResolved.
"We should have the native DOM promise implementation.");
ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal);
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal,
{freshCompartment: true});
addDebuggerToGlobal(dbgGlobal);
var dbg = new dbgGlobal.Debugger(this);

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

@ -27,7 +27,8 @@ Bug 1084065 - Test that Debugger.prototype.onPromiseResolved doesn't get dupes.
"We should have the native DOM promise implementation.");
ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal);
var dbgGlobal = new Cu.Sandbox(document.nodePrincipal,
{freshCompartment: true});
addDebuggerToGlobal(dbgGlobal);
var dbg = new dbgGlobal.Debugger(this);

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

@ -2001,9 +2001,21 @@ TransactionId WebRenderBridgeParent::FlushTransactionIdsForEpoch(
Telemetry::AccumulateCategorical(
LABELS_CONTENT_FRAME_TIME_REASON::NoVsync);
} else if (aCompositeStartId - transactionId.mVsyncId > 1) {
auto fullPaintTime =
transactionId.mSceneBuiltTime
? transactionId.mSceneBuiltTime - transactionId.mTxnStartTime
: TimeDuration::FromMilliseconds(0);
// Composite started late (and maybe took too long as well)
if (fullPaintTime >= TimeDuration::FromMilliseconds(20)) {
Telemetry::AccumulateCategorical(
LABELS_CONTENT_FRAME_TIME_REASON::MissedCompositeLong);
} else if (fullPaintTime >= TimeDuration::FromMilliseconds(10)) {
Telemetry::AccumulateCategorical(
LABELS_CONTENT_FRAME_TIME_REASON::MissedCompositeMid);
} else {
Telemetry::AccumulateCategorical(
LABELS_CONTENT_FRAME_TIME_REASON::MissedComposite);
}
} else {
// Composite start on time, but must have taken too long.
Telemetry::AccumulateCategorical(

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

@ -1 +1 @@
8476ed5e134e54f2facb01ea45e8a2008c8ba8da
8b90bdd513419a06f2755b08713238e6ee52b1e9

47
gfx/wr/Cargo.lock сгенерированный
Просмотреть файл

@ -58,11 +58,10 @@ dependencies = [
[[package]]
name = "base64"
version = "0.9.2"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -75,7 +74,7 @@ name = "bincode"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -110,7 +109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "byteorder"
version = "1.2.3"
version = "1.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -118,7 +117,7 @@ name = "bytes"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -319,7 +318,7 @@ version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"adler32 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -472,7 +471,7 @@ name = "fxhash"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -584,7 +583,7 @@ name = "image"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"gif 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"jpeg-decoder 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -640,7 +639,7 @@ name = "jpeg-decoder"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -979,7 +978,7 @@ dependencies = [
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
"half 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1162,11 +1161,6 @@ dependencies = [
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "safemem"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "scoped_threadpool"
version = "0.1.9"
@ -1285,7 +1279,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1378,7 +1372,7 @@ name = "tiff"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num-derive 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1533,10 +1527,10 @@ name = "webrender"
version = "0.57.2"
dependencies = [
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1591,7 +1585,7 @@ dependencies = [
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
"dwrote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1666,9 +1660,9 @@ name = "wrench"
version = "0.3.0"
dependencies = [
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1700,7 +1694,7 @@ name = "ws"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1765,7 +1759,7 @@ dependencies = [
"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1"
"checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9"
"checksum base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "621fc7ecb8008f86d7fb9b95356cd692ce9514b80a86d85b397f32a22da7b9e2"
"checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff"
"checksum bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bda13183df33055cbb84b847becce220d392df502ebe7a4a78d7021771ed94d0"
"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f"
@ -1773,7 +1767,7 @@ dependencies = [
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab"
"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40"
"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9"
"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
"checksum bytes 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "2f1d50c876fb7545f5f289cd8b2aee3f359d073ae819eed5d6373638e2c61e59"
"checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba"
"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18"
@ -1893,7 +1887,6 @@ dependencies = [
"checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
"checksum ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "da06feaa07f69125ab9ddc769b11de29090122170b402547f64b86fe16ebc399"
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
"checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef"

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

@ -20,7 +20,7 @@ serialize_program = ["serde"]
[dependencies]
app_units = "0.7"
base64 = { optional = true, version = "0.9" }
base64 = { optional = true, version = "0.10" }
bincode = "1.0"
bitflags = "1.0"
byteorder = "1.0"

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

@ -6,7 +6,7 @@ build = "build.rs"
license = "MPL-2.0"
[dependencies]
base64 = "0.9"
base64 = "0.10"
bincode = "1.0"
byteorder = "1.0"
env_logger = { version = "0.5", optional = true }

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

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ];
var EXPORTED_SYMBOLS = [ "addDebuggerToGlobal", "addSandboxedDebuggerToGlobal" ];
/*
* This is the js module for Debugger. Import it like so:
@ -24,6 +24,14 @@ function addDebuggerToGlobal(global) {
initPromiseDebugging(global);
}
// Defines the Debugger in a sandbox global in a separate compartment. This
// ensures the debugger and debuggee are in different compartments.
function addSandboxedDebuggerToGlobal(global) {
var sb = Cu.Sandbox(global, {freshCompartment: true});
addDebuggerToGlobal(sb);
global.Debugger = sb.Debugger;
}
function initPromiseDebugging(global) {
if (global.Debugger.Object.prototype.PromiseDebugging) {
return;

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

@ -959,6 +959,13 @@ MOZ_MUST_USE static bool EnqueuePromiseReactionJob(
if (!IsProxy(reactionObj)) {
MOZ_RELEASE_ASSERT(reactionObj->is<PromiseReactionRecord>());
reaction = &reactionObj->as<PromiseReactionRecord>();
if (cx->realm() != reaction->realm()) {
// If the compartment has multiple realms, create the job in the
// reaction's realm. This is consistent with the code in the else-branch
// and avoids problems with running jobs against a dying global (Gecko
// drops such jobs).
ar.emplace(cx, reaction);
}
} else {
JSObject* unwrappedReactionObj = UncheckedUnwrap(reactionObj);
if (JS_IsDeadWrapper(unwrappedReactionObj)) {

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

@ -0,0 +1,31 @@
// Test that jobs added to the promise job queue have a global that's consistent
// with and without same-compartment realms.
var g1 = newGlobal();
var g2 = newGlobal({sameCompartmentAs: this});
// EnqueuePromiseReactionJob, handler is a primitive.
// Job's global is the reaction's global.
function test1(g) {
var resolve;
var p = new Promise(res => { resolve = res; });
g.Promise.prototype.then.call(p, 1);
resolve();
assertEq(globalOfFirstJobInQueue(), g);
drainJobQueue();
}
test1(g1);
test1(g2);
// EnqueuePromiseReactionJob, handler is an object.
// Job's global is the handler's global.
function test2(g) {
var resolve;
var p = new Promise(res => { resolve = res; });
p.then(new g.Function());
resolve();
assertEq(globalOfFirstJobInQueue(), g);
drainJobQueue();
}
test2(g1);
test2(g2);

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

@ -1036,6 +1036,24 @@ static bool DrainJobQueue(JSContext* cx, unsigned argc, Value* vp) {
return true;
}
static bool GlobalOfFirstJobInQueue(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
if (cx->jobQueue->empty()) {
JS_ReportErrorASCII(cx, "Job queue is empty");
return false;
}
RootedObject job(cx, cx->jobQueue->front());
RootedObject global(cx, &job->nonCCWGlobal());
if (!cx->compartment()->wrap(cx, &global)) {
return false;
}
args.rval().setObject(*global);
return true;
}
static void ForwardingPromiseRejectionTrackerCallback(
JSContext* cx, JS::HandleObject promise,
JS::PromiseRejectionHandlingState state, void* data) {
@ -8617,6 +8635,11 @@ JS_FN_HELP("parseBin", BinParse, 1, 0,
"enqueueJob(fn)",
" Enqueue 'fn' on the shell's job queue."),
JS_FN_HELP("globalOfFirstJobInQueue", GlobalOfFirstJobInQueue, 0, 0,
"globalOfFirstJobInQueue()",
" Returns the global of the first item in the job queue. Throws an exception\n"
" if the queue is empty.\n"),
JS_FN_HELP("drainJobQueue", DrainJobQueue, 0, 0,
"drainJobQueue()",
"Take jobs from the shell's job queue in FIFO order and run them until the\n"

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

@ -104,7 +104,7 @@
/* static */ void js::Debugger::onPromiseSettled(
JSContext* cx, Handle<PromiseObject*> promise) {
if (MOZ_UNLIKELY(cx->realm()->isDebuggee())) {
if (MOZ_UNLIKELY(promise->realm()->isDebuggee())) {
slowPathPromiseHook(cx, Debugger::OnPromiseSettled, promise);
}
}

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

@ -2491,12 +2491,13 @@ ResumeMode Debugger::firePromiseHook(JSContext* cx, Hook hook,
JSContext* cx, Hook hook, Handle<PromiseObject*> promise) {
MOZ_ASSERT(hook == OnNewPromise || hook == OnPromiseSettled);
Maybe<AutoRealm> ar;
if (hook == OnNewPromise) {
ar.emplace(cx, promise);
if (hook == OnPromiseSettled) {
// We should be in the right compartment, but for simplicity always enter
// the promise's realm below.
cx->check(promise);
}
cx->check(promise);
AutoRealm ar(cx, promise);
RootedValue rval(cx);
ResumeMode resumeMode = dispatchHook(

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

@ -27,17 +27,23 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1042436
SimpleTest.expectConsoleMessages(function() {
// Create sandboxes in fresh compartments, because the warning state is
// stored per compartment.
var chromeSb1 = Cu.Sandbox(this, {freshCompartment: true});
chromeSb1.nonXrayableObj = nonXrayableObj;
Cu.evalInSandbox(`
nonXrayableObj.someExpandoProperty;
nonXrayableObj.someOtherExpandoProperty;
`, chromeSb1);
var chromeSb = Cu.Sandbox(this);
var chromeSb2 = Cu.Sandbox(this, {freshCompartment: true});
var contentObjWithGetter = contentSb.eval('({ get getterProp() {return 42;}, valueProp: 42 })');
is(contentObjWithGetter.wrappedJSObject.getterProp, 42, "Getter prop set up correctly");
is(contentObjWithGetter.getterProp, undefined, "Xrays work right");
is(contentObjWithGetter.valueProp, 42, "Getter prop set up correctly");
chromeSb.contentObjWithGetter = contentObjWithGetter;
chromeSb2.contentObjWithGetter = contentObjWithGetter;
Cu.evalInSandbox('contentObjWithGetter.getterProp; contentObjWithGetter.valueProp; contentObjWithGetter.getterProp;',
chromeSb, "1.7", "http://phony.example.com/file.js", 99);
chromeSb2, "1.7", "http://phony.example.com/file.js", 99);
},
[{ errorMessage: /property "someExpandoProperty" \(reason: object is not safely Xrayable/, sourceName: /test_bug1042436/, isWarning: true },
{ errorMessage: /property "getterProp" \(reason: property has accessor/, sourceName: /phony/, lineNumber: 99, isWarning: true } ],

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

@ -183,7 +183,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=533596
try {
let dbg = new Debugger();
let sandbox = new Cu.Sandbox(this, { invisibleToDebugger: false });
let sandbox = new Cu.Sandbox(this, {
invisibleToDebugger: false,
freshCompartment: true,
});
dbg.addDebuggee(sandbox);
ok(true, "debugger added visible value");
} catch(e) {

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

@ -16,7 +16,8 @@
// Instanciate `Debugger` in a sandbox as Debugger requires to be created
// in a compartment different than the debuggee.
let sandbox = Cu.Sandbox(Components.Constructor("@mozilla.org/systemprincipal;1", "nsIPrincipal")());
let sandbox = Cu.Sandbox(Components.Constructor("@mozilla.org/systemprincipal;1", "nsIPrincipal")(),
{freshCompartment: true});
Cu.evalInSandbox(
"Components.utils.import('resource://gre/modules/jsdebugger.jsm');" +
"addDebuggerToGlobal(this);",

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

@ -639,6 +639,11 @@ JSObject* TransplantObject(JSContext* cx, JS::HandleObject origobj,
return newIdentity;
}
// If we transplanted within a compartment, oldWaiver is still valid.
if (newIdentity == origobj) {
return newIdentity;
}
if (!FixWaiverAfterTransplant(cx, oldWaiver, newIdentity)) {
return nullptr;
}

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

@ -570,6 +570,12 @@ def target_tasks_searchfox(full_task_graph, parameters, graph_config):
'searchfox-win64-searchfox/debug']
@_target_task('customv8_update')
def target_tasks_customv8_update(full_task_graph, parameters, graph_config):
"""Select tasks required for building latest d8/v8 version."""
return ['toolchain-linux64-custom-v8']
@_target_task('pipfile_update')
def target_tasks_pipfile_update(full_task_graph, parameters, graph_config):
"""Select the set of tasks required to perform nightly in-tree pipfile updates

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

@ -13222,7 +13222,7 @@
"expires_in_version": "73",
"kind": "categorical",
"description": "The reason that CONTENT_FRAME_TIME recorded a slow (>200) result, if any.",
"labels": ["OnTime", "NoVsync", "MissedComposite", "SlowComposite"]
"labels": ["OnTime", "NoVsync", "MissedComposite", "SlowComposite", "MissedCompositeMid", "MissedCompositeLong"]
},
"CONTENT_LARGE_PAINT_PHASE_WEIGHT": {
"record_in_processes": ["main", "content"],

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

@ -94,7 +94,7 @@
"import_module.jsm": ["MODULE_IMPORTED", "MODULE_URI", "SUBMODULE_IMPORTED", "same_scope", "SUBMODULE_IMPORTED_TO_SCOPE"],
"import_sub_module.jsm": ["SUBMODULE_IMPORTED", "test_obj"],
"InlineSpellChecker.jsm": ["InlineSpellChecker", "SpellCheckHelper"],
"jsdebugger.jsm": ["addDebuggerToGlobal"],
"jsdebugger.jsm": ["addDebuggerToGlobal", "addSandboxedDebuggerToGlobal"],
"jsesc.js": ["jsesc"],
"json2.js": ["JSON"],
"keys.js": ["BulkKeyBundle", "SyncKeyBundle"],