Commit Graph
135 Commits
Author SHA1 Message Date
Dave Townsend 2af4d349f3 Bug 1864896: Autofix unused function arguments (devtools). r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Differential Revision: https://phabricator.services.mozilla.com/D202959
2024-03-05 14:21:15 +00:00
Alexandre Poirot a5717331be Bug 1879087 - [devtools] Avoid exception on page reload with the tracer enabled. r=devtools-reviewers,nchevobbe
For some unexplained reason, `conn` could be null.

Differential Revision: https://phabricator.services.mozilla.com/D201975
2024-02-22 08:52:20 +00:00
Nicolas Chevobbe 2711398289 Bug 1864842 - [devtools] Remove devtools/shared/defer.js . r=devtools-reviewers,ochameau.
This can now be replaced with native Promise.withResolvers,
so we can remove our custom implementation module.

Differential Revision: https://phabricator.services.mozilla.com/D198033
2024-01-10 06:30:28 +00:00
Joel Maher cac31d18e3 Bug 1859873 - batch 13 xpcshell.ini -> .toml. r=aryx,devtools-reviewers,profiler-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D194161
2023-11-21 12:32:50 +00:00
Mark Banner 0666077666 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner 91fde42f7b Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Alexandre Poirot fe2edc6770 Bug 1817729 - [devtools] Ensure computing Actor's requestTypes only once. r=jdescottes
This complex object used to be computed only once per Class,
but this regressed to be computed once per Class instance.

Differential Revision: https://phabricator.services.mozilla.com/D170412
2023-02-21 10:48:35 +00:00
Alexandre Poirot 8ae9b24f22 Bug 1816635 - [devtools] Move conn nullification to Pool. r=jdescottes
So that it isn't only done for Actors, but also for all Fronts.

Differential Revision: https://phabricator.services.mozilla.com/D169800
2023-02-14 14:47:17 +00:00
Alexandre Poirot 44e5012d2c Bug 1813648 - [devtools] Remove ActorClassWithSpec and all its dependencies. r=devtools-reviewers,jdescottes
Some actors weren't using any specification. They now have to pass a bare minimal spec object.
Unifying them to the regular Actor interface helps merging constructor with initialize
and instantiate all the actors without any code branch.

Differential Revision: https://phabricator.services.mozilla.com/D169359
2023-02-14 10:34:19 +00:00
Alexandre Poirot a6ffe0d5fb Bug 1813477 - [devtools] Convert all tests still using ActorClassWithSpec. r=devtools-reviewers,perftest-reviewers,jdescottes,sparky
Differential Revision: https://phabricator.services.mozilla.com/D169358
2023-02-14 10:34:19 +00:00
Alexandre Poirot 05088dca10 Bug 1813995 - [devtools] Nullify conn for all Actors on destruction. r=jdescottes,devtools-reviewers
A few classes weren't passing the conn object to Actor's constructor
and instead manually defining it.

Some others were having a duplicated `_conn` alias.

Differential Revision: https://phabricator.services.mozilla.com/D168351
2023-02-07 10:36:59 +00:00
Alexandre Poirot 6dae3789b4 Bug 1813475 - [devtools] Convert a first Actor to ES Class, the web console actor. r=devtools-reviewers,nchevobbe
* Note that "conn" attribute is now managed by Actor.

* We might want to finally remove "requestTypes".
This isn't used by the frontend... may be third party use it?
This allows to list all available RDP methods of all actors.

* All actors now have to be instantiated via "new ".

Differential Revision: https://phabricator.services.mozilla.com/D168254
2023-01-30 19:36:06 +00:00
Alexandre Poirot bde84f5b65 Bug 1793604 - [devtools] Convert Loader.jsm to ESM. r=perftest-reviewers,geckoview-reviewers,preferences-reviewers,owlish,kshampur,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158582
2022-10-14 12:19:42 +00:00
Alexandre Poirot 07e6ce0083 Bug 1792848 - [devtools] Use absolute URLs to import modules in devtools/shared. r=Honza,devtools-backward-compat-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D158643
2022-10-12 15:56:22 +00:00
Alexandre Poirot 0c4e317914 Bug 1789980 - [devtools] Migrate all callsites using require("chrome") to use Components.* global symbols. r=jdescottes,perftest-reviewers,AlexandruIonescu
This will help transition to ES Modules as we won't be able to expose a magic "chrome" ESM.
Also, most of these symbols are exposed as global already.
All but:
* `components` which is `Components`,
* `CC` which is `Components.Constructor`,
* `Cm` which is `Components.manager`.

$ sed -ie "/require(.chrome.)/d" $(git grep -l 'require("chrome")' devtools/)
+ manual edits for all three exceptions

Differential Revision: https://phabricator.services.mozilla.com/D156936
2022-09-20 12:52:27 +00:00
Alexandre Poirot 86c7a14e62 Bug 1789202 - [devtools] Expose ChromeUtils as a global to all DevTools modules. r=perftest-reviewers,nchevobbe,AlexandruIonescu
This will help transition to ES Modules as this symbol is exposed to them.

$ sed -ie "/require(.ChromeUtils.)/d" $(git grep -l 'require("ChromeUtils")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .ChromeUtils./d" $(git grep -l 'loader.lazyRequireGetter(this, "ChromeUtils"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js + manual eslint fixes

Differential Revision: https://phabricator.services.mozilla.com/D156402
2022-09-09 07:22:51 +00:00
Alexandre Poirot 0f32f335e3 Bug 1789201 - [devtools] Expose Services as a global to all DevTools modules. r=perftest-reviewers,nchevobbe,julienw,AlexandruIonescu
This will help transition to ES Modules as this symbol is exposed to them.

$ sed -ie "/require(.Services.)/d" $(git grep -l 'require("Services")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .Services./d" $(git grep -l 'loader.lazyRequireGetter(this, "Services"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js
+ manual eslint fixes
+ removal of devtools-services in the debugger, except for jest tests

Differential Revision: https://phabricator.services.mozilla.com/D156401
2022-09-09 07:22:51 +00:00
Mark Banner 3387a89bc7 Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for devtools. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D155167
2022-08-26 13:39:34 +00:00
Alexandre Poirot 41e7308220 Bug 1783670 - [devtools] Avoid performance regression of Front.watchFronts API. r=nchevobbe
The Front.watchFronts API is sparsly used whereas we always instantiate
two EventEmitter and emit two events for all the Fronts.
We can avoid doing that unless we start using this API only on a couple of fronts.

Differential Revision: https://phabricator.services.mozilla.com/D153957
2022-08-09 11:38:15 +00:00
Mark Banner 6d03c63e2d Bug 1330099 - Enable object-shorthand eslint rule. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D153567
2022-08-03 14:57:05 +00:00
Julian Descottes b235c423a0 Bug 1778432 - [devtools] Guard against missing Services.profiler in Actor:_sendEvent r=nchevobbe
The Services object is replaced by a mock in the worker loader so Services.profiler might be undefined.

Differential Revision: https://phabricator.services.mozilla.com/D151211
2022-07-07 13:43:56 +00:00
Julian Descottes 4ec563c420 Bug 1775071 - [devtools] Guard profiler markers for DevTools actor events behind a profiler.IsActive check r=ochameau
DevTools actor events can be a very hot path and we should avoid computing the marker label if possible.

Differential Revision: https://phabricator.services.mozilla.com/D150996
2022-07-06 09:38:53 +00:00
Alexandre Poirot 9b75e905d1 Bug 1773284 - [devtools] Add tracing marking for RDP fronts and actors. r=jdescottes
This should allow better highlight slow request/event on both server and client sides.

Differential Revision: https://phabricator.services.mozilla.com/D148660
2022-06-13 11:48:25 +00:00
Butkovits Atila 80598b951a Backed out changeset 46c9d33f30a7 (bug 1773284) for causing devtools failures. CLOSED TREE 2022-06-09 17:15:41 +03:00
Alexandre Poirot 1aea566c1b Bug 1773284 - [devtools] Add tracing marking for RDP fronts and actors. r=jdescottes
This should allow better highlight slow request/event on both server and client sides.

Differential Revision: https://phabricator.services.mozilla.com/D148660
2022-06-09 13:31:29 +00:00
Nicolas Chevobbe c30f1e8099 Bug 1755645 - [devtools] Don't unmanage actor if its "old" parent is the same as the "new" one. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D138881
2022-02-16 10:43:55 +00:00
Alexandre Poirot 07fc3ec8fe Bug 1746952 - [devtools] Fix targetFront attribute of all storage resources. r=nchevobbe
Most children of the target fronts are target scoped actors,
like console, inspector, thread,...
All these target scoped actor's fronts are created via:
https://searchfox.org/mozilla-central/rev/7d17fd1fe9f0005a2fb19e5d53da4741b06a98ba/devtools/shared/protocol/types.js#539-540
And so aren't going throught this `types.addActorType` inner function.

So fix the targetFront attribute for all fronts created via this `read` method
where the immediate parent is the targetFront.

Differential Revision: https://phabricator.services.mozilla.com/D134377
2021-12-22 09:59:09 +00:00
Julian Descottes 06b42b006a Bug 1741369 - [devtools] Update paths to loader files in devtools/ r=ochameau
Depends on D131216

Differential Revision: https://phabricator.services.mozilla.com/D131217
2021-11-17 12:43:26 +00:00
Alexandre Poirot 4783fd28e1 Bug 1732120 - [devtools] Rename BrowsingContextTargetActor to WindowGlobalTargetActor. r=nchevobbe,devtools-backward-compat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D126367
2021-09-27 12:16:11 +00:00
Alexandre Poirot d48123ef45 Bug 1726238 - [devtools] Fix browser_toolbox_backward_forward_navigation.js intermittent failure. r=bomsy
Inspector fronts initialization is still pending while we navigate away to another top target.
Leading to various possible exception in protocol.js.
I'm adding a set of new explicit exception in order to help debugging all these cases.

Differential Revision: https://phabricator.services.mozilla.com/D123441
2021-09-01 08:30:23 +00:00
Julian Descottes 44ef2198f9 Bug 1717584 - [devtools] Protocol should not return responses containing destroyed actors r=ochameau
Depends on D118469

Returning a destroyed actor causes the actor to be re-added in a new pool and potentially be destroyed a second time.
Depending on how the actor class is implemented, it can break the destroy sequence on the server.

Differential Revision: https://phabricator.services.mozilla.com/D118470
2021-06-23 15:28:33 +00:00
Julian Descottes b4379f28ba Bug 1717580 - [devtools] Actor/Front isDestroyed should not return true for uninitialized objects r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D118469
2021-06-23 15:28:33 +00:00
Alexandre Poirot 3c4356b16b Bug 1699111 - [devtools] Rename transports onClosed callback to onTransportClosed. r=jdescottes
This will better highlight what is closing. Not the DevToolsClient, but just the transport class.

Differential Revision: https://phabricator.services.mozilla.com/D108812
2021-04-13 13:44:24 +00:00
Julian Descottes 6e80260233 Bug 1703300 - [devtools] Do not notify about uninitialized fronts in Front::watchFronts r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D111093
2021-04-07 13:42:34 +00:00
Alexandre Poirot ce54040455 Bug 1631451 - [devtools] Prevent re-entrant destroy loop in Pool.destroy. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D110097
2021-04-01 13:43:58 +00:00
Alexandre Poirot bb5f9e77f7 Bug 1698554 - [devtools] Improve error logging when a request fails with a custom exception. r=nchevobbe
Like BrowsingContextTargetActor.detach which was throwing { error: wrongState }
and we were logging "(void 0)" because error.message was undefined,
while error was the thrown JS object.

Differential Revision: https://phabricator.services.mozilla.com/D107986
2021-03-19 10:04:48 +00:00
Henry Vincent 10f12df8ef Bug 1699146 - Fix typo in error message created by Front base class r=ochameau First bug fix. Fixed typo, and then the linter wanted the code slightly reformatted.
Differential Revision: https://phabricator.services.mozilla.com/D108881
2021-03-17 23:45:49 +00:00
Alexandre Poirot 8c02f52bc2 Bug 1682780 - [devtools] Remove special hack around ThreadActor.attach from protocol.js internals. r=nchevobbe,jdescottes
This is no longer necessary as attach is no longer entering in a nested event loop.
And so we can have attach to complete and return its value as any other request.

Differential Revision: https://phabricator.services.mozilla.com/D100045
2021-01-07 13:32:41 +00:00
Nicolas Chevobbe 70e7c68418 Bug 1684965 - [devtools] Manage a reference to the parent in Pool. r=ochameau.
At the moment, the `getParent` method was using the connection `poolFor` method
to retrieve the pool that was managing it. This is quite costly as `poolFor`
loops through all the pools of the connection.
This patch adds a `parentPool` property to the Pool that is set in `manage` and
reset in `unmanage`, and used in the `getParent` method.
This speeds up getParent as well as the methods that call it (`manage` when the
actor was already managed, and `destroy`).

Differential Revision: https://phabricator.services.mozilla.com/D100981
2021-01-07 15:35:50 +00:00
bfmags 676c844cd1 Bug 1681894 - Remove unused defer require from devtools/shared/protocol/tests/xpcshell/head.js. r=ntim
Differential Revision: https://phabricator.services.mozilla.com/D100500
2020-12-28 16:10:08 +00:00
Julian Descottes 46b1e8a024 Bug 1673897 - [devtools] Throw if a spec method defines an array return value r=ochameau
Depends on D96940

Differential Revision: https://phabricator.services.mozilla.com/D96941
2020-12-02 14:35:53 +00:00
Julian Descottes 1008bc0c03 Bug 1673897 - [devtools] Stop using arrays as return values for rdp responses r=ochameau,devtools-backward-compat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96940
2020-12-02 14:35:46 +00:00
Julian Descottes 2dd87a18f4 Bug 1676980 - [devtools] Remove unused protocol/utils describeTemplate() helper r=ochameau
Depends on D96935

Differential Revision: https://phabricator.services.mozilla.com/D96939
2020-11-13 10:21:36 +00:00
Julian Descottes d41ff00be9 Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau
Current implementation
```lang=javascript
exports.method = function(fn, spec = {}) {
  fn._methodSpec = Object.freeze(spec);
  if (spec.request) {
    Object.freeze(spec.request);
  }
  if (spec.response) {
    Object.freeze(spec.response);
  }
  return fn;
};
```
https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/devtools/shared/protocol/utils.js#70-79

The helper method() in protocol/utils.js is only called from two methods:
- actorBridge (never used in the codebase)
- actorBridgeWithSpec (used by a few actors)

actorBridgeWithSpec doesn't pass the second argument, so in practice, this method could be reduced to:
```lang=javascript
exports.method = function(fn) {
  fn._methodSpec = Object.freeze({});
  return fn;
};
```

`_methodSpec` is only mentioned in one other spot: https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/devtools/shared/protocol/Actor/generateActorSpec.js#27-40

But based on our coverage tooling, we never actually have a `_methodSpec` when we run this code: https://coverage.moz.tools/#view=file&revision=latest&path=devtools/shared/protocol/Actor/generateActorSpec.js

To hit it, we would have to call `generateActorSpec` directly with an actor where we used `actorBridgeWithSpec`. But we never do that, we only use it with plain JS objects in the devtools/shared/specs folder.

Consequently, this helper can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D96935
2020-11-13 09:49:53 +00:00
Andrey Bienkowski c5d43b4b60 Bug 1674841 - [devtools] Clean up devtools/shared/protocol/tests/xpcshell/test_protocol_async.js r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D95553
2020-11-10 12:55:29 +00:00
Alexandre Poirot e9904f8f2d Bug 1672826 - [devtools] Unmanage fronts when we purge a whole prefix. r=nchevobbe
Previous `purgeRequestForDestroy` method was only rejecting all pending requests.
The new `syncFrontDestroy` allows to fully destroy the front, including
unregistering it/unmanage it. So that if we receive a packet from a brand new
actor, with the same prefix and actor ID, DevToolsClient.getFront doesn't return
the old destroyed front.
This issue was making pending requests that were never resolved.

Differential Revision: https://phabricator.services.mozilla.com/D94718
2020-11-09 12:29:53 +00:00
Julian Descottes ec70eaf5f2 Bug 1674357 - [devtools] Remove lifetime from DevTools protocol r=ochameau,devtools-backward-compat-reviewers
Depends on D95299

The lifetime feature seems unused in DevTools. Removing it should have no impact.

Differential Revision: https://phabricator.services.mozilla.com/D95302
2020-11-03 16:43:52 +00:00
Alexandre Poirot d7ab26a858 Bug 1673328 - [devtools] Stop using requestTypes in ThreadActor. r=nchevobbe
This was hacking the internals of RDP/protocol.js in order to provide
different names to the actor prototype.
I had to rename existing `skipBreakpoints` getter in order to avoid
name collision with the RDP method of the same name.
I also had to tweak a few method arguments as they weren't following protocol.js spec.
They were called without protocol.js automatic marshalling of values.
Finally, hack something in protocol.js in order to avoid duplicated response for ThreadActor.attach.

Differential Revision: https://phabricator.services.mozilla.com/D94958
2020-10-29 18:58:33 +00:00
Ricky Stewart 31b8ca9716 Bug 1654103: Standardize on Black for Python code in mozilla-central.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara 612312a64c Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00