зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound. CLOSED TREE
This commit is contained in:
Коммит
a98eaaf23e
|
@ -1,5 +1,5 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?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>
|
<emItems>
|
||||||
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
|
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
|
||||||
<prefs/>
|
<prefs/>
|
||||||
|
@ -2436,6 +2436,10 @@
|
||||||
<prefs/>
|
<prefs/>
|
||||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||||
</emItem>
|
</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>
|
</emItems>
|
||||||
<pluginItems>
|
<pluginItems>
|
||||||
<pluginItem blockID="p332">
|
<pluginItem blockID="p332">
|
||||||
|
|
|
@ -98,7 +98,8 @@ if __name__ == '__main__':
|
||||||
runner = FirefoxRunner(profile=profile,
|
runner = FirefoxRunner(profile=profile,
|
||||||
binary=binary,
|
binary=binary,
|
||||||
cmdargs=['data:text/html,<script>Quitter.quit()</script>'],
|
cmdargs=['data:text/html,<script>Quitter.quit()</script>'],
|
||||||
env=env)
|
env=env,
|
||||||
|
process_args={'logfile': 'profile-run-1.log'})
|
||||||
runner.start()
|
runner.start()
|
||||||
ret = runner.wait()
|
ret = runner.wait()
|
||||||
if ret:
|
if ret:
|
||||||
|
@ -116,7 +117,8 @@ if __name__ == '__main__':
|
||||||
runner = FirefoxRunner(profile=profile,
|
runner = FirefoxRunner(profile=profile,
|
||||||
binary=binary,
|
binary=binary,
|
||||||
cmdargs=cmdargs,
|
cmdargs=cmdargs,
|
||||||
env=env)
|
env=env,
|
||||||
|
process_args={'logfile': 'profile-run-2.log'})
|
||||||
runner.start(debug_args=debug_args, interactive=interactive)
|
runner.start(debug_args=debug_args, interactive=interactive)
|
||||||
ret = runner.wait()
|
ret = runner.wait()
|
||||||
httpd.stop()
|
httpd.stop()
|
||||||
|
|
|
@ -1235,10 +1235,10 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
|
||||||
return res ? res : {};
|
return res ? res : {};
|
||||||
},
|
},
|
||||||
|
|
||||||
onSources: async function(request) {
|
onSources: function(request) {
|
||||||
await Promise.all(this.dbg.findSources().map(source => {
|
for (const source of this.dbg.findSources()) {
|
||||||
this.sources.createSourceActor(source);
|
this.sources.createSourceActor(source);
|
||||||
}));
|
}
|
||||||
|
|
||||||
// No need to flush the new source packets here, as we are sending the
|
// 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
|
// list of sources out immediately and we don't need to invoke the
|
||||||
|
@ -1871,19 +1871,25 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
|
||||||
* @param {SourceActor} source
|
* @param {SourceActor} source
|
||||||
*/
|
*/
|
||||||
onNewSourceEvent: function(source) {
|
onNewSourceEvent: function(source) {
|
||||||
const type = "newSource";
|
// Bug 1516197: New sources are likely detected due to either user
|
||||||
this.conn.send({
|
// interaction on the page, or devtools requests sent to the server.
|
||||||
from: this._parent.actorID,
|
// We use executeSoon because we don't want to block those operations
|
||||||
type,
|
// by sending packets in the middle of them.
|
||||||
source: source.form(),
|
DevToolsUtils.executeSoon(() => {
|
||||||
});
|
const type = "newSource";
|
||||||
|
this.conn.send({
|
||||||
|
from: this._parent.actorID,
|
||||||
|
type,
|
||||||
|
source: source.form(),
|
||||||
|
});
|
||||||
|
|
||||||
// For compatibility and debugger still using `newSource` on the thread client,
|
// For compatibility and debugger still using `newSource` on the thread client,
|
||||||
// still emit this event here. Clean up in bug 1247084
|
// still emit this event here. Clean up in bug 1247084
|
||||||
this.conn.send({
|
this.conn.send({
|
||||||
from: this.actorID,
|
from: this.actorID,
|
||||||
type,
|
type,
|
||||||
source: source.form(),
|
source: source.form(),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -31,15 +31,24 @@ function run_test() {
|
||||||
|
|
||||||
function test_simple_new_source() {
|
function test_simple_new_source() {
|
||||||
gThreadClient.addOneTimeListener("paused", function() {
|
gThreadClient.addOneTimeListener("paused", function() {
|
||||||
gThreadClient.addOneTimeListener("newSource", function(event, packet) {
|
gThreadClient.addOneTimeListener("newSource", function(event2, packet2) {
|
||||||
Assert.equal(event, "newSource");
|
// The "stopMe" eval source is emitted first.
|
||||||
Assert.equal(packet.type, "newSource");
|
Assert.equal(event2, "newSource");
|
||||||
Assert.ok(!!packet.source);
|
Assert.equal(packet2.type, "newSource");
|
||||||
Assert.ok(!!packet.source.url.match(/example\.com/));
|
Assert.ok(!!packet2.source);
|
||||||
|
Assert.ok(packet2.source.introductionType, "eval");
|
||||||
|
|
||||||
finishClient(gClient);
|
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/));
|
||||||
|
|
||||||
|
finishClient(gClient);
|
||||||
|
});
|
||||||
|
gThreadClient.eval(null, "function f() { }\n//# sourceURL=http://example.com/code.js");
|
||||||
});
|
});
|
||||||
gThreadClient.eval(null, "function f() { }\n//# sourceURL=http://example.com/code.js");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
|
@ -35,10 +35,6 @@ var ChildActor = protocol.ActorClassWithSpec(childSpec, {
|
||||||
});
|
});
|
||||||
|
|
||||||
class ChildFront extends protocol.FrontClassWithSpec(childSpec) {
|
class ChildFront extends protocol.FrontClassWithSpec(childSpec) {
|
||||||
constructor(client) {
|
|
||||||
super(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
form(v, ctx, detail) {
|
form(v, ctx, detail) {
|
||||||
this.extra = v.extra;
|
this.extra = v.extra;
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,8 +168,7 @@ class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) {
|
||||||
|
|
||||||
class AccessibilityFront extends FrontClassWithSpec(accessibilitySpec) {
|
class AccessibilityFront extends FrontClassWithSpec(accessibilitySpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client, form);
|
super(client, { actor: form.accessibilityActor });
|
||||||
this.actorID = form.accessibilityActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
|
|
||||||
this.before("init", this.init.bind(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");
|
loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
|
||||||
|
|
||||||
class ActorActorFront extends FrontClassWithSpec(actorActorSpec) {
|
class ActorActorFront extends FrontClassWithSpec(actorActorSpec) {
|
||||||
constructor(client, form) {
|
|
||||||
super(client, form);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.ActorActorFront = ActorActorFront;
|
exports.ActorActorFront = ActorActorFront;
|
||||||
|
@ -48,8 +45,7 @@ function request(uri) {
|
||||||
|
|
||||||
class ActorRegistryFront extends FrontClassWithSpec(actorRegistrySpec) {
|
class ActorRegistryFront extends FrontClassWithSpec(actorRegistrySpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client,
|
super(client, { actor: form.actorRegistryActor });
|
||||||
{ actor: form.actorRegistryActor });
|
|
||||||
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,7 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
|
||||||
|
|
||||||
class AddonsFront extends FrontClassWithSpec(addonsSpec) {
|
class AddonsFront extends FrontClassWithSpec(addonsSpec) {
|
||||||
constructor(client, {addonsActor}) {
|
constructor(client, {addonsActor}) {
|
||||||
super(client);
|
super(client, { actor: addonsActor });
|
||||||
this.actorID = addonsActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,6 @@ class AnimationPlayerFront extends FrontClassWithSpec(animationPlayerSpec) {
|
||||||
this.state = this.initialState;
|
this.state = this.initialState;
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the AnimationsActor was given a reference to the WalkerActor previously
|
* If the AnimationsActor was given a reference to the WalkerActor previously
|
||||||
* then calling this getter will return the animation target NodeFront.
|
* then calling this getter will return the animation target NodeFront.
|
||||||
|
@ -206,10 +202,6 @@ class AnimationsFront extends FrontClassWithSpec(animationsSpec) {
|
||||||
super(client, {actor: animationsActor});
|
super(client, {actor: animationsActor});
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.AnimationsFront = AnimationsFront;
|
exports.AnimationsFront = AnimationsFront;
|
||||||
|
|
|
@ -15,10 +15,6 @@ class ChangesFront extends FrontClassWithSpec(changesSpec) {
|
||||||
super(client, {actor: changesActor});
|
super(client, {actor: changesActor});
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.ChangesFront = ChangesFront;
|
exports.ChangesFront = ChangesFront;
|
||||||
|
|
|
@ -33,8 +33,7 @@ var chromeWindow;
|
||||||
*/
|
*/
|
||||||
class CSSUsageFront extends FrontClassWithSpec(cssUsageSpec) {
|
class CSSUsageFront extends FrontClassWithSpec(cssUsageSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client, form);
|
super(client, { actor: form.cssUsageActor });
|
||||||
this.actorID = form.cssUsageActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
this.before("state-change", this._onStateChange.bind(this));
|
this.before("state-change", this._onStateChange.bind(this));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,7 @@ const defer = require("devtools/shared/defer");
|
||||||
|
|
||||||
class DeviceFront extends FrontClassWithSpec(deviceSpec) {
|
class DeviceFront extends FrontClassWithSpec(deviceSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client);
|
super(client, { actor: form.deviceActor });
|
||||||
this.actorID = form.deviceActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,14 +11,9 @@ const { emulationSpec } = require("devtools/shared/specs/emulation");
|
||||||
*/
|
*/
|
||||||
class EmulationFront extends FrontClassWithSpec(emulationSpec) {
|
class EmulationFront extends FrontClassWithSpec(emulationSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client);
|
super(client, { actor: form.emulationActor });
|
||||||
this.actorID = form.emulationActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.EmulationFront = EmulationFront;
|
exports.EmulationFront = EmulationFront;
|
||||||
|
|
|
@ -10,10 +10,6 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
|
||||||
* The corresponding Front object for the FunctionCallActor.
|
* The corresponding Front object for the FunctionCallActor.
|
||||||
*/
|
*/
|
||||||
class FunctionCallFront extends FrontClassWithSpec(functionCallSpec) {
|
class FunctionCallFront extends FrontClassWithSpec(functionCallSpec) {
|
||||||
constructor(client, form) {
|
|
||||||
super(client, form);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds some generic information directly to this instance,
|
* Adds some generic information directly to this instance,
|
||||||
* to avoid extra roundtrips.
|
* to avoid extra roundtrips.
|
||||||
|
|
|
@ -56,10 +56,6 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
|
||||||
this.before("new-mutations", this.onMutations.bind(this));
|
this.before("new-mutations", this.onMutations.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the object given a form representation off the wire.
|
// Update the object given a form representation off the wire.
|
||||||
form(json) {
|
form(json) {
|
||||||
this.actorID = json.actor;
|
this.actorID = json.actor;
|
||||||
|
@ -439,9 +435,8 @@ registerFront(WalkerFront);
|
||||||
*/
|
*/
|
||||||
class InspectorFront extends FrontClassWithSpec(inspectorSpec) {
|
class InspectorFront extends FrontClassWithSpec(inspectorSpec) {
|
||||||
constructor(client, tabForm) {
|
constructor(client, tabForm) {
|
||||||
super(client, tabForm);
|
super(client, { actor: tabForm.inspectorActor });
|
||||||
|
|
||||||
this.actorID = tabForm.inspectorActor;
|
|
||||||
this._client = client;
|
this._client = client;
|
||||||
this._highlighters = new Map();
|
this._highlighters = new Map();
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,8 @@ loader.lazyRequireGetter(this, "HeapSnapshotFileUtils",
|
||||||
|
|
||||||
class MemoryFront extends FrontClassWithSpec(memorySpec) {
|
class MemoryFront extends FrontClassWithSpec(memorySpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client, form);
|
super(client, { actor: form.memoryActor });
|
||||||
this._client = client;
|
this._client = client;
|
||||||
this.actorID = form.memoryActor;
|
|
||||||
this.heapSnapshotFileActorID = null;
|
this.heapSnapshotFileActorID = null;
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,14 +26,6 @@ const HIDDEN_CLASS = "__fx-devtools-hide-shortcut__";
|
||||||
* Client side of a node list as returned by querySelectorAll()
|
* Client side of a node list as returned by querySelectorAll()
|
||||||
*/
|
*/
|
||||||
class NodeListFront extends FrontClassWithSpec(nodeListSpec) {
|
class NodeListFront extends FrontClassWithSpec(nodeListSpec) {
|
||||||
constructor(client, form) {
|
|
||||||
super(client, form);
|
|
||||||
}
|
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
marshallPool() {
|
marshallPool() {
|
||||||
return this.parent();
|
return this.parent();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,7 @@ const { perfSpec } = require("devtools/shared/specs/perf");
|
||||||
|
|
||||||
class PerfFront extends FrontClassWithSpec(perfSpec) {
|
class PerfFront extends FrontClassWithSpec(perfSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client, form);
|
super(client, { actor: form.perfActor });
|
||||||
this.actorID = form.perfActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,10 +59,6 @@ class PerformanceRecordingFront extends FrontClassWithSpec(performanceRecordingS
|
||||||
this._allocations = { sites: [], timestamps: [], frames: [], sizes: [] };
|
this._allocations = { sites: [], timestamps: [], frames: [], sizes: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the current recording to a file.
|
* Saves the current recording to a file.
|
||||||
*
|
*
|
||||||
|
|
|
@ -15,8 +15,7 @@ loader.lazyRequireGetter(this, "getSystemInfo",
|
||||||
|
|
||||||
class PerformanceFront extends FrontClassWithSpec(performanceSpec) {
|
class PerformanceFront extends FrontClassWithSpec(performanceSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client, form);
|
super(client, { actor: form.performanceActor });
|
||||||
this.actorID = form.performanceActor;
|
|
||||||
this._queuedRecordings = [];
|
this._queuedRecordings = [];
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
this._onRecordingStartedEvent = this._onRecordingStartedEvent.bind(this);
|
this._onRecordingStartedEvent = this._onRecordingStartedEvent.bind(this);
|
||||||
|
@ -31,10 +30,6 @@ class PerformanceFront extends FrontClassWithSpec(performanceSpec) {
|
||||||
await this.connect();
|
await this.connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conenct to the server, and handle once-off tasks like storing traits
|
* Conenct to the server, and handle once-off tasks like storing traits
|
||||||
* or system info.
|
* or system info.
|
||||||
|
|
|
@ -8,8 +8,7 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
|
||||||
|
|
||||||
class PreferenceFront extends FrontClassWithSpec(preferenceSpec) {
|
class PreferenceFront extends FrontClassWithSpec(preferenceSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client);
|
super(client, { actor: form.preferenceActor });
|
||||||
this.actorID = form.preferenceActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,9 @@ const { promisesSpec } = require("devtools/shared/specs/promises");
|
||||||
*/
|
*/
|
||||||
class PromisesFront extends FrontClassWithSpec(promisesSpec) {
|
class PromisesFront extends FrontClassWithSpec(promisesSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client, form);
|
super(client, { actor: form.promisesActor });
|
||||||
this.actorID = form.promisesActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.PromisesFront = PromisesFront;
|
exports.PromisesFront = PromisesFront;
|
||||||
|
|
|
@ -20,10 +20,6 @@ class ReflowFront extends FrontClassWithSpec(reflowSpec) {
|
||||||
super(client, {actor: reflowActor});
|
super(client, {actor: reflowActor});
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.ReflowFront = ReflowFront;
|
exports.ReflowFront = ReflowFront;
|
||||||
|
|
|
@ -9,8 +9,7 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
|
||||||
|
|
||||||
class ScreenshotFront extends FrontClassWithSpec(screenshotSpec) {
|
class ScreenshotFront extends FrontClassWithSpec(screenshotSpec) {
|
||||||
constructor(client, form) {
|
constructor(client, form) {
|
||||||
super(client);
|
super(client, { actor: form.screenshotActor });
|
||||||
this.actorID = form.screenshotActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,7 @@ for (const childSpec of Object.values(childSpecs)) {
|
||||||
|
|
||||||
class StorageFront extends FrontClassWithSpec(storageSpec) {
|
class StorageFront extends FrontClassWithSpec(storageSpec) {
|
||||||
constructor(client, tabForm) {
|
constructor(client, tabForm) {
|
||||||
super(client);
|
super(client, { actor: tabForm.storageActor });
|
||||||
this.actorID = tabForm.storageActor;
|
|
||||||
this.manage(this);
|
this.manage(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,6 @@ const {longStringSpec, SimpleStringFront} = require("devtools/shared/specs/strin
|
||||||
const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol");
|
const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol");
|
||||||
|
|
||||||
class LongStringFront extends FrontClassWithSpec(longStringSpec) {
|
class LongStringFront extends FrontClassWithSpec(longStringSpec) {
|
||||||
constructor(client) {
|
|
||||||
super(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.initial = null;
|
this.initial = null;
|
||||||
this.length = null;
|
this.length = null;
|
||||||
|
|
|
@ -33,10 +33,6 @@ class PageStyleFront extends FrontClassWithSpec(pageStyleSpec) {
|
||||||
this._form = form;
|
this._form = form;
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
get walker() {
|
get walker() {
|
||||||
return this.inspector.walker;
|
return this.inspector.walker;
|
||||||
}
|
}
|
||||||
|
@ -105,10 +101,6 @@ class StyleRuleFront extends FrontClassWithSpec(styleRuleSpec) {
|
||||||
this.before("location-changed", this._locationChangedPre.bind(this));
|
this.before("location-changed", this._locationChangedPre.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
|
||||||
super.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
form(form, detail) {
|
form(form, detail) {
|
||||||
if (detail === "actorid") {
|
if (detail === "actorid") {
|
||||||
this.actorID = form;
|
this.actorID = form;
|
||||||
|
|
|
@ -149,8 +149,7 @@ registerFront(StyleSheetFront);
|
||||||
*/
|
*/
|
||||||
class StyleSheetsFront extends FrontClassWithSpec(styleSheetsSpec) {
|
class StyleSheetsFront extends FrontClassWithSpec(styleSheetsSpec) {
|
||||||
constructor(client, tabForm) {
|
constructor(client, tabForm) {
|
||||||
super(client);
|
super(client, { actor: tabForm.styleSheetsActor });
|
||||||
this.actorID = tabForm.styleSheetsActor;
|
|
||||||
this.manage(this);
|
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);
|
loader.lazyRequireGetter(this, "BrowsingContextTargetFront", "devtools/shared/fronts/targets/browsing-context", true);
|
||||||
|
|
||||||
class AddonTargetFront extends FrontClassWithSpec(addonTargetSpec) {
|
class AddonTargetFront extends FrontClassWithSpec(addonTargetSpec) {
|
||||||
constructor(client) {
|
constructor(client, form) {
|
||||||
super(client);
|
super(client, form);
|
||||||
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
|
||||||
loader.lazyRequireGetter(this, "ThreadClient", "devtools/shared/client/thread-client");
|
loader.lazyRequireGetter(this, "ThreadClient", "devtools/shared/client/thread-client");
|
||||||
|
|
||||||
class WorkerTargetFront extends FrontClassWithSpec(workerTargetSpec) {
|
class WorkerTargetFront extends FrontClassWithSpec(workerTargetSpec) {
|
||||||
constructor(client) {
|
constructor(client, form) {
|
||||||
super(client);
|
super(client, form);
|
||||||
|
|
||||||
this.thread = null;
|
this.thread = null;
|
||||||
this.traits = {};
|
this.traits = {};
|
||||||
|
|
|
@ -14,9 +14,6 @@ const { FrontClassWithSpec, registerFront } = require("devtools/shared/protocol"
|
||||||
* The corresponding Front object for the ShaderActor.
|
* The corresponding Front object for the ShaderActor.
|
||||||
*/
|
*/
|
||||||
class ShaderFront extends FrontClassWithSpec(shaderSpec) {
|
class ShaderFront extends FrontClassWithSpec(shaderSpec) {
|
||||||
constructor(client, form) {
|
|
||||||
super(client, form);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.ShaderFront = ShaderFront;
|
exports.ShaderFront = ShaderFront;
|
||||||
|
@ -26,9 +23,6 @@ registerFront(ShaderFront);
|
||||||
* The corresponding Front object for the ProgramActor.
|
* The corresponding Front object for the ProgramActor.
|
||||||
*/
|
*/
|
||||||
class ProgramFront extends FrontClassWithSpec(programSpec) {
|
class ProgramFront extends FrontClassWithSpec(programSpec) {
|
||||||
constructor(client, form) {
|
|
||||||
super(client, form);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.ProgramFront = ProgramFront;
|
exports.ProgramFront = ProgramFront;
|
||||||
|
|
|
@ -333,7 +333,10 @@ types.addActorType = function(name) {
|
||||||
lazyLoadFront(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;
|
front.actorID = actorID;
|
||||||
ctx.marshallPool().manage(front);
|
ctx.marshallPool().manage(front);
|
||||||
}
|
}
|
||||||
|
@ -812,38 +815,40 @@ Response.prototype = {
|
||||||
* conn can be null if the subclass provides a conn property.
|
* conn can be null if the subclass provides a conn property.
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
var Pool = function(conn) {
|
class Pool extends EventEmitter {
|
||||||
if (conn) {
|
constructor(conn) {
|
||||||
this.conn = conn;
|
super();
|
||||||
}
|
|
||||||
};
|
if (conn) {
|
||||||
|
this.conn = conn;
|
||||||
|
}
|
||||||
|
this.__poolMap = null;
|
||||||
|
}
|
||||||
|
|
||||||
Pool.prototype = extend(EventEmitter.prototype, {
|
|
||||||
/**
|
/**
|
||||||
* Return the parent pool for this client.
|
* Return the parent pool for this client.
|
||||||
*/
|
*/
|
||||||
parent: function() {
|
parent() {
|
||||||
return this.conn.poolFor(this.actorID);
|
return this.conn.poolFor(this.actorID);
|
||||||
},
|
}
|
||||||
|
|
||||||
poolFor: function(actorID) {
|
poolFor(actorID) {
|
||||||
return this.conn.poolFor(actorID);
|
return this.conn.poolFor(actorID);
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override this if you want actors returned by this actor
|
* Override this if you want actors returned by this actor
|
||||||
* to belong to a different actor by default.
|
* to belong to a different actor by default.
|
||||||
*/
|
*/
|
||||||
marshallPool: function() {
|
marshallPool() {
|
||||||
return this;
|
return this;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pool is the base class for all actors, even leaf nodes.
|
* Pool is the base class for all actors, even leaf nodes.
|
||||||
* If the child map is actually referenced, go ahead and create
|
* If the child map is actually referenced, go ahead and create
|
||||||
* the stuff needed by the pool.
|
* the stuff needed by the pool.
|
||||||
*/
|
*/
|
||||||
__poolMap: null,
|
|
||||||
get _poolMap() {
|
get _poolMap() {
|
||||||
if (this.__poolMap) {
|
if (this.__poolMap) {
|
||||||
return this.__poolMap;
|
return this.__poolMap;
|
||||||
|
@ -851,12 +856,12 @@ Pool.prototype = extend(EventEmitter.prototype, {
|
||||||
this.__poolMap = new Map();
|
this.__poolMap = new Map();
|
||||||
this.conn.addActorPool(this);
|
this.conn.addActorPool(this);
|
||||||
return this.__poolMap;
|
return this.__poolMap;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an actor as a child of this pool.
|
* Add an actor as a child of this pool.
|
||||||
*/
|
*/
|
||||||
manage: function(actor) {
|
manage(actor) {
|
||||||
if (!actor.actorID) {
|
if (!actor.actorID) {
|
||||||
actor.actorID = this.conn.allocID(actor.actorPrefix || actor.typeName);
|
actor.actorID = this.conn.allocID(actor.actorPrefix || actor.typeName);
|
||||||
} else {
|
} else {
|
||||||
|
@ -872,44 +877,44 @@ Pool.prototype = extend(EventEmitter.prototype, {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._poolMap.set(actor.actorID, actor);
|
this._poolMap.set(actor.actorID, actor);
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove an actor as a child of this pool.
|
* Remove an actor as a child of this pool.
|
||||||
*/
|
*/
|
||||||
unmanage: function(actor) {
|
unmanage(actor) {
|
||||||
this.__poolMap && this.__poolMap.delete(actor.actorID);
|
this.__poolMap && this.__poolMap.delete(actor.actorID);
|
||||||
},
|
}
|
||||||
|
|
||||||
// true if the given actor ID exists in the pool.
|
// true if the given actor ID exists in the pool.
|
||||||
has: function(actorID) {
|
has(actorID) {
|
||||||
return this.__poolMap && this._poolMap.has(actorID);
|
return this.__poolMap && this._poolMap.has(actorID);
|
||||||
},
|
}
|
||||||
|
|
||||||
// The actor for a given actor id stored in this pool
|
// The actor for a given actor id stored in this pool
|
||||||
actor: function(actorID) {
|
actor(actorID) {
|
||||||
if (this.__poolMap) {
|
if (this.__poolMap) {
|
||||||
return this._poolMap.get(actorID);
|
return this._poolMap.get(actorID);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
}
|
||||||
|
|
||||||
// Same as actor, should update debugger connection to use 'actor'
|
// Same as actor, should update debugger connection to use 'actor'
|
||||||
// and then remove this.
|
// and then remove this.
|
||||||
get: function(actorID) {
|
get(actorID) {
|
||||||
if (this.__poolMap) {
|
if (this.__poolMap) {
|
||||||
return this._poolMap.get(actorID);
|
return this._poolMap.get(actorID);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
}
|
||||||
|
|
||||||
// True if this pool has no children.
|
// True if this pool has no children.
|
||||||
isEmpty: function() {
|
isEmpty() {
|
||||||
return !this.__poolMap || this._poolMap.size == 0;
|
return !this.__poolMap || this._poolMap.size == 0;
|
||||||
},
|
}
|
||||||
|
|
||||||
// Generator that yields each non-self child of the pool.
|
// Generator that yields each non-self child of the pool.
|
||||||
poolChildren: function* () {
|
* poolChildren() {
|
||||||
if (!this.__poolMap) {
|
if (!this.__poolMap) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -920,13 +925,13 @@ Pool.prototype = extend(EventEmitter.prototype, {
|
||||||
}
|
}
|
||||||
yield actor;
|
yield actor;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy this item, removing it from a parent if it has one,
|
* Destroy this item, removing it from a parent if it has one,
|
||||||
* and destroying all children if necessary.
|
* and destroying all children if necessary.
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy() {
|
||||||
const parent = this.parent();
|
const parent = this.parent();
|
||||||
if (parent) {
|
if (parent) {
|
||||||
parent.unmanage(this);
|
parent.unmanage(this);
|
||||||
|
@ -951,16 +956,16 @@ Pool.prototype = extend(EventEmitter.prototype, {
|
||||||
this.conn.removeActorPool(this, true);
|
this.conn.removeActorPool(this, true);
|
||||||
this.__poolMap.clear();
|
this.__poolMap.clear();
|
||||||
this.__poolMap = null;
|
this.__poolMap = null;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For getting along with the debugger server pools, should be removable
|
* For getting along with the debugger server pools, should be removable
|
||||||
* eventually.
|
* eventually.
|
||||||
*/
|
*/
|
||||||
cleanup: function() {
|
cleanup() {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
},
|
}
|
||||||
});
|
}
|
||||||
exports.Pool = Pool;
|
exports.Pool = Pool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -979,32 +984,35 @@ var actorSpecs = new WeakMap();
|
||||||
* conn can be null if the subclass provides a conn property.
|
* conn can be null if the subclass provides a conn property.
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
var Actor = function(conn) {
|
class Actor extends Pool {
|
||||||
Pool.call(this, conn);
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
this._actorSpec = actorSpecs.get(Object.getPrototypeOf(this));
|
// Will contain the actor's ID
|
||||||
// Forward events to the connection.
|
this.actorID = null;
|
||||||
if (this._actorSpec && this._actorSpec.events) {
|
|
||||||
for (const [name, request] of this._actorSpec.events.entries()) {
|
this._actorSpec = actorSpecs.get(Object.getPrototypeOf(this));
|
||||||
this.on(name, (...args) => {
|
// Forward events to the connection.
|
||||||
this._sendEvent(name, request, ...args);
|
if (this._actorSpec && this._actorSpec.events) {
|
||||||
});
|
for (const [name, request] of this._actorSpec.events.entries()) {
|
||||||
|
this.on(name, (...args) => {
|
||||||
|
this._sendEvent(name, request, ...args);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
Actor.prototype = extend(Pool.prototype, {
|
toString() {
|
||||||
// Will contain the actor's ID
|
|
||||||
actorID: null,
|
|
||||||
|
|
||||||
// Existing Actors extending this class expect initialize to contain constructor logic.
|
|
||||||
initialize: Actor,
|
|
||||||
|
|
||||||
toString: function() {
|
|
||||||
return "[Actor " + this.typeName + "/" + this.actorID + "]";
|
return "[Actor " + this.typeName + "/" + this.actorID + "]";
|
||||||
},
|
}
|
||||||
|
|
||||||
_sendEvent: function(name, request, ...args) {
|
_sendEvent(name, request, ...args) {
|
||||||
if (!this.actorID) {
|
if (!this.actorID) {
|
||||||
console.error(`Tried to send a '${name}' event on an already destroyed actor` +
|
console.error(`Tried to send a '${name}' event on an already destroyed actor` +
|
||||||
` '${this.typeName}'`);
|
` '${this.typeName}'`);
|
||||||
|
@ -1019,12 +1027,12 @@ Actor.prototype = extend(Pool.prototype, {
|
||||||
}
|
}
|
||||||
packet.from = packet.from || this.actorID;
|
packet.from = packet.from || this.actorID;
|
||||||
this.conn.send(packet);
|
this.conn.send(packet);
|
||||||
},
|
}
|
||||||
|
|
||||||
destroy: function() {
|
destroy() {
|
||||||
Pool.prototype.destroy.call(this);
|
super.destroy();
|
||||||
this.actorID = null;
|
this.actorID = null;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override this method in subclasses to serialize the actor.
|
* Override this method in subclasses to serialize the actor.
|
||||||
|
@ -1032,11 +1040,11 @@ Actor.prototype = extend(Pool.prototype, {
|
||||||
* Optional string to customize the form.
|
* Optional string to customize the form.
|
||||||
* @returns A jsonable object.
|
* @returns A jsonable object.
|
||||||
*/
|
*/
|
||||||
form: function(hint) {
|
form(hint) {
|
||||||
return { actor: this.actorID };
|
return { actor: this.actorID };
|
||||||
},
|
}
|
||||||
|
|
||||||
writeError: function(error, typeName, method) {
|
writeError(error, typeName, method) {
|
||||||
console.error(`Error while calling actor '${typeName}'s method '${method}'`,
|
console.error(`Error while calling actor '${typeName}'s method '${method}'`,
|
||||||
error.message);
|
error.message);
|
||||||
if (error.stack) {
|
if (error.stack) {
|
||||||
|
@ -1047,13 +1055,13 @@ Actor.prototype = extend(Pool.prototype, {
|
||||||
error: error.error || "unknownError",
|
error: error.error || "unknownError",
|
||||||
message: error.message,
|
message: error.message,
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
|
|
||||||
_queueResponse: function(create) {
|
_queueResponse(create) {
|
||||||
const pending = this._pendingResponse || Promise.resolve(null);
|
const pending = this._pendingResponse || Promise.resolve(null);
|
||||||
const response = create(pending);
|
const response = create(pending);
|
||||||
this._pendingResponse = response;
|
this._pendingResponse = response;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throw an error with the passed message and attach an `error` property to the Error
|
* 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.
|
* @param {String} message: The string that will be passed to the Error constructor.
|
||||||
* @throws This always throw.
|
* @throws This always throw.
|
||||||
*/
|
*/
|
||||||
throwError: function(error, message) {
|
throwError(error, message) {
|
||||||
const err = new Error(message);
|
const err = new Error(message);
|
||||||
err.error = error;
|
err.error = error;
|
||||||
throw err;
|
throw err;
|
||||||
},
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
exports.Actor = Actor;
|
exports.Actor = Actor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1281,35 +1290,34 @@ exports.ActorClassWithSpec = ActorClassWithSpec;
|
||||||
* The json form provided by the server.
|
* The json form provided by the server.
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
var Front = function(conn = null, form = null, detail = null, context = null) {
|
class Front extends Pool {
|
||||||
Pool.call(this, conn);
|
constructor(conn = null, form = null, detail = null, context = null) {
|
||||||
this._requests = [];
|
super(conn);
|
||||||
|
this.actorID = null;
|
||||||
|
this._requests = [];
|
||||||
|
|
||||||
// Front listener functions registered via `onFront` get notified
|
// Front listener functions registered via `onFront` get notified
|
||||||
// of new fronts via this dedicated EventEmitter object.
|
// of new fronts via this dedicated EventEmitter object.
|
||||||
this._frontListeners = new EventEmitter();
|
this._frontListeners = new EventEmitter();
|
||||||
|
|
||||||
// List of optional listener for each event, that is processed immediatly on packet
|
// List of optional listener for each event, that is processed immediatly on packet
|
||||||
// receival, before emitting event via EventEmitter on the Front.
|
// receival, before emitting event via EventEmitter on the Front.
|
||||||
// These listeners are register via Front.before function.
|
// These listeners are register via Front.before function.
|
||||||
// Map(Event Name[string] => Event Listener[function])
|
// Map(Event Name[string] => Event Listener[function])
|
||||||
this._beforeListeners = new Map();
|
this._beforeListeners = new Map();
|
||||||
|
|
||||||
// protocol.js no longer uses this data in the constructor, only external
|
// protocol.js no longer uses this data in the constructor, only external
|
||||||
// uses do. External usage of manually-constructed fronts will be
|
// uses do. External usage of manually-constructed fronts will be
|
||||||
// drastically reduced if we convert the root and target actors to
|
// drastically reduced if we convert the root and target actors to
|
||||||
// protocol.js, in which case this can probably go away.
|
// protocol.js, in which case this can probably go away.
|
||||||
if (form) {
|
if (form) {
|
||||||
this.actorID = form.actor;
|
this.actorID = form.actor;
|
||||||
form = types.getType(this.typeName).formType(detail).read(form, this, detail);
|
form = types.getType(this.typeName).formType(detail).read(form, this, detail);
|
||||||
this.form(form, detail, context);
|
this.form(form, detail, context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
Front.prototype = extend(Pool.prototype, {
|
destroy() {
|
||||||
actorID: null,
|
|
||||||
|
|
||||||
destroy: function() {
|
|
||||||
// Reject all outstanding requests, they won't make sense after
|
// Reject all outstanding requests, they won't make sense after
|
||||||
// the front is destroyed.
|
// the front is destroyed.
|
||||||
while (this._requests && this._requests.length > 0) {
|
while (this._requests && this._requests.length > 0) {
|
||||||
|
@ -1319,23 +1327,23 @@ Front.prototype = extend(Pool.prototype, {
|
||||||
"\n\nRequest stack:\n" + stack.formattedStack;
|
"\n\nRequest stack:\n" + stack.formattedStack;
|
||||||
deferred.reject(new Error(msg));
|
deferred.reject(new Error(msg));
|
||||||
}
|
}
|
||||||
Pool.prototype.destroy.call(this);
|
super.destroy();
|
||||||
this.clearEvents();
|
this.clearEvents();
|
||||||
this.actorID = null;
|
this.actorID = null;
|
||||||
this._frontListeners = null;
|
this._frontListeners = null;
|
||||||
this._beforeListeners = null;
|
this._beforeListeners = null;
|
||||||
},
|
}
|
||||||
|
|
||||||
manage: function(front) {
|
manage(front) {
|
||||||
if (!front.actorID) {
|
if (!front.actorID) {
|
||||||
throw new Error("Can't manage front without an actor ID.\n" +
|
throw new Error("Can't manage front without an actor ID.\n" +
|
||||||
"Ensure server supports " + front.typeName + ".");
|
"Ensure server supports " + front.typeName + ".");
|
||||||
}
|
}
|
||||||
Pool.prototype.manage.call(this, front);
|
super.manage(front);
|
||||||
|
|
||||||
// Call listeners registered via `onFront` method
|
// Call listeners registered via `onFront` method
|
||||||
this._frontListeners.emit(front.typeName, front);
|
this._frontListeners.emit(front.typeName, front);
|
||||||
},
|
}
|
||||||
|
|
||||||
// Run callback on every front of this type that currently exists, and on every
|
// Run callback on every front of this type that currently exists, and on every
|
||||||
// instantiation of front type in the future.
|
// 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
|
// Then register the callback for fronts instantiated in the future
|
||||||
this._frontListeners.on(typeName, callback);
|
this._frontListeners.on(typeName, callback);
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an event listener that will be called immediately on packer receival.
|
* 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}".`);
|
throw new Error(`Can't register multiple before listeners for "${type}".`);
|
||||||
}
|
}
|
||||||
this._beforeListeners.set(type, callback);
|
this._beforeListeners.set(type, callback);
|
||||||
},
|
}
|
||||||
|
|
||||||
toString: function() {
|
toString() {
|
||||||
return "[Front for " + this.typeName + "/" + this.actorID + "]";
|
return "[Front for " + this.typeName + "/" + this.actorID + "]";
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the actor from its representation.
|
* Update the actor from its representation.
|
||||||
* Subclasses should override this.
|
* Subclasses should override this.
|
||||||
*/
|
*/
|
||||||
form: function(form) {},
|
form(form) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a packet on the connection.
|
* Send a packet on the connection.
|
||||||
*/
|
*/
|
||||||
send: function(packet) {
|
send(packet) {
|
||||||
if (packet.to) {
|
if (packet.to) {
|
||||||
this.conn._transport.send(packet);
|
this.conn._transport.send(packet);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1391,12 +1399,12 @@ Front.prototype = extend(Pool.prototype, {
|
||||||
this.conn._transport.send(packet);
|
this.conn._transport.send(packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a two-way request on the connection.
|
* Send a two-way request on the connection.
|
||||||
*/
|
*/
|
||||||
request: function(packet) {
|
request(packet) {
|
||||||
const deferred = defer();
|
const deferred = defer();
|
||||||
// Save packet basics for debugging
|
// Save packet basics for debugging
|
||||||
const { to, type } = packet;
|
const { to, type } = packet;
|
||||||
|
@ -1408,12 +1416,12 @@ Front.prototype = extend(Pool.prototype, {
|
||||||
});
|
});
|
||||||
this.send(packet);
|
this.send(packet);
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for incoming packets from the client's actor.
|
* Handler for incoming packets from the client's actor.
|
||||||
*/
|
*/
|
||||||
onPacket: function(packet) {
|
onPacket(packet) {
|
||||||
// Pick off event packets
|
// Pick off event packets
|
||||||
const type = packet.type || undefined;
|
const type = packet.type || undefined;
|
||||||
if (this._clientSpec.events && this._clientSpec.events.has(type)) {
|
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.
|
// wait for their resolution before emitting. Otherwise, emit synchronously.
|
||||||
if (result && typeof result.then == "function") {
|
if (result && typeof result.then == "function") {
|
||||||
result.then(() => {
|
result.then(() => {
|
||||||
return EventEmitter.emit.apply(null, [this, event.name].concat(args));
|
super.emit(event.name, ...args);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EventEmitter.emit.apply(null, [this, event.name].concat(args));
|
super.emit(event.name, ...args);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1470,11 +1478,11 @@ Front.prototype = extend(Pool.prototype, {
|
||||||
deferred.resolve(packet);
|
deferred.resolve(packet);
|
||||||
}
|
}
|
||||||
}, stack, "DevTools RDP");
|
}, stack, "DevTools RDP");
|
||||||
},
|
}
|
||||||
|
|
||||||
hasRequests() {
|
hasRequests() {
|
||||||
return !!this._requests.length;
|
return !!this._requests.length;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wait for all current requests from this front to settle. This is especially useful
|
* Wait for all current requests from this front to settle. This is especially useful
|
||||||
|
@ -1486,8 +1494,8 @@ Front.prototype = extend(Pool.prototype, {
|
||||||
*/
|
*/
|
||||||
waitForRequestsToSettle() {
|
waitForRequestsToSettle() {
|
||||||
return settleAll(this._requests.map(({ deferred }) => deferred.promise));
|
return settleAll(this._requests.map(({ deferred }) => deferred.promise));
|
||||||
},
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
exports.Front = Front;
|
exports.Front = Front;
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "mozJSComponentLoader.h"
|
#include "mozJSComponentLoader.h"
|
||||||
#include "GeckoProfiler.h"
|
#include "GeckoProfiler.h"
|
||||||
|
#include "nsIException.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
@ -132,6 +133,34 @@ namespace dom {
|
||||||
aRetval.set(buffer);
|
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,
|
/* static */ void ChromeUtils::WaiveXrays(GlobalObject& aGlobal,
|
||||||
JS::HandleValue aVal,
|
JS::HandleValue aVal,
|
||||||
JS::MutableHandleValue aRetval,
|
JS::MutableHandleValue aRetval,
|
||||||
|
|
|
@ -69,6 +69,9 @@ class ChromeUtils {
|
||||||
JS::MutableHandle<JSObject*> aRetval,
|
JS::MutableHandle<JSObject*> aRetval,
|
||||||
ErrorResult& aRv);
|
ErrorResult& aRv);
|
||||||
|
|
||||||
|
static void ReleaseAssert(GlobalObject& aGlobal, bool aCondition,
|
||||||
|
const nsAString& aMessage);
|
||||||
|
|
||||||
static void OriginAttributesToSuffix(
|
static void OriginAttributesToSuffix(
|
||||||
GlobalObject& aGlobal, const dom::OriginAttributesDictionary& aAttrs,
|
GlobalObject& aGlobal, const dom::OriginAttributesDictionary& aAttrs,
|
||||||
nsCString& aSuffix);
|
nsCString& aSuffix);
|
||||||
|
|
|
@ -105,6 +105,18 @@ namespace ChromeUtils {
|
||||||
ArrayBuffer base64URLDecode(ByteString string,
|
ArrayBuffer base64URLDecode(ByteString string,
|
||||||
Base64URLDecodeOptions options);
|
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
|
#ifdef NIGHTLY_BUILD
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1239,11 +1239,9 @@ struct JSPropertySpec {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void checkAccessorsAreNative() const {
|
void checkAccessorsAreNative() const {
|
||||||
MOZ_ASSERT(accessors.getter.native.op);
|
// We may have a getter or a setter or both. And whichever ones we have
|
||||||
// We may not have a setter at all. So all we can assert here, for the
|
// should not have a SelfHostedWrapper for the accessor.
|
||||||
// native case is that if we have a jitinfo for the setter then we have
|
MOZ_ASSERT_IF(accessors.getter.native.info, accessors.getter.native.op);
|
||||||
// a setter op too. This is good enough to make sure we don't have a
|
|
||||||
// SelfHostedWrapper for the setter.
|
|
||||||
MOZ_ASSERT_IF(accessors.setter.native.info, accessors.setter.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();
|
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||||
if (!presShell ||
|
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.
|
// Things are being destroyed, or we no longer have any observers.
|
||||||
// We don't want to stop the timer when observers are initially
|
// We don't want to stop the timer when observers are initially
|
||||||
// removed, because sometimes observers can be added and removed
|
// 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 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) {
|
if (renegotiationUnsafe) {
|
||||||
state = nsIWebProgressListener::STATE_IS_BROKEN;
|
state = nsIWebProgressListener::STATE_IS_BROKEN;
|
||||||
} else {
|
} else {
|
||||||
state = nsIWebProgressListener::STATE_IS_SECURE |
|
state = nsIWebProgressListener::STATE_IS_SECURE;
|
||||||
nsIWebProgressListener::STATE_SECURE_HIGH;
|
|
||||||
SSLVersionRange defVersion;
|
SSLVersionRange defVersion;
|
||||||
rv = SSL_VersionRangeGetDefault(ssl_variant_stream, &defVersion);
|
rv = SSL_VersionRangeGetDefault(ssl_variant_stream, &defVersion);
|
||||||
if (rv == SECSuccess && versions.max >= defVersion.max) {
|
if (rv == SECSuccess && versions.max >= defVersion.max) {
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -115,13 +115,11 @@ void nsSecureBrowserUIImpl::CheckForBlockedContent() {
|
||||||
if (docShell->GetHasMixedActiveContentLoaded()) {
|
if (docShell->GetHasMixedActiveContentLoaded()) {
|
||||||
mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_ACTIVE_CONTENT;
|
mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_ACTIVE_CONTENT;
|
||||||
mState &= ~STATE_IS_SECURE;
|
mState &= ~STATE_IS_SECURE;
|
||||||
mState &= ~STATE_SECURE_HIGH;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (docShell->GetHasMixedDisplayContentLoaded()) {
|
if (docShell->GetHasMixedDisplayContentLoaded()) {
|
||||||
mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_DISPLAY_CONTENT;
|
mState |= STATE_IS_BROKEN | STATE_LOADED_MIXED_DISPLAY_CONTENT;
|
||||||
mState &= ~STATE_IS_SECURE;
|
mState &= ~STATE_IS_SECURE;
|
||||||
mState &= ~STATE_SECURE_HIGH;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (docShell->GetHasMixedActiveContentBlocked()) {
|
if (docShell->GetHasMixedActiveContentBlocked()) {
|
||||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -13,6 +13,7 @@ from firefox_ui_harness.testcases import UpdateTestCase
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_PREFS = {
|
DEFAULT_PREFS = {
|
||||||
|
'app.update.disabledForTesting': False,
|
||||||
# Bug 1355026: Re-enable when support for the new simplified UI update is available
|
# Bug 1355026: Re-enable when support for the new simplified UI update is available
|
||||||
'app.update.doorhanger': False,
|
'app.update.doorhanger': False,
|
||||||
'app.update.log': True,
|
'app.update.log': True,
|
||||||
|
|
|
@ -1675,14 +1675,16 @@ class Marionette(object):
|
||||||
|
|
||||||
:param script: A string containing the JavaScript to execute.
|
:param script: A string containing the JavaScript to execute.
|
||||||
:param script_args: An interable of arguments to pass to the script.
|
: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;
|
: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 specify a new tag, a new sandbox will be created.
|
||||||
If you use the special tag `system`, the sandbox will
|
If you use the special tag `system`, the sandbox will
|
||||||
be created using the system principal which has elevated
|
be created using the system principal which has elevated
|
||||||
privileges.
|
privileges.
|
||||||
:param new_sandbox: If False, preserve global variables from
|
:param script_timeout: Timeout in milliseconds, overriding
|
||||||
the last execute_*script call. This is True by default, in which
|
the session's default script timeout.
|
||||||
case no globals are preserved.
|
|
||||||
|
|
||||||
Simple usage example:
|
Simple usage example:
|
||||||
|
|
||||||
|
@ -1727,6 +1729,11 @@ class Marionette(object):
|
||||||
assert result == "foo"
|
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)
|
args = self._to_json(script_args)
|
||||||
stack = traceback.extract_stack()
|
stack = traceback.extract_stack()
|
||||||
frame = stack[-2:-1][0] # grab the second-to-last frame
|
frame = stack[-2:-1][0] # grab the second-to-last frame
|
||||||
|
@ -1735,10 +1742,13 @@ class Marionette(object):
|
||||||
"args": args,
|
"args": args,
|
||||||
"newSandbox": new_sandbox,
|
"newSandbox": new_sandbox,
|
||||||
"sandbox": sandbox,
|
"sandbox": sandbox,
|
||||||
"scriptTimeout": script_timeout,
|
|
||||||
"line": int(frame[1]),
|
"line": int(frame[1]),
|
||||||
"filename": filename}
|
"filename": filename}
|
||||||
rv = self._send_message("WebDriver:ExecuteScript", body, key="value")
|
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)
|
return self._from_json(rv)
|
||||||
|
|
||||||
def execute_async_script(self, script, script_args=(), new_sandbox=True,
|
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: A string containing the JavaScript to execute.
|
||||||
:param script_args: An interable of arguments to pass to the script.
|
: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
|
: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
|
you specify a new tag, a new sandbox will be created. If you
|
||||||
use the special tag `system`, the sandbox will be created
|
use the special tag `system`, the sandbox will be created
|
||||||
using the system principal which has elevated privileges.
|
using the system principal which has elevated privileges.
|
||||||
:param new_sandbox: If False, preserve global variables from
|
:param script_timeout: Timeout in milliseconds, overriding
|
||||||
the last execute_*script call. This is True by default,
|
the session's default script timeout.
|
||||||
in which case no globals are preserved.
|
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
@ -1774,6 +1786,11 @@ class Marionette(object):
|
||||||
''')
|
''')
|
||||||
assert result == 1
|
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)
|
args = self._to_json(script_args)
|
||||||
stack = traceback.extract_stack()
|
stack = traceback.extract_stack()
|
||||||
frame = stack[-2:-1][0] # grab the second-to-last frame
|
frame = stack[-2:-1][0] # grab the second-to-last frame
|
||||||
|
@ -1785,8 +1802,11 @@ class Marionette(object):
|
||||||
"scriptTimeout": script_timeout,
|
"scriptTimeout": script_timeout,
|
||||||
"line": int(frame[1]),
|
"line": int(frame[1]),
|
||||||
"filename": filename}
|
"filename": filename}
|
||||||
|
|
||||||
rv = self._send_message("WebDriver:ExecuteAsyncScript", body, key="value")
|
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)
|
return self._from_json(rv)
|
||||||
|
|
||||||
def find_element(self, method, target, id=None):
|
def find_element(self, method, target, id=None):
|
||||||
|
|
|
@ -854,9 +854,6 @@ GeckoDriver.prototype.getContext = function() {
|
||||||
* @param {Array.<(string|boolean|number|object|WebElement)>} args
|
* @param {Array.<(string|boolean|number|object|WebElement)>} args
|
||||||
* Arguments exposed to the script in <code>arguments</code>.
|
* Arguments exposed to the script in <code>arguments</code>.
|
||||||
* The array items must be serialisable to the WebDriver protocol.
|
* 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
|
* @param {string=} sandbox
|
||||||
* Name of the sandbox to evaluate the script in. The sandbox is
|
* Name of the sandbox to evaluate the script in. The sandbox is
|
||||||
* cached for later re-use on the same Window object if
|
* 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.
|
* JavaScript notion of null or undefined.
|
||||||
*
|
*
|
||||||
* @throws {ScriptTimeoutError}
|
* @throws {ScriptTimeoutError}
|
||||||
* If the script was interrupted due to reaching the
|
* If the script was interrupted due to reaching the session's
|
||||||
* <var>scriptTimeout</var> or default timeout.
|
* script timeout.
|
||||||
* @throws {JavaScriptError}
|
* @throws {JavaScriptError}
|
||||||
* If an {@link Error} was thrown whilst evaluating the script.
|
* If an {@link Error} was thrown whilst evaluating the script.
|
||||||
*/
|
*/
|
||||||
|
@ -888,7 +885,6 @@ GeckoDriver.prototype.executeScript = async function(cmd) {
|
||||||
let opts = {
|
let opts = {
|
||||||
script: cmd.parameters.script,
|
script: cmd.parameters.script,
|
||||||
args: cmd.parameters.args,
|
args: cmd.parameters.args,
|
||||||
timeout: cmd.parameters.scriptTimeout,
|
|
||||||
sandboxName: cmd.parameters.sandbox,
|
sandboxName: cmd.parameters.sandbox,
|
||||||
newSandbox: cmd.parameters.newSandbox,
|
newSandbox: cmd.parameters.newSandbox,
|
||||||
file: cmd.parameters.filename,
|
file: cmd.parameters.filename,
|
||||||
|
@ -923,9 +919,6 @@ GeckoDriver.prototype.executeScript = async function(cmd) {
|
||||||
* @param {Array.<(string|boolean|number|object|WebElement)>} args
|
* @param {Array.<(string|boolean|number|object|WebElement)>} args
|
||||||
* Arguments exposed to the script in <code>arguments</code>.
|
* Arguments exposed to the script in <code>arguments</code>.
|
||||||
* The array items must be serialisable to the WebDriver protocol.
|
* 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
|
* @param {string=} sandbox
|
||||||
* Name of the sandbox to evaluate the script in. The sandbox is
|
* Name of the sandbox to evaluate the script in. The sandbox is
|
||||||
* cached for later re-use on the same Window object if
|
* 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.
|
* JavaScript notion of null or undefined.
|
||||||
*
|
*
|
||||||
* @throws {ScriptTimeoutError}
|
* @throws {ScriptTimeoutError}
|
||||||
* If the script was interrupted due to reaching the
|
* If the script was interrupted due to reaching the session's
|
||||||
* <var>scriptTimeout</var> or default timeout.
|
* script timeout.
|
||||||
* @throws {JavaScriptError}
|
* @throws {JavaScriptError}
|
||||||
* If an Error was thrown whilst evaluating the script.
|
* If an Error was thrown whilst evaluating the script.
|
||||||
*/
|
*/
|
||||||
|
@ -957,7 +950,6 @@ GeckoDriver.prototype.executeAsyncScript = async function(cmd) {
|
||||||
let opts = {
|
let opts = {
|
||||||
script: cmd.parameters.script,
|
script: cmd.parameters.script,
|
||||||
args: cmd.parameters.args,
|
args: cmd.parameters.args,
|
||||||
timeout: cmd.parameters.scriptTimeout,
|
|
||||||
sandboxName: cmd.parameters.sandbox,
|
sandboxName: cmd.parameters.sandbox,
|
||||||
newSandbox: cmd.parameters.newSandbox,
|
newSandbox: cmd.parameters.newSandbox,
|
||||||
file: cmd.parameters.filename,
|
file: cmd.parameters.filename,
|
||||||
|
@ -972,7 +964,6 @@ GeckoDriver.prototype.execute_ = async function(
|
||||||
script,
|
script,
|
||||||
args = [],
|
args = [],
|
||||||
{
|
{
|
||||||
timeout = null,
|
|
||||||
sandboxName = null,
|
sandboxName = null,
|
||||||
newSandbox = false,
|
newSandbox = false,
|
||||||
file = "",
|
file = "",
|
||||||
|
@ -980,16 +971,11 @@ GeckoDriver.prototype.execute_ = async function(
|
||||||
async = false,
|
async = false,
|
||||||
} = {}) {
|
} = {}) {
|
||||||
|
|
||||||
if (typeof timeout == "undefined" || timeout === null) {
|
|
||||||
timeout = this.timeouts.script;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.open(this.getCurrentWindow());
|
assert.open(this.getCurrentWindow());
|
||||||
await this._handleUserPrompts();
|
await this._handleUserPrompts();
|
||||||
|
|
||||||
assert.string(script, pprint`Expected "script" to be a string: ${script}`);
|
assert.string(script, pprint`Expected "script" to be a string: ${script}`);
|
||||||
assert.array(args, pprint`Expected script args to be an array: ${args}`);
|
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) {
|
if (sandboxName !== null) {
|
||||||
assert.string(sandboxName, pprint`Expected sandbox name to be a string: ${sandboxName}`);
|
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}`);
|
assert.number(line, pprint`Expected line to be a number: ${line}`);
|
||||||
|
|
||||||
let opts = {
|
let opts = {
|
||||||
timeout,
|
timeout: this.timeouts.script,
|
||||||
sandboxName,
|
sandboxName,
|
||||||
newSandbox,
|
newSandbox,
|
||||||
file,
|
file,
|
||||||
|
@ -1023,7 +1009,6 @@ GeckoDriver.prototype.execute_ = async function(
|
||||||
|
|
||||||
case Context.Chrome:
|
case Context.Chrome:
|
||||||
let sb = this.sandboxes.get(sandboxName, newSandbox);
|
let sb = this.sandboxes.get(sandboxName, newSandbox);
|
||||||
opts.timeout = timeout;
|
|
||||||
let wargs = evaluate.fromJSON(args, this.curBrowser.seenEls, sb.window);
|
let wargs = evaluate.fromJSON(args, this.curBrowser.seenEls, sb.window);
|
||||||
res = await evaluate.sandbox(sb, script, wargs, opts);
|
res = await evaluate.sandbox(sb, script, wargs, opts);
|
||||||
els = this.curBrowser.seenEls;
|
els = this.curBrowser.seenEls;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# META: timeout=long
|
||||||
|
|
||||||
from tests.support.asserts import assert_error, assert_success
|
from tests.support.asserts import assert_error, assert_success
|
||||||
from tests.support.helpers import document_hidden, is_fullscreen
|
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
|
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):
|
def test_maximize_when_resized_to_max_size(session):
|
||||||
# Determine the largest available window size by first maximising
|
# Determine the largest available window size by first maximising
|
||||||
# the window and getting the window rect dimensions.
|
# the window and getting the window rect dimensions.
|
||||||
#
|
#
|
||||||
# Then resize the window to the maximum available size.
|
# Then resize the window to the maximum available size.
|
||||||
session.end()
|
session.end()
|
||||||
available = session.window.maximize()
|
session.window.maximize()
|
||||||
|
available = session.window.size
|
||||||
session.end()
|
session.end()
|
||||||
|
|
||||||
session.window.size = available
|
session.window.size = available
|
||||||
|
@ -94,4 +91,3 @@ def test_maximize_when_resized_to_max_size(session):
|
||||||
before = session.window.size
|
before = session.window.size
|
||||||
session.window.maximize()
|
session.window.maximize()
|
||||||
assert session.window.size == before
|
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.exe) \
|
||||||
$(call QUOTED_WILDCARD,$(topobjdir)/$(MOZ_BUILD_APP)/installer/windows/instgen/setup-stub.exe) \
|
$(call QUOTED_WILDCARD,$(topobjdir)/$(MOZ_BUILD_APP)/installer/windows/instgen/setup-stub.exe) \
|
||||||
$(call QUOTED_WILDCARD,$(topsrcdir)/toolchains.json) \
|
$(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))))
|
$(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f))))
|
||||||
|
|
||||||
ifneq ($(filter-out en-US x-test,$(AB_CD)),)
|
ifneq ($(filter-out en-US x-test,$(AB_CD)),)
|
||||||
|
|
|
@ -247,31 +247,6 @@ interface nsIWebProgressListener : nsISupports
|
||||||
*/
|
*/
|
||||||
const unsigned long STATE_CERT_DISTRUST_IMMINENT = 0x00010000;
|
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
|
* State bits for EV == Extended Validation == High Assurance
|
||||||
*
|
*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче