зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1740292 - [devtools] Stop calling target front attach method. r=nchevobbe
Previous patches made attach method become a no-op, so all these callsites can be removed. Differential Revision: https://phabricator.services.mozilla.com/D130913
This commit is contained in:
Родитель
5aea7b3306
Коммит
487d9677f3
|
@ -14,7 +14,6 @@ add_task(async function() {
|
|||
|
||||
const descriptorFront = await client.mainRoot.getMainProcess();
|
||||
const front = await descriptorFront.getTarget();
|
||||
await front.attach();
|
||||
const threadFront = await front.attachThread();
|
||||
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:mozilla");
|
||||
|
|
|
@ -106,7 +106,6 @@ async function testMainProcess() {
|
|||
|
||||
const targetDescriptor = await client.mainRoot.getMainProcess();
|
||||
const target = await targetDescriptor.getTarget();
|
||||
await target.attach();
|
||||
|
||||
const threadFront = await target.attachThread();
|
||||
const { sources } = await threadFront.getSources();
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
// Test support methods on Target, such as `hasActor` and `getTrait`.
|
||||
|
||||
async function testTarget(client, target) {
|
||||
await target.attach();
|
||||
|
||||
is(
|
||||
target.hasActor("inspector"),
|
||||
true,
|
||||
|
|
|
@ -86,7 +86,6 @@ async function checkGetTabFailures(client) {
|
|||
|
||||
async function checkSelectedTargetActor(targetFront2) {
|
||||
// Send a naive request to the second target actor to check if it works
|
||||
await targetFront2.attach();
|
||||
const consoleFront = await targetFront2.getFront("console");
|
||||
const response = await consoleFront.startListeners([]);
|
||||
ok(
|
||||
|
@ -97,7 +96,6 @@ async function checkSelectedTargetActor(targetFront2) {
|
|||
|
||||
async function checkFirstTargetActor(targetFront1) {
|
||||
// then send a request to the first target actor to check if it still works
|
||||
await targetFront1.attach();
|
||||
const consoleFront = await targetFront1.getFront("console");
|
||||
const response = await consoleFront.startListeners([]);
|
||||
ok(
|
||||
|
|
|
@ -107,7 +107,6 @@ class ProcessDescriptorFront extends DescriptorMixin(
|
|||
try {
|
||||
const targetForm = await super.getTarget();
|
||||
targetFront = await this._createProcessTargetFront(targetForm);
|
||||
await targetFront.attach();
|
||||
} catch (e) {
|
||||
// This is likely to happen if we get a lot of events which drop previous
|
||||
// processes.
|
||||
|
|
|
@ -280,7 +280,6 @@ class TabDescriptorFront extends DescriptorMixin(
|
|||
try {
|
||||
const targetForm = await super.getTarget();
|
||||
newTargetFront = this._createTabTarget(targetForm);
|
||||
await newTargetFront.attach();
|
||||
this.setTarget(newTargetFront);
|
||||
} catch (e) {
|
||||
console.log(
|
||||
|
|
|
@ -145,7 +145,6 @@ class WebExtensionDescriptorFront extends DescriptorMixin(
|
|||
try {
|
||||
const targetForm = await super.getTarget();
|
||||
targetFront = this._createWebExtensionTarget(targetForm);
|
||||
await targetFront.attach();
|
||||
} catch (e) {
|
||||
console.log(
|
||||
`Request to connect to WebExtensionDescriptor "${this.id}" failed: ${e}`
|
||||
|
|
|
@ -755,9 +755,6 @@ class ResponsiveUI {
|
|||
// enterResponsiveMode whenever there is a target switch.
|
||||
this.tab.linkedBrowser.enterResponsiveMode();
|
||||
|
||||
// Attach current target to the selected browser tab.
|
||||
await this.currentTarget.attach();
|
||||
|
||||
// If the target follows the window global lifecycle, the configuration was already
|
||||
// restored from the server during target switch, so we can stop here.
|
||||
// This function is still called at startup to restore potential state from previous
|
||||
|
|
|
@ -875,7 +875,6 @@ async function createAndAttachTargetForTab(tab) {
|
|||
await commands.targetCommand.startListening();
|
||||
|
||||
const target = commands.targetCommand.targetFront;
|
||||
await target.attach();
|
||||
return target;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,13 +77,8 @@ function attachToTab() {
|
|||
// Find the active tab.
|
||||
let targetFront = tabs.find(tab => tab.selected);
|
||||
|
||||
// Attach to the tab.
|
||||
targetFront.attach().then(() => {
|
||||
// Now the targetFront is ready and can be used.
|
||||
|
||||
// Attach listeners for client events.
|
||||
targetFront.on("tabNavigated", onTab);
|
||||
});
|
||||
// Attach listeners for client events.
|
||||
targetFront.on("tabNavigated", onTab);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
@ -169,8 +164,6 @@ async function debugTab() {
|
|||
const tabs = await client.mainRoot.listTabs();
|
||||
// Find the active tab.
|
||||
let targetFront = tabs.find(tab => tab.selected);
|
||||
// Attach to the tab.
|
||||
await targetFront.attach();
|
||||
// Attach to the thread (context).
|
||||
const threadFront = await targetFront.attachThread();
|
||||
// Attach listeners for thread events.
|
||||
|
|
|
@ -811,7 +811,6 @@ async function setupTestFromUrl(url) {
|
|||
const tabs = await listTabs(devToolsClient);
|
||||
const descriptorFront = findTab(tabs, "test");
|
||||
const targetFront = await descriptorFront.getTarget();
|
||||
await targetFront.attach();
|
||||
|
||||
const threadFront = await attachThread(targetFront);
|
||||
|
||||
|
|
|
@ -158,8 +158,8 @@ exports.CommandsFactory = {
|
|||
// Hack something in order to help TargetMixinFront to distinguish the BrowserConsole
|
||||
descriptor.createdForBrowserConsole = true;
|
||||
|
||||
const target = await descriptor.getTarget();
|
||||
await target.attach();
|
||||
// Force fetching the first top level target right away.
|
||||
await descriptor.getTarget();
|
||||
|
||||
const commands = await createCommandsDictionary(descriptor);
|
||||
return commands;
|
||||
|
|
|
@ -43,10 +43,6 @@ async function checkBreakpointBeforeWatchResources() {
|
|||
tab
|
||||
);
|
||||
|
||||
// Attach the thread actor before running the debugger statement,
|
||||
// so that it is correctly catched by the thread actor.
|
||||
info("Attach the top level target");
|
||||
await targetCommand.targetFront.attach();
|
||||
// Init the Thread actor via attachAndInitThread in order to ensure
|
||||
// memoizing the thread front and avoid attaching it twice
|
||||
info("Attach the top level thread actor");
|
||||
|
@ -348,9 +344,6 @@ async function checkSetBeforeWatch() {
|
|||
tab
|
||||
);
|
||||
|
||||
// Attach the target in order to create the thread actor
|
||||
info("Attach the top level target");
|
||||
await targetCommand.targetFront.attach();
|
||||
// Instantiate the thread front in order to be able to set a breakpoint before watching for thread state
|
||||
info("Attach the top level thread actor");
|
||||
await targetCommand.targetFront.attachAndInitThread(targetCommand);
|
||||
|
|
|
@ -75,8 +75,6 @@ var _attachConsole = async function(listeners, attachToTab, attachToWorker) {
|
|||
worker = new Worker(workerName);
|
||||
await waitForMessage(worker);
|
||||
|
||||
// listWorkers only works if the browsing context target actor is attached
|
||||
await target.attach();
|
||||
const { workers } = await target.listWorkers();
|
||||
target = workers.filter(w => w.url == workerName)[0];
|
||||
if (!target) {
|
||||
|
@ -85,11 +83,13 @@ var _attachConsole = async function(listeners, attachToTab, attachToWorker) {
|
|||
);
|
||||
return null;
|
||||
}
|
||||
// This is still important to attach workers as target is still a descriptor front
|
||||
// which "becomes" a target when calling its attach method.
|
||||
await target.attach();
|
||||
}
|
||||
}
|
||||
|
||||
// Attach the Target and the target thread in order to instantiate the console client.
|
||||
await target.attach();
|
||||
await target.attachThread();
|
||||
|
||||
const webConsoleFront = await target.getFront("console");
|
||||
|
|
Загрузка…
Ссылка в новой задаче