Merge mozilla-central to mozilla-inbound. CLOSED TREE

This commit is contained in:
Sebastian Hengst 2019-01-04 00:57:21 +02:00
Родитель 226de2d120 a8af06aea2
Коммит a98eaaf23e
49 изменённых файлов: 359 добавлений и 436 удалений

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

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<blocklist lastupdate="1545926512914" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist lastupdate="1546439268437" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
<prefs/>
@ -2436,6 +2436,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="53c5fb08-1001-471e-87ce-31185a84bcbc" id="/^((\{00cf6ee0-14f3-4e35-a4fd-d2160fe2f05e\})|(\{0da583da-e623-41f2-b2d2-0ac61b493171\})|(\{105c14a6-8b6f-49ef-b0d6-41bad99ad5e8\})|(\{10a15a74-271f-4098-a662-bd827db4f8bc\})|(\{13e02b9b-2797-4100-8144-65b73c4145c4\})|(\{1eb56568-8a30-42b1-a646-ad9f485f60fe\})|(\{1eb8a08c-82a8-4d1d-8b80-f7b5cd4751bf\})|(\{2f8220a8-b2a7-4277-ba6b-bdcb6958f669\})|(\{33f39a5d-137c-4757-9f9d-e86395c8bf20\})|(\{347ca189-9e63-43d2-8a2f-5d5141598bdc\})|(\{396056fc-1697-4954-b535-06de8d62fe1b\})|(\{3d530918-dbe8-442c-8faf-1f4ca7ca8ab9\})|(\{3e283c2e-cde3-4baa-8076-226ca8fb90ef\})|(\{591468f8-ebbd-497a-92f1-fa0a1206adb4\})|(\{5f6c3eb8-aa32-489a-bb01-b12b23d2001a\})|(\{6cbb397a-d865-42b2-8454-25a75b710dff\})|(\{7ae2bde0-f7ea-4bf3-a055-06953f9fcf31\})|(\{7b402578-ddec-4eee-9c8b-98e4e8db0059\})|(\{7fb00cf7-40d3-4415-a0c8-a48d3fbe847f\})|(\{87a8a08c-82a8-4d1d-8b80-f7b5cd4751bf\})|(\{888220a8-b2a7-4277-ba6b-bdcb6958f669\})|(\{8b1dd8f3-224b-4975-bda2-cb2dd184d4d8\})|(\{8bcdc9cc-f6be-4203-ae43-a9d281f0bcdb\})|(\{8cda9ce6-7893-4f47-ac70-a65215cec288\})|(\{8dc9b946-0bb9-4264-9c76-fd9ff1e159a2\})|(\{942e0fec-19f2-4ebc-8a74-009da7fa625d\})|(\{b2a720a8-b2a7-4277-aa6b-bdeb6958f669\})|(\{bdcf953b-d2aa-4e7a-8176-aeb1e95a0caf\})|(\{cae82615-f7be-4aff-875d-33da1bc93923\})|(\{d2aa953b-bdcf-4f7a-8476-ddb1e9500caf\})|(\{da0fa57e-17d3-40d3-99f8-e9d5b2a7759d\})|(\{da1237ca-e35d-4653-b2b5-d98043f33781\})|(\{e164563a-1512-4b81-99ff-95f2644c4075\})|(\{e2a720a8-b3a7-1277-aa2b-bdeb2958f669\})|(\{e6a90490-6ef7-407d-863a-7dd120f6f7dc\})|(\{f15cfa53-fa9b-43cf-84e8-16ece6695922\})|(\{f722c845-2d8b-4a0a-b518-4f39af703e79\})|(\{ff1c4e62-7c11-4ea7-b734-3462417ceeb5\})|(\{ffa0a57e-17d2-41d3-96f8-e8d5b2a0759d\}))$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p332">

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

@ -98,7 +98,8 @@ if __name__ == '__main__':
runner = FirefoxRunner(profile=profile,
binary=binary,
cmdargs=['data:text/html,<script>Quitter.quit()</script>'],
env=env)
env=env,
process_args={'logfile': 'profile-run-1.log'})
runner.start()
ret = runner.wait()
if ret:
@ -116,7 +117,8 @@ if __name__ == '__main__':
runner = FirefoxRunner(profile=profile,
binary=binary,
cmdargs=cmdargs,
env=env)
env=env,
process_args={'logfile': 'profile-run-2.log'})
runner.start(debug_args=debug_args, interactive=interactive)
ret = runner.wait()
httpd.stop()

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

@ -1235,10 +1235,10 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
return res ? res : {};
},
onSources: async function(request) {
await Promise.all(this.dbg.findSources().map(source => {
onSources: function(request) {
for (const source of this.dbg.findSources()) {
this.sources.createSourceActor(source);
}));
}
// No need to flush the new source packets here, as we are sending the
// list of sources out immediately and we don't need to invoke the
@ -1871,6 +1871,11 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
* @param {SourceActor} source
*/
onNewSourceEvent: function(source) {
// Bug 1516197: New sources are likely detected due to either user
// interaction on the page, or devtools requests sent to the server.
// We use executeSoon because we don't want to block those operations
// by sending packets in the middle of them.
DevToolsUtils.executeSoon(() => {
const type = "newSource";
this.conn.send({
from: this._parent.actorID,
@ -1885,6 +1890,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
type,
source: source.form(),
});
});
},
/**

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

@ -31,9 +31,17 @@ function run_test() {
function test_simple_new_source() {
gThreadClient.addOneTimeListener("paused", function() {
gThreadClient.addOneTimeListener("newSource", function(event2, packet2) {
// The "stopMe" eval source is emitted first.
Assert.equal(event2, "newSource");
Assert.equal(packet2.type, "newSource");
Assert.ok(!!packet2.source);
Assert.ok(packet2.source.introductionType, "eval");
gThreadClient.addOneTimeListener("newSource", function(event, packet) {
Assert.equal(event, "newSource");
Assert.equal(packet.type, "newSource");
dump(JSON.stringify(packet, null, 2));
Assert.ok(!!packet.source);
Assert.ok(!!packet.source.url.match(/example\.com/));
@ -41,6 +49,7 @@ function test_simple_new_source() {
});
gThreadClient.eval(null, "function f() { }\n//# sourceURL=http://example.com/code.js");
});
});
/* eslint-disable */
gDebuggee.eval("(" + function () {

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

@ -35,10 +35,6 @@ var ChildActor = protocol.ActorClassWithSpec(childSpec, {
});
class ChildFront extends protocol.FrontClassWithSpec(childSpec) {
constructor(client) {
super(client);
}
form(v, ctx, detail) {
this.extra = v.extra;
}

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

@ -168,8 +168,7 @@ class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) {
class AccessibilityFront extends FrontClassWithSpec(accessibilitySpec) {
constructor(client, form) {
super(client, form);
this.actorID = form.accessibilityActor;
super(client, { actor: form.accessibilityActor });
this.manage(this);
this.before("init", this.init.bind(this));

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

@ -11,9 +11,6 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
class ActorActorFront extends FrontClassWithSpec(actorActorSpec) {
constructor(client, form) {
super(client, form);
}
}
exports.ActorActorFront = ActorActorFront;
@ -48,8 +45,7 @@ function request(uri) {
class ActorRegistryFront extends FrontClassWithSpec(actorRegistrySpec) {
constructor(client, form) {
super(client,
{ actor: form.actorRegistryActor });
super(client, { actor: form.actorRegistryActor });
this.manage(this);
}

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

@ -8,8 +8,7 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
class AddonsFront extends FrontClassWithSpec(addonsSpec) {
constructor(client, {addonsActor}) {
super(client);
this.actorID = addonsActor;
super(client, { actor: addonsActor });
this.manage(this);
}
}

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

@ -29,10 +29,6 @@ class AnimationPlayerFront extends FrontClassWithSpec(animationPlayerSpec) {
this.state = this.initialState;
}
destroy() {
super.destroy();
}
/**
* If the AnimationsActor was given a reference to the WalkerActor previously
* then calling this getter will return the animation target NodeFront.
@ -206,10 +202,6 @@ class AnimationsFront extends FrontClassWithSpec(animationsSpec) {
super(client, {actor: animationsActor});
this.manage(this);
}
destroy() {
super.destroy();
}
}
exports.AnimationsFront = AnimationsFront;

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

@ -15,10 +15,6 @@ class ChangesFront extends FrontClassWithSpec(changesSpec) {
super(client, {actor: changesActor});
this.manage(this);
}
destroy() {
super.destroy();
}
}
exports.ChangesFront = ChangesFront;

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

@ -33,8 +33,7 @@ var chromeWindow;
*/
class CSSUsageFront extends FrontClassWithSpec(cssUsageSpec) {
constructor(client, form) {
super(client, form);
this.actorID = form.cssUsageActor;
super(client, { actor: form.cssUsageActor });
this.manage(this);
this.before("state-change", this._onStateChange.bind(this));
}

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

@ -10,8 +10,7 @@ const defer = require("devtools/shared/defer");
class DeviceFront extends FrontClassWithSpec(deviceSpec) {
constructor(client, form) {
super(client);
this.actorID = form.deviceActor;
super(client, { actor: form.deviceActor });
this.manage(this);
}

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

@ -11,14 +11,9 @@ const { emulationSpec } = require("devtools/shared/specs/emulation");
*/
class EmulationFront extends FrontClassWithSpec(emulationSpec) {
constructor(client, form) {
super(client);
this.actorID = form.emulationActor;
super(client, { actor: form.emulationActor });
this.manage(this);
}
destroy() {
super.destroy();
}
}
exports.EmulationFront = EmulationFront;

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

@ -10,10 +10,6 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
* The corresponding Front object for the FunctionCallActor.
*/
class FunctionCallFront extends FrontClassWithSpec(functionCallSpec) {
constructor(client, form) {
super(client, form);
}
/**
* Adds some generic information directly to this instance,
* to avoid extra roundtrips.

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

@ -56,10 +56,6 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
this.before("new-mutations", this.onMutations.bind(this));
}
destroy() {
super.destroy();
}
// Update the object given a form representation off the wire.
form(json) {
this.actorID = json.actor;
@ -439,9 +435,8 @@ registerFront(WalkerFront);
*/
class InspectorFront extends FrontClassWithSpec(inspectorSpec) {
constructor(client, tabForm) {
super(client, tabForm);
super(client, { actor: tabForm.inspectorActor });
this.actorID = tabForm.inspectorActor;
this._client = client;
this._highlighters = new Map();

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

@ -13,9 +13,8 @@ loader.lazyRequireGetter(this, "HeapSnapshotFileUtils",
class MemoryFront extends FrontClassWithSpec(memorySpec) {
constructor(client, form) {
super(client, form);
super(client, { actor: form.memoryActor });
this._client = client;
this.actorID = form.memoryActor;
this.heapSnapshotFileActorID = null;
this.manage(this);
}

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

@ -26,14 +26,6 @@ const HIDDEN_CLASS = "__fx-devtools-hide-shortcut__";
* Client side of a node list as returned by querySelectorAll()
*/
class NodeListFront extends FrontClassWithSpec(nodeListSpec) {
constructor(client, form) {
super(client, form);
}
destroy() {
super.destroy();
}
marshallPool() {
return this.parent();
}

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

@ -8,8 +8,7 @@ const { perfSpec } = require("devtools/shared/specs/perf");
class PerfFront extends FrontClassWithSpec(perfSpec) {
constructor(client, form) {
super(client, form);
this.actorID = form.perfActor;
super(client, { actor: form.perfActor });
this.manage(this);
}
}

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

@ -59,10 +59,6 @@ class PerformanceRecordingFront extends FrontClassWithSpec(performanceRecordingS
this._allocations = { sites: [], timestamps: [], frames: [], sizes: [] };
}
destroy() {
super.destroy();
}
/**
* Saves the current recording to a file.
*

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

@ -15,8 +15,7 @@ loader.lazyRequireGetter(this, "getSystemInfo",
class PerformanceFront extends FrontClassWithSpec(performanceSpec) {
constructor(client, form) {
super(client, form);
this.actorID = form.performanceActor;
super(client, { actor: form.performanceActor });
this._queuedRecordings = [];
this.manage(this);
this._onRecordingStartedEvent = this._onRecordingStartedEvent.bind(this);
@ -31,10 +30,6 @@ class PerformanceFront extends FrontClassWithSpec(performanceSpec) {
await this.connect();
}
destroy() {
super.destroy();
}
/**
* Conenct to the server, and handle once-off tasks like storing traits
* or system info.

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

@ -8,8 +8,7 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
class PreferenceFront extends FrontClassWithSpec(preferenceSpec) {
constructor(client, form) {
super(client);
this.actorID = form.preferenceActor;
super(client, { actor: form.preferenceActor });
this.manage(this);
}
}

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

@ -14,14 +14,9 @@ const { promisesSpec } = require("devtools/shared/specs/promises");
*/
class PromisesFront extends FrontClassWithSpec(promisesSpec) {
constructor(client, form) {
super(client, form);
this.actorID = form.promisesActor;
super(client, { actor: form.promisesActor });
this.manage(this);
}
destroy() {
super.destroy();
}
}
exports.PromisesFront = PromisesFront;

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

@ -20,10 +20,6 @@ class ReflowFront extends FrontClassWithSpec(reflowSpec) {
super(client, {actor: reflowActor});
this.manage(this);
}
destroy() {
super.destroy();
}
}
exports.ReflowFront = ReflowFront;

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

@ -9,8 +9,7 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
class ScreenshotFront extends FrontClassWithSpec(screenshotSpec) {
constructor(client, form) {
super(client);
this.actorID = form.screenshotActor;
super(client, { actor: form.screenshotActor });
this.manage(this);
}

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

@ -24,8 +24,7 @@ for (const childSpec of Object.values(childSpecs)) {
class StorageFront extends FrontClassWithSpec(storageSpec) {
constructor(client, tabForm) {
super(client);
this.actorID = tabForm.storageActor;
super(client, { actor: tabForm.storageActor });
this.manage(this);
}
}

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

@ -9,10 +9,6 @@ const {longStringSpec, SimpleStringFront} = require("devtools/shared/specs/strin
const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol");
class LongStringFront extends FrontClassWithSpec(longStringSpec) {
constructor(client) {
super(client);
}
destroy() {
this.initial = null;
this.length = null;

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

@ -33,10 +33,6 @@ class PageStyleFront extends FrontClassWithSpec(pageStyleSpec) {
this._form = form;
}
destroy() {
super.destroy();
}
get walker() {
return this.inspector.walker;
}
@ -105,10 +101,6 @@ class StyleRuleFront extends FrontClassWithSpec(styleRuleSpec) {
this.before("location-changed", this._locationChangedPre.bind(this));
}
destroy() {
super.destroy();
}
form(form, detail) {
if (detail === "actorid") {
this.actorID = form;

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

@ -149,8 +149,7 @@ registerFront(StyleSheetFront);
*/
class StyleSheetsFront extends FrontClassWithSpec(styleSheetsSpec) {
constructor(client, tabForm) {
super(client);
this.actorID = tabForm.styleSheetsActor;
super(client, { actor: tabForm.styleSheetsActor });
this.manage(this);
}
}

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

@ -8,8 +8,8 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
loader.lazyRequireGetter(this, "BrowsingContextTargetFront", "devtools/shared/fronts/targets/browsing-context", true);
class AddonTargetFront extends FrontClassWithSpec(addonTargetSpec) {
constructor(client) {
super(client);
constructor(client, form) {
super(client, form);
this.client = client;

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

@ -9,8 +9,8 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
loader.lazyRequireGetter(this, "ThreadClient", "devtools/shared/client/thread-client");
class WorkerTargetFront extends FrontClassWithSpec(workerTargetSpec) {
constructor(client) {
super(client);
constructor(client, form) {
super(client, form);
this.thread = null;
this.traits = {};

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

@ -14,9 +14,6 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
* The corresponding Front object for the ShaderActor.
*/
class ShaderFront extends FrontClassWithSpec(shaderSpec) {
constructor(client, form) {
super(client, form);
}
}
exports.ShaderFront = ShaderFront;
@ -26,9 +23,6 @@ registerFront(ShaderFront);
* The corresponding Front object for the ProgramActor.
*/
class ProgramFront extends FrontClassWithSpec(programSpec) {
constructor(client, form) {
super(client, form);
}
}
exports.ProgramFront = ProgramFront;

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

@ -333,7 +333,10 @@ types.addActorType = function(name) {
lazyLoadFront(name);
}
front = new type.frontClass(ctx.conn); // eslint-disable-line new-cap
// Use intermediate Class variable to please eslint requiring
// a capital letter for all constructors.
const Class = type.frontClass;
front = new Class(ctx.conn);
front.actorID = actorID;
ctx.marshallPool().manage(front);
}
@ -812,38 +815,40 @@ Response.prototype = {
* conn can be null if the subclass provides a conn property.
* @constructor
*/
var Pool = function(conn) {
class Pool extends EventEmitter {
constructor(conn) {
super();
if (conn) {
this.conn = conn;
}
};
this.__poolMap = null;
}
Pool.prototype = extend(EventEmitter.prototype, {
/**
* Return the parent pool for this client.
*/
parent: function() {
parent() {
return this.conn.poolFor(this.actorID);
},
}
poolFor: function(actorID) {
poolFor(actorID) {
return this.conn.poolFor(actorID);
},
}
/**
* Override this if you want actors returned by this actor
* to belong to a different actor by default.
*/
marshallPool: function() {
marshallPool() {
return this;
},
}
/**
* Pool is the base class for all actors, even leaf nodes.
* If the child map is actually referenced, go ahead and create
* the stuff needed by the pool.
*/
__poolMap: null,
get _poolMap() {
if (this.__poolMap) {
return this.__poolMap;
@ -851,12 +856,12 @@ Pool.prototype = extend(EventEmitter.prototype, {
this.__poolMap = new Map();
this.conn.addActorPool(this);
return this.__poolMap;
},
}
/**
* Add an actor as a child of this pool.
*/
manage: function(actor) {
manage(actor) {
if (!actor.actorID) {
actor.actorID = this.conn.allocID(actor.actorPrefix || actor.typeName);
} else {
@ -872,44 +877,44 @@ Pool.prototype = extend(EventEmitter.prototype, {
}
}
this._poolMap.set(actor.actorID, actor);
},
}
/**
* Remove an actor as a child of this pool.
*/
unmanage: function(actor) {
unmanage(actor) {
this.__poolMap && this.__poolMap.delete(actor.actorID);
},
}
// true if the given actor ID exists in the pool.
has: function(actorID) {
has(actorID) {
return this.__poolMap && this._poolMap.has(actorID);
},
}
// The actor for a given actor id stored in this pool
actor: function(actorID) {
actor(actorID) {
if (this.__poolMap) {
return this._poolMap.get(actorID);
}
return null;
},
}
// Same as actor, should update debugger connection to use 'actor'
// and then remove this.
get: function(actorID) {
get(actorID) {
if (this.__poolMap) {
return this._poolMap.get(actorID);
}
return null;
},
}
// True if this pool has no children.
isEmpty: function() {
isEmpty() {
return !this.__poolMap || this._poolMap.size == 0;
},
}
// Generator that yields each non-self child of the pool.
poolChildren: function* () {
* poolChildren() {
if (!this.__poolMap) {
return;
}
@ -920,13 +925,13 @@ Pool.prototype = extend(EventEmitter.prototype, {
}
yield actor;
}
},
}
/**
* Destroy this item, removing it from a parent if it has one,
* and destroying all children if necessary.
*/
destroy: function() {
destroy() {
const parent = this.parent();
if (parent) {
parent.unmanage(this);
@ -951,16 +956,16 @@ Pool.prototype = extend(EventEmitter.prototype, {
this.conn.removeActorPool(this, true);
this.__poolMap.clear();
this.__poolMap = null;
},
}
/**
* For getting along with the debugger server pools, should be removable
* eventually.
*/
cleanup: function() {
cleanup() {
this.destroy();
},
});
}
}
exports.Pool = Pool;
/**
@ -979,8 +984,18 @@ var actorSpecs = new WeakMap();
* conn can be null if the subclass provides a conn property.
* @constructor
*/
var Actor = function(conn) {
Pool.call(this, conn);
class Actor extends Pool {
// Existing Actors extending this class expect initialize to contain constructor logic.
initialize(conn) {
// Repeat Pool.constructor here as we can't call it from initialize
// This is to be removed once actors switch to es classes and are able to call
// Actor's contructor.
if (conn) {
this.conn = conn;
}
// Will contain the actor's ID
this.actorID = null;
this._actorSpec = actorSpecs.get(Object.getPrototypeOf(this));
// Forward events to the connection.
@ -991,20 +1006,13 @@ var Actor = function(conn) {
});
}
}
};
}
Actor.prototype = extend(Pool.prototype, {
// Will contain the actor's ID
actorID: null,
// Existing Actors extending this class expect initialize to contain constructor logic.
initialize: Actor,
toString: function() {
toString() {
return "[Actor " + this.typeName + "/" + this.actorID + "]";
},
}
_sendEvent: function(name, request, ...args) {
_sendEvent(name, request, ...args) {
if (!this.actorID) {
console.error(`Tried to send a '${name}' event on an already destroyed actor` +
` '${this.typeName}'`);
@ -1019,12 +1027,12 @@ Actor.prototype = extend(Pool.prototype, {
}
packet.from = packet.from || this.actorID;
this.conn.send(packet);
},
}
destroy: function() {
Pool.prototype.destroy.call(this);
destroy() {
super.destroy();
this.actorID = null;
},
}
/**
* Override this method in subclasses to serialize the actor.
@ -1032,11 +1040,11 @@ Actor.prototype = extend(Pool.prototype, {
* Optional string to customize the form.
* @returns A jsonable object.
*/
form: function(hint) {
form(hint) {
return { actor: this.actorID };
},
}
writeError: function(error, typeName, method) {
writeError(error, typeName, method) {
console.error(`Error while calling actor '${typeName}'s method '${method}'`,
error.message);
if (error.stack) {
@ -1047,13 +1055,13 @@ Actor.prototype = extend(Pool.prototype, {
error: error.error || "unknownError",
message: error.message,
});
},
}
_queueResponse: function(create) {
_queueResponse(create) {
const pending = this._pendingResponse || Promise.resolve(null);
const response = create(pending);
this._pendingResponse = response;
},
}
/**
* Throw an error with the passed message and attach an `error` property to the Error
@ -1063,12 +1071,13 @@ Actor.prototype = extend(Pool.prototype, {
* @param {String} message: The string that will be passed to the Error constructor.
* @throws This always throw.
*/
throwError: function(error, message) {
throwError(error, message) {
const err = new Error(message);
err.error = error;
throw err;
},
});
}
}
exports.Actor = Actor;
/**
@ -1281,8 +1290,10 @@ exports.ActorClassWithSpec = ActorClassWithSpec;
* The json form provided by the server.
* @constructor
*/
var Front = function(conn = null, form = null, detail = null, context = null) {
Pool.call(this, conn);
class Front extends Pool {
constructor(conn = null, form = null, detail = null, context = null) {
super(conn);
this.actorID = null;
this._requests = [];
// Front listener functions registered via `onFront` get notified
@ -1304,12 +1315,9 @@ var Front = function(conn = null, form = null, detail = null, context = null) {
form = types.getType(this.typeName).formType(detail).read(form, this, detail);
this.form(form, detail, context);
}
};
}
Front.prototype = extend(Pool.prototype, {
actorID: null,
destroy: function() {
destroy() {
// Reject all outstanding requests, they won't make sense after
// the front is destroyed.
while (this._requests && this._requests.length > 0) {
@ -1319,23 +1327,23 @@ Front.prototype = extend(Pool.prototype, {
"\n\nRequest stack:\n" + stack.formattedStack;
deferred.reject(new Error(msg));
}
Pool.prototype.destroy.call(this);
super.destroy();
this.clearEvents();
this.actorID = null;
this._frontListeners = null;
this._beforeListeners = null;
},
}
manage: function(front) {
manage(front) {
if (!front.actorID) {
throw new Error("Can't manage front without an actor ID.\n" +
"Ensure server supports " + front.typeName + ".");
}
Pool.prototype.manage.call(this, front);
super.manage(front);
// Call listeners registered via `onFront` method
this._frontListeners.emit(front.typeName, front);
},
}
// Run callback on every front of this type that currently exists, and on every
// instantiation of front type in the future.
@ -1348,7 +1356,7 @@ Front.prototype = extend(Pool.prototype, {
}
// Then register the callback for fronts instantiated in the future
this._frontListeners.on(typeName, callback);
},
}
/**
* Register an event listener that will be called immediately on packer receival.
@ -1366,22 +1374,22 @@ Front.prototype = extend(Pool.prototype, {
throw new Error(`Can't register multiple before listeners for "${type}".`);
}
this._beforeListeners.set(type, callback);
},
}
toString: function() {
toString() {
return "[Front for " + this.typeName + "/" + this.actorID + "]";
},
}
/**
* Update the actor from its representation.
* Subclasses should override this.
*/
form: function(form) {},
form(form) {}
/**
* Send a packet on the connection.
*/
send: function(packet) {
send(packet) {
if (packet.to) {
this.conn._transport.send(packet);
} else {
@ -1391,12 +1399,12 @@ Front.prototype = extend(Pool.prototype, {
this.conn._transport.send(packet);
}
}
},
}
/**
* Send a two-way request on the connection.
*/
request: function(packet) {
request(packet) {
const deferred = defer();
// Save packet basics for debugging
const { to, type } = packet;
@ -1408,12 +1416,12 @@ Front.prototype = extend(Pool.prototype, {
});
this.send(packet);
return deferred.promise;
},
}
/**
* Handler for incoming packets from the client's actor.
*/
onPacket: function(packet) {
onPacket(packet) {
// Pick off event packets
const type = packet.type || undefined;
if (this._clientSpec.events && this._clientSpec.events.has(type)) {
@ -1436,13 +1444,13 @@ Front.prototype = extend(Pool.prototype, {
// wait for their resolution before emitting. Otherwise, emit synchronously.
if (result && typeof result.then == "function") {
result.then(() => {
return EventEmitter.emit.apply(null, [this, event.name].concat(args));
super.emit(event.name, ...args);
});
return;
}
}
EventEmitter.emit.apply(null, [this, event.name].concat(args));
super.emit(event.name, ...args);
return;
}
@ -1470,11 +1478,11 @@ Front.prototype = extend(Pool.prototype, {
deferred.resolve(packet);
}
}, stack, "DevTools RDP");
},
}
hasRequests() {
return !!this._requests.length;
},
}
/**
* Wait for all current requests from this front to settle. This is especially useful
@ -1486,8 +1494,8 @@ Front.prototype = extend(Pool.prototype, {
*/
waitForRequestsToSettle() {
return settleAll(this._requests.map(({ deferred }) => deferred.promise));
},
});
}
}
exports.Front = Front;

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

@ -26,6 +26,7 @@
#include "nsThreadUtils.h"
#include "mozJSComponentLoader.h"
#include "GeckoProfiler.h"
#include "nsIException.h"
namespace mozilla {
namespace dom {
@ -132,6 +133,34 @@ namespace dom {
aRetval.set(buffer);
}
/* static */ void ChromeUtils::ReleaseAssert(GlobalObject& aGlobal,
bool aCondition,
const nsAString& aMessage) {
// If the condition didn't fail, which is the likely case, immediately return.
if (MOZ_LIKELY(aCondition)) {
return;
}
// Extract the current stack from the JS runtime to embed in the crash reason.
nsAutoString filename;
uint32_t lineNo = 0;
if (nsCOMPtr<nsIStackFrame> location = GetCurrentJSStack(1)) {
location->GetFilename(aGlobal.Context(), filename);
lineNo = location->GetLineNumber(aGlobal.Context());
} else {
filename.Assign(NS_LITERAL_STRING("<unknown>"));
}
// Convert to utf-8 for adding as the MozCrashReason.
NS_ConvertUTF16toUTF8 filenameUtf8(filename);
NS_ConvertUTF16toUTF8 messageUtf8(aMessage);
// Actually crash.
MOZ_CRASH_UNSAFE_PRINTF("Failed ChromeUtils.releaseAssert(\"%s\") @ %s:%u",
messageUtf8.get(), filenameUtf8.get(), lineNo);
}
/* static */ void ChromeUtils::WaiveXrays(GlobalObject& aGlobal,
JS::HandleValue aVal,
JS::MutableHandleValue aRetval,

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

@ -69,6 +69,9 @@ class ChromeUtils {
JS::MutableHandle<JSObject*> aRetval,
ErrorResult& aRv);
static void ReleaseAssert(GlobalObject& aGlobal, bool aCondition,
const nsAString& aMessage);
static void OriginAttributesToSuffix(
GlobalObject& aGlobal, const dom::OriginAttributesDictionary& aAttrs,
nsCString& aSuffix);

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

@ -105,6 +105,18 @@ namespace ChromeUtils {
ArrayBuffer base64URLDecode(ByteString string,
Base64URLDecodeOptions options);
/**
* Cause the current process to fatally crash unless the given condition is
* true. This is similar to MOZ_RELEASE_ASSERT in C++ code.
*
* WARNING: This message is included publicly in the crash report, and must
* not contain private information.
*
* Crash report will be augmented with the current JS stack information.
*/
void releaseAssert(boolean condition,
optional DOMString message = "<no message>");
#ifdef NIGHTLY_BUILD
/**

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

@ -1239,11 +1239,9 @@ struct JSPropertySpec {
private:
void checkAccessorsAreNative() const {
MOZ_ASSERT(accessors.getter.native.op);
// We may not have a setter at all. So all we can assert here, for the
// native case is that if we have a jitinfo for the setter then we have
// a setter op too. This is good enough to make sure we don't have a
// SelfHostedWrapper for the setter.
// We may have a getter or a setter or both. And whichever ones we have
// should not have a SelfHostedWrapper for the accessor.
MOZ_ASSERT_IF(accessors.getter.native.info, accessors.getter.native.op);
MOZ_ASSERT_IF(accessors.setter.native.info, accessors.setter.native.op);
}

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

@ -1718,7 +1718,9 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
if (!presShell ||
(!HasObservers() && !HasImageRequests() && mScrollEvents.IsEmpty())) {
(!HasObservers() && !HasImageRequests() &&
mVisualViewportResizeEvents.IsEmpty() && mScrollEvents.IsEmpty() &&
mVisualViewportScrollEvents.IsEmpty())) {
// Things are being destroyed, or we no longer have any observers.
// We don't want to stop the timer when observers are initially
// removed, because sometimes observers can be added and removed

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

@ -1171,4 +1171,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1554725440196000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1554984638318000);

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

@ -1271,8 +1271,7 @@ void HandshakeCallback(PRFileDesc* fd, void* client_data) {
if (renegotiationUnsafe) {
state = nsIWebProgressListener::STATE_IS_BROKEN;
} else {
state = nsIWebProgressListener::STATE_IS_SECURE |
nsIWebProgressListener::STATE_SECURE_HIGH;
state = nsIWebProgressListener::STATE_IS_SECURE;
SSLVersionRange defVersion;
rv = SSL_VersionRangeGetDefault(ssl_variant_stream, &defVersion);
if (rv == SECSuccess && versions.max >= defVersion.max) {

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

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

@ -115,13 +115,11 @@ void nsSecureBrowserUIImpl::CheckForBlockedContent() {
if (docShell->GetHasMixedActiveContentLoaded()) {
mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_ACTIVE_CONTENT;
mState &= ~STATE_IS_SECURE;
mState &= ~STATE_SECURE_HIGH;
}
if (docShell->GetHasMixedDisplayContentLoaded()) {
mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_DISPLAY_CONTENT;
mState &= ~STATE_IS_SECURE;
mState &= ~STATE_SECURE_HIGH;
}
if (docShell->GetHasMixedActiveContentBlocked()) {

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -13,6 +13,7 @@ from firefox_ui_harness.testcases import UpdateTestCase
DEFAULT_PREFS = {
'app.update.disabledForTesting': False,
# Bug 1355026: Re-enable when support for the new simplified UI update is available
'app.update.doorhanger': False,
'app.update.log': True,

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

@ -1675,14 +1675,16 @@ class Marionette(object):
:param script: A string containing the JavaScript to execute.
:param script_args: An interable of arguments to pass to the script.
:param new_sandbox: If False, preserve global variables from
the last execute_*script call. This is True by default, in which
case no globals are preserved.
:param sandbox: A tag referring to the sandbox you wish to use;
if you specify a new tag, a new sandbox will be created.
If you use the special tag `system`, the sandbox will
be created using the system principal which has elevated
privileges.
:param new_sandbox: If False, preserve global variables from
the last execute_*script call. This is True by default, in which
case no globals are preserved.
:param script_timeout: Timeout in milliseconds, overriding
the session's default script timeout.
Simple usage example:
@ -1727,6 +1729,11 @@ class Marionette(object):
assert result == "foo"
"""
original_timeout = None
if script_timeout is not None:
original_timeout = self.timeout.script
self.timeout.script = script_timeout / 1000
args = self._to_json(script_args)
stack = traceback.extract_stack()
frame = stack[-2:-1][0] # grab the second-to-last frame
@ -1735,10 +1742,13 @@ class Marionette(object):
"args": args,
"newSandbox": new_sandbox,
"sandbox": sandbox,
"scriptTimeout": script_timeout,
"line": int(frame[1]),
"filename": filename}
rv = self._send_message("WebDriver:ExecuteScript", body, key="value")
if script_timeout is not None:
self.timeout.script = original_timeout
return self._from_json(rv)
def execute_async_script(self, script, script_args=(), new_sandbox=True,
@ -1752,13 +1762,15 @@ class Marionette(object):
:param script: A string containing the JavaScript to execute.
:param script_args: An interable of arguments to pass to the script.
:param new_sandbox: If False, preserve global variables from
the last execute_*script call. This is True by default,
in which case no globals are preserved.
:param sandbox: A tag referring to the sandbox you wish to use; if
you specify a new tag, a new sandbox will be created. If you
use the special tag `system`, the sandbox will be created
using the system principal which has elevated privileges.
:param new_sandbox: If False, preserve global variables from
the last execute_*script call. This is True by default,
in which case no globals are preserved.
:param script_timeout: Timeout in milliseconds, overriding
the session's default script timeout.
Usage example:
@ -1774,6 +1786,11 @@ class Marionette(object):
''')
assert result == 1
"""
original_timeout = None
if script_timeout is not None:
original_timeout = self.timeout.script
self.timeout.script = script_timeout / 1000
args = self._to_json(script_args)
stack = traceback.extract_stack()
frame = stack[-2:-1][0] # grab the second-to-last frame
@ -1785,8 +1802,11 @@ class Marionette(object):
"scriptTimeout": script_timeout,
"line": int(frame[1]),
"filename": filename}
rv = self._send_message("WebDriver:ExecuteAsyncScript", body, key="value")
if script_timeout is not None:
self.timeout.script = original_timeout
return self._from_json(rv)
def find_element(self, method, target, id=None):

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

@ -854,9 +854,6 @@ GeckoDriver.prototype.getContext = function() {
* @param {Array.<(string|boolean|number|object|WebElement)>} args
* Arguments exposed to the script in <code>arguments</code>.
* The array items must be serialisable to the WebDriver protocol.
* @param {number=} scriptTimeout
* Duration in milliseconds of when to interrupt and abort the
* script evaluation.
* @param {string=} sandbox
* Name of the sandbox to evaluate the script in. The sandbox is
* cached for later re-use on the same Window object if
@ -878,8 +875,8 @@ GeckoDriver.prototype.getContext = function() {
* JavaScript notion of null or undefined.
*
* @throws {ScriptTimeoutError}
* If the script was interrupted due to reaching the
* <var>scriptTimeout</var> or default timeout.
* If the script was interrupted due to reaching the session's
* script timeout.
* @throws {JavaScriptError}
* If an {@link Error} was thrown whilst evaluating the script.
*/
@ -888,7 +885,6 @@ GeckoDriver.prototype.executeScript = async function(cmd) {
let opts = {
script: cmd.parameters.script,
args: cmd.parameters.args,
timeout: cmd.parameters.scriptTimeout,
sandboxName: cmd.parameters.sandbox,
newSandbox: cmd.parameters.newSandbox,
file: cmd.parameters.filename,
@ -923,9 +919,6 @@ GeckoDriver.prototype.executeScript = async function(cmd) {
* @param {Array.<(string|boolean|number|object|WebElement)>} args
* Arguments exposed to the script in <code>arguments</code>.
* The array items must be serialisable to the WebDriver protocol.
* @param {number} scriptTimeout
* Duration in milliseconds of when to interrupt and abort the
* script evaluation.
* @param {string=} sandbox
* Name of the sandbox to evaluate the script in. The sandbox is
* cached for later re-use on the same Window object if
@ -947,8 +940,8 @@ GeckoDriver.prototype.executeScript = async function(cmd) {
* JavaScript notion of null or undefined.
*
* @throws {ScriptTimeoutError}
* If the script was interrupted due to reaching the
* <var>scriptTimeout</var> or default timeout.
* If the script was interrupted due to reaching the session's
* script timeout.
* @throws {JavaScriptError}
* If an Error was thrown whilst evaluating the script.
*/
@ -957,7 +950,6 @@ GeckoDriver.prototype.executeAsyncScript = async function(cmd) {
let opts = {
script: cmd.parameters.script,
args: cmd.parameters.args,
timeout: cmd.parameters.scriptTimeout,
sandboxName: cmd.parameters.sandbox,
newSandbox: cmd.parameters.newSandbox,
file: cmd.parameters.filename,
@ -972,7 +964,6 @@ GeckoDriver.prototype.execute_ = async function(
script,
args = [],
{
timeout = null,
sandboxName = null,
newSandbox = false,
file = "",
@ -980,16 +971,11 @@ GeckoDriver.prototype.execute_ = async function(
async = false,
} = {}) {
if (typeof timeout == "undefined" || timeout === null) {
timeout = this.timeouts.script;
}
assert.open(this.getCurrentWindow());
await this._handleUserPrompts();
assert.string(script, pprint`Expected "script" to be a string: ${script}`);
assert.array(args, pprint`Expected script args to be an array: ${args}`);
assert.positiveInteger(timeout, pprint`Expected script timeout to be a positive integer: ${timeout}`);
if (sandboxName !== null) {
assert.string(sandboxName, pprint`Expected sandbox name to be a string: ${sandboxName}`);
}
@ -998,7 +984,7 @@ GeckoDriver.prototype.execute_ = async function(
assert.number(line, pprint`Expected line to be a number: ${line}`);
let opts = {
timeout,
timeout: this.timeouts.script,
sandboxName,
newSandbox,
file,
@ -1023,7 +1009,6 @@ GeckoDriver.prototype.execute_ = async function(
case Context.Chrome:
let sb = this.sandboxes.get(sandboxName, newSandbox);
opts.timeout = timeout;
let wargs = evaluate.fromJSON(args, this.curBrowser.seenEls, sb.window);
res = await evaluate.sandbox(sb, script, wargs, opts);
els = this.curBrowser.seenEls;

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

@ -1,3 +1,5 @@
# META: timeout=long
from tests.support.asserts import assert_error, assert_success
from tests.support.helpers import document_hidden, is_fullscreen
@ -69,19 +71,14 @@ def test_maximize_twice_is_idempotent(session):
assert session.window.size == max_size
"""
TODO(ato): Implicit session start does not use configuration passed on
from wptrunner. This causes an exception.
See https://bugzil.la/1398459.
def test_maximize_when_resized_to_max_size(session):
# Determine the largest available window size by first maximising
# the window and getting the window rect dimensions.
#
# Then resize the window to the maximum available size.
session.end()
available = session.window.maximize()
session.window.maximize()
available = session.window.size
session.end()
session.window.size = available
@ -94,4 +91,3 @@ def test_maximize_when_resized_to_max_size(session):
before = session.window.size
session.window.maximize()
assert session.window.size == before
"""

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

@ -405,6 +405,8 @@ UPLOAD_FILES= \
$(call QUOTED_WILDCARD,$(topobjdir)/$(MOZ_BUILD_APP)/installer/windows/instgen/setup.exe) \
$(call QUOTED_WILDCARD,$(topobjdir)/$(MOZ_BUILD_APP)/installer/windows/instgen/setup-stub.exe) \
$(call QUOTED_WILDCARD,$(topsrcdir)/toolchains.json) \
$(call QUOTED_WILDCARD,$(topobjdir)/profile-run-1.log) \
$(call QUOTED_WILDCARD,$(topobjdir)/profile-run-2.log) \
$(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f))))
ifneq ($(filter-out en-US x-test,$(AB_CD)),)

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

@ -247,31 +247,6 @@ interface nsIWebProgressListener : nsISupports
*/
const unsigned long STATE_CERT_DISTRUST_IMMINENT = 0x00010000;
/**
* Security Strength Flags
*
* These flags describe the security strength and accompany STATE_IS_SECURE
* in a call to the onSecurityChange method. These flags are mutually
* exclusive.
*
* These flags are not meant to provide a precise description of data
* transfer security. These are instead intended as a rough indicator that
* may be used to, for example, color code a security indicator or otherwise
* provide basic data transfer security feedback to the user.
*
* STATE_SECURE_HIGH
* This flag indicates a high degree of security.
*
* STATE_SECURE_MED
* This flag indicates a medium degree of security.
*
* STATE_SECURE_LOW
* This flag indicates a low degree of security.
*/
const unsigned long STATE_SECURE_HIGH = 0x00080000;
const unsigned long STATE_SECURE_MED = 0x00020000;
const unsigned long STATE_SECURE_LOW = 0x00040000;
/**
* State bits for EV == Extended Validation == High Assurance
*