Commit Graph

3896 Commits

Author SHA1 Message Date
Alexandre Poirot
9ccfb82b0e Bug 1888171 - [devtools] Convert Browser Loader to ESM. r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Differential Revision: https://phabricator.services.mozilla.com/D205867
2024-03-28 15:15:24 +00:00
Cristian Tuns
b75869c55d Backed out 3 changesets (bug 1866814) for causing bc failures browser_ext_devtools_inspectedWindow_targetSwitch.js CLOSED TREE
Backed out changeset 5d59dd808307 (bug 1866814)
Backed out changeset f503f5d02d1e (bug 1866814)
Backed out changeset d27f783be149 (bug 1866814)
2024-03-28 08:37:11 -04:00
Alexandre Poirot
62a99c78f7 Bug 1866814 - [devtools] Merge all DevTools JS Actors into a single DOM Process JS Actor. r=devtools-reviewers,nchevobbe
* The formers JSWindow Actors used independently to create Target Actor for WindowGlobals, Web workers and Service workers
  are all unified behind a single JSProcess Actor pair which was only used to create target actors for DOM Content Processes.
* The DevToolsProcess JSProcess actor now actively monitor the currently watched target types
  in order to start and stop listeners specific to each target type.
  We no longer rely on JSWindow Actors to observe WindowGlobal instantiations.

* `watchedByDevTools` is now consistantly set from each WindowGlobal's content process, via the WindowGlobalTargetActor.
  With the new setup, the parent process no longer track WindowGlobal/BrowsingContext's and so there is no
  natural place to flag them. While, in the content process, the target actor is an obvious place.
  There is just one trick in window global target watcher in order to also set this flag on initial about blank documents.

* `browser-element-host` Session Data is now slightly more simple. It works like any other similar session data attribute.
  But we have to ignore any pending exception coming up from updateDomainSessionDataForServiceWorkers call as that be still pending
  while the toolbox closes, which make the JS Process Actor be unregistered,
  and ultimately make the underlying sendQuery promise be rejected.
* The `loader` is made specific to each Watcher/connection and put in the connections map,
  so that we can better support content toolbox & browser toolbox usecases
  and we have a unique place to define the loader per watcher/connection.

* browser_target_command_detach.js: detach is no longer enough. It wouldn't stop watching and prevent the re-instantiation
  of the target actor. We now have to stop watching for targets. This actually better match what happens on toolbox closing.
  This test was meant as a unit test for covering remote debugging reusing the same DevToolsClient for debugger the same tab.
* `browser_toolbox_watchedByDevTools`. The management of watchedByDevTools is now driven from the content process.
  And because the DevTools Server and especially the watcher actor is destroyed without an explicit RDP request
  that the toolbox destruction is waiting for, we can't rely on closeToolbox to know
  when the server is fully cleaned up.

Differential Revision: https://phabricator.services.mozilla.com/D203409
2024-03-28 10:47:17 +00:00
Norisz Fay
8851ada603 Backed out 2 changesets (bug 1887872) for causing dt failures on browser_dbg-old-breakpoint.js CLOSED TREE
Backed out changeset b32b818f2175 (bug 1887872)
Backed out changeset 705494857aed (bug 1887872)
2024-03-27 21:22:10 +02:00
Alexandre Poirot
97f05ff11a Bug 1887872 - [devtools] Set event breakpoints on toolbox opening. r=devtools-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D205773
2024-03-27 17:04:34 +00:00
Alexandre Poirot
3a3429eb93 Bug 1887872 - [devtools] Set breakpoints on toolbox opening. r=devtools-reviewers,devtools-backward-compat-reviewers,bomsy
Register them as soon as we open devtools, instead of waiting for debugger panel opening.
So that breakpoints can work even if we did not open debugger panel yet.
So far, only debugger statement would force the opening of the debugger.

This allows to remove the redundant code from debugger frontend.

Also clarify in this patch that thread-utils exports thread configurations.

Differential Revision: https://phabricator.services.mozilla.com/D205772
2024-03-27 17:04:34 +00:00
artem manushenkov
af4b569278 Bug 1731635 [devtools] Add option to disable split console r=nchevobbe,fluent-reviewers,devtools-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D204142
2024-03-27 06:34:50 +00:00
Hubert Boma Manilla
3f650158f2 Bug 1886967 - [devtools] Cleanup the API to make more consitent r=devtools-reviewers,nchevobbe
- Added the requirement for a new `id` property to markers passed to the `setLineGutterMarkers` API.
- Changed `gutterLineClassName` to `lineClassName` the API name already indicates that it is the gutter, no need to have gutter in the property name, this also amkes it consistent with `setLineContentMarker`
- Changed `createGutterLineElementNode` to `createLineElementNode` for same reason as above.

Differential Revision: https://phabricator.services.mozilla.com/D205435
2024-03-25 21:56:12 +00:00
Hubert Boma Manilla
3e526c5415 Bug 1884651 - [devtools] Render line exception marker r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205001
2024-03-25 21:56:12 +00:00
Hubert Boma Manilla
7ced2d3ee9 Bug 1884651 - [devtools] Render blackbox marker for blackboxed line content r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204926
2024-03-25 21:56:12 +00:00
Hubert Boma Manilla
20679685dc Bug 1884651 - [devtools] Rendering debug lines when paused in code mirror 6 r=devtools-reviewers,nchevobbe
In this patch
- we begin to render debug lines when paused.
- New APIs are added to add and remove line content markers

Differential Revision: https://phabricator.services.mozilla.com/D204243
2024-03-25 21:56:11 +00:00
pstanciu
bcf6ca8465 Backed out 3 changesets (bug 1884651) for causing pause line failures e.g. on browser_dbg-keyboard-shortcuts.js
Backed out changeset 571e7f23a751 (bug 1884651)
Backed out changeset 3c52a12e9f0c (bug 1884651)
Backed out changeset f7201f71c231 (bug 1884651)
2024-03-25 17:18:30 +02:00
Hubert Boma Manilla
773442452e Bug 1884651 - [devtools] Render line exception marker r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205001
2024-03-25 13:47:42 +00:00
Hubert Boma Manilla
0a8c3df1a1 Bug 1884651 - [devtools] Render blackbox marker for blackboxed line content r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204926
2024-03-25 13:47:42 +00:00
Hubert Boma Manilla
334badc332 Bug 1884651 - [devtools] Rendering debug lines when paused in code mirror 6 r=devtools-reviewers,nchevobbe
In this patch
- we begin to render debug lines when paused.
- New APIs are added to add and remove line content markers

Differential Revision: https://phabricator.services.mozilla.com/D204243
2024-03-25 13:47:42 +00:00
Dave Townsend
f9dfd7a529 Bug 1864896 Remove additional unused function arguments.
Differential Revision: https://phabricator.services.mozilla.com/D205297
2024-03-21 10:35:45 +00:00
Dave Townsend
71420d91a6 Bug 1864896: Enable unused argument lint rule. r=Standard8,perftest-reviewers,geckoview-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,nchevobbe,robwu,sparky,issammani,sgalich,owlish,migration-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D195632
2024-03-21 08:50:00 +00:00
Hubert Boma Manilla
b2de26bb47 Bug 1882060 - [devtools] Render blackbox lines markers in gutter for codemirror 6 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204049
2024-03-21 07:48:59 +00:00
Hubert Boma Manilla
70a84b5d5e Bug 1882060 - [devtools] Add line breakpoint classes and display gutter breakpoint markers r=devtools-reviewers,nchevobbe
Highlights
- This fixes gutter breakpoints
- Disabling breakpoints should work

Note:
Log breakpoints & Conditional Breakpoints don't work

Differential Revision: https://phabricator.services.mozilla.com/D203451
2024-03-21 07:48:59 +00:00
Hubert Boma Manilla
0dac15206b Bug 1882060 - [devtools] Add support for empty lines markers to codemirror 6 r=devtools-reviewers,nchevobbe
In this patch
1) Adds the `setLineGutterMarkers` function to the editor which enables defining gutter markers
the line number gutter component. This also updates the line number gutter when the viewport (visible ranges)
change (This usually happens when the editor is scrolled).

2)The first use of the `setLineGutterMarkers` is for rendering empty lines

Differential Revision: https://phabricator.services.mozilla.com/D202716
2024-03-21 07:48:58 +00:00
Cristina Horotan
f63ca2952d Backed out 3 changesets (bug 1882060) for causing dt failures at DOMSecurityMonitor.cpp CLOSED TREE
Backed out changeset 1d39266eb67d (bug 1882060)
Backed out changeset a72df33c8fb6 (bug 1882060)
Backed out changeset 16a6afc63e6c (bug 1882060)
2024-03-20 16:35:03 +02:00
Hubert Boma Manilla
b94272cbc4 Bug 1882060 - [devtools] Render blackbox lines markers in gutter for codemirror 6 r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D204049
2024-03-20 13:08:31 +00:00
Hubert Boma Manilla
fc32d3500c Bug 1882060 - [devtools] Add line breakpoint classes and display gutter breakpoint markers r=devtools-reviewers,nchevobbe
Highlights
- This fixes gutter breakpoints
- Disabling breakpoints should work

Note:
Log breakpoints & Conditional Breakpoints don't work

Differential Revision: https://phabricator.services.mozilla.com/D203451
2024-03-20 13:08:31 +00:00
Hubert Boma Manilla
3b30e5a3d6 Bug 1882060 - [devtools] Add support for empty lines markers to codemirror 6 r=devtools-reviewers,nchevobbe
In this patch
1) Adds the `setLineGutterMarkers` function to the editor which enables defining gutter markers
the line number gutter component. This also updates the line number gutter when the viewport (visible ranges)
change (This usually happens when the editor is scrolled).

2)The first use of the `setLineGutterMarkers` is for rendering empty lines

Differential Revision: https://phabricator.services.mozilla.com/D202716
2024-03-20 13:08:30 +00:00
Alexandre Poirot
4fcbbe1548 Bug 1713093 - [devtools] Allow using waitForSource to retrieve source object asynchronously. r=devtools-reviewers,nchevobbe
waitForSource wasn't fully reliable to retrieve the source object.
Now that it is, we can remove a few useless usages of findSource following it.

Differential Revision: https://phabricator.services.mozilla.com/D203447
2024-03-20 12:30:17 +00:00
Alexandre Poirot
e98c3fe6af Bug 1713093 - [devtools] Remove TargetMixin.attachThread. r=devtools-reviewers,nchevobbe
This code was only used for workers targets, which weren't passing breakpoints
from the server side via "sessionData" concept.
Instead, we were still relying on the frontend to pass them and only after that
manually requesting the thread to resume its execution.

Now, there is still a notion of "attach" around the thread actor.
While all the targets are immediately instantiating their related thread actor,
the thread actor isn't active by default.
It becomes active as soon as:
* SOURCE or THREAD_STATE resource is watched
* breakpoints are set via session data (breakpoint list actor)
* thread configuration are set via session data (thread configuration actor)
I had to do one of these things in order to keep test from working.
In the production code, we do most of these things by default on the toolbox startup.
We could revise this behavior by:
* always attaching the thread actor, but it may start pausing unexpectedly in some tests.
* decouple sources from breakpoints within the thread actor, so that watching for sources doesn't necessarily "attach" the thread actor and activate breakpoints/debugger statements.
* have a new thread configuration to explicitly enable the thread actor pausing features.

I'm often using thread configuration to enable pausing in tests.
This required to improve xpcshell test helpers to be able to use Watcher/Commands.

About browser_target_command_bfcache.js, the DevTools code is now so quick that the
back/forward requests at done too quickly one after the other and fail actually moving to
the other document.

Differential Revision: https://phabricator.services.mozilla.com/D166321
2024-03-20 12:30:17 +00:00
Hubert Boma Manilla
d1885ead35 Bug 1882060 - [devtools] Add gutter events for click and context menu r=devtools-reviewers,nchevobbe
With this patch
- The line gutter context menu will get displayed on right click of the gutter
- Clicking line gutter should set breakpoints

Note not covered in this patch:-
- Context menu feaures might not work
- Line breakpoints are not showing yet ( this is coming in a future patch)

Differential Revision: https://phabricator.services.mozilla.com/D203210
2024-03-18 09:51:29 +00:00
Hubert Boma Manilla
08862c3d57 Bug 1882060 - [devtools] Cleanup code which toggles the folder gutter visibility r=devtools-reviewers,nchevobbe
These mouseover/mouseout events are for showing & hiding  the code fold gutter.
This does not actually work, and not seem to useful.

Differential Revision: https://phabricator.services.mozilla.com/D203251
2024-03-18 09:51:28 +00:00
Hubert Boma Manilla
c22ee17127 Bug 1882333 - [devtools] Update the editor toggle button size when the editior dimensions change r=devtools-reviewers,nchevobbe
This patch updates the size of the button (above the editor gutter) which toogles the sidebar for codemirror 6.
Note this was broken with the current codemirror as wel so fixed both.

Also adding the ability to attach an updateListener to the editor we can listen for editor changes.

Differential Revision: https://phabricator.services.mozilla.com/D202398
2024-03-18 09:51:27 +00:00
Anna Yeddi
d1b5ec132f Bug 1885008 - [devtools] Remove fail-if expectations from Debugger tests that are passing a11y-checks. r=devtools-reviewers,nchevobbe
Since the bug 1879447 enabled AccessibilityUtils to exclude intervening generics from tab-in-tablist accessibility checks, there are 3 tests in Debugger devtools that are now passing the a11y-checks, thus we could remove the `fail-if` notations from their test manifest.

Differential Revision: https://phabricator.services.mozilla.com/D204463
2024-03-13 20:54:54 +00:00
pstanciu
a9174773af Backed out 6 changesets (bug 1713093, bug 1691986) for turning Bug 1767717 into permafail. CLOSED TREE
Backed out changeset b0285f8abf2e (bug 1713093)
Backed out changeset 6532dbabf879 (bug 1713093)
Backed out changeset 2670f26f6bff (bug 1713093)
Backed out changeset a63d603a1973 (bug 1713093)
Backed out changeset 0118d0bc64ba (bug 1713093)
Backed out changeset e29a81bc7299 (bug 1691986)
2024-03-08 20:32:38 +02:00
Cosmin Sabou
e68d7120c6 Bug 1767701 - Disable browser_dbg-features-breakable-lines.js on osx 10.15 opt for frequent failures. r=#intermittent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D203856
2024-03-06 23:52:09 +00:00
Alexandre Poirot
53d931c380 Bug 1713093 - [devtools] Allow using waitForSource to retrieve source object asynchronously. r=devtools-reviewers,nchevobbe
waitForSource wasn't fully reliable to retrieve the source object.
Now that it is, we can remove a few useless usages of findSource following it.

Differential Revision: https://phabricator.services.mozilla.com/D203447
2024-03-06 13:43:49 +00:00
Alexandre Poirot
87250d4e53 Bug 1713093 - [devtools] Remove TargetMixin.attachThread. r=devtools-reviewers,nchevobbe
This code was only used for workers targets, which weren't passing breakpoints
from the server side via "sessionData" concept.
Instead, we were still relying on the frontend to pass them and only after that
manually requesting the thread to resume its execution.

Now, there is still a notion of "attach" around the thread actor.
While all the targets are immediately instantiating their related thread actor,
the thread actor isn't active by default.
It becomes active as soon as:
* SOURCE or THREAD_STATE resource is watched
* breakpoints are set via session data (breakpoint list actor)
* thread configuration are set via session data (thread configuration actor)
I had to do one of these things in order to keep test from working.
In the production code, we do most of these things by default on the toolbox startup.
We could revise this behavior by:
* always attaching the thread actor, but it may start pausing unexpectedly in some tests.
* decouple sources from breakpoints within the thread actor, so that watching for sources doesn't necessarily "attach" the thread actor and activate breakpoints/debugger statements.
* have a new thread configuration to explicitly enable the thread actor pausing features.

I'm often using thread configuration to enable pausing in tests.
This required to improve xpcshell test helpers to be able to use Watcher/Commands.

About browser_target_command_bfcache.js, the DevTools code is now so quick that the
back/forward requests at done too quickly one after the other and fail actually moving to
the other document.

Differential Revision: https://phabricator.services.mozilla.com/D166321
2024-03-06 13:43:48 +00:00
Mark Banner
4f1d29d324 Bug 1883371 - Enable ESLint rule no-console on production code. r=mossop,webcompat-reviewers,devtools-reviewers,omc-reviewers,twisniewski,nchevobbe,aminomancer
Allow for console.error, console.warn and console.createInstance, but fail for everything else.

Differential Revision: https://phabricator.services.mozilla.com/D203456
2024-03-05 16:56:57 +00:00
Dave Townsend
b8f4c2d785 Bug 1864896: Remove empty destructuring patterns (devtools). r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202960
2024-03-05 14:21:15 +00:00
Dave Townsend
9e30d1f3f9 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
artem manushenkov
5df99ddb69 Bug 1619201 - Change Watch expressions input field placeholder from "Add watch expression" to "Add expression". r=nchevobbe,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D203438
2024-03-04 17:03:21 +00:00
Alexandre Poirot
9fe319f440 Bug 1880809 - [devtools] Use binary search when adding sources in the source tree. r=devtools-reviewers,nchevobbe
This helps address a performance issue when a bulk or sources are registered.
We could have use findIndexLast, given that the sources are often coming sorted,
but this is not always the case. For example when a new arbitrary source is created by the page.

Also, while the sources look sorted, there is no actual sort being done from the Source Map Worker,
nor by the SOURCE server resource watcher. We would need to add sorting there to be reliable.

In this patch, I'm also avoiding unecessary array in the actor codebase, and, simplifying the load source map actions.

Differential Revision: https://phabricator.services.mozilla.com/D202149
2024-03-01 00:01:45 +00:00
Alexandre Poirot
c759c489b6 Bug 1880809 - [devtools] Decode source url encoded characters early and cache it. r=devtools-reviewers,bomsy
This will prevent re-decoding the characters on each react update.
This will also allow other component to manipulate decoded characters.

Differential Revision: https://phabricator.services.mozilla.com/D202445
2024-03-01 00:01:44 +00:00
Alexandre Poirot
ae6e844fe2 Bug 1880809 - [devtools] Remove unused method from source utils. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202444
2024-03-01 00:01:44 +00:00
Alexandre Poirot
c3c8916423 Bug 1880809 - [devtools] Use an explicit cached attribute on source for label displayed in SourceTree. r=devtools-reviewers,bomsy
This help ensure that we are sorting the reducer on the same string displayed in the UI.

Differential Revision: https://phabricator.services.mozilla.com/D202443
2024-03-01 00:01:44 +00:00
Alexandre Poirot
760c4d82ff Bug 1880809 - [devtools] Compute each source displayed name only once. r=devtools-reviewers,bomsy
We were calling this getFilename many times from many callsites.
Cache it once for all on the source object.

Also clarify what we typically display in the UI:
  * we display internal ID for source without a URL,
  * we strip query/search parameters,
  * we decode the URI string for special characters,
  * index files, i.e. files loaded without a file name, are named "(index)",
  * we omit the internal ":formatted" URL prefix used for pretty printed sources.

Differential Revision: https://phabricator.services.mozilla.com/D202442
2024-03-01 00:01:43 +00:00
Alexandre Poirot
407def7395 Bug 1880809 - [devtools] Remove useless argument on getFilename helper. r=devtools-reviewers,nchevobbe
This was always refering to first argument's source in all callsites using it.
Also, at the end we don't need to call getRawSourceURL, we only need to know if this source has a URL or not.

Differential Revision: https://phabricator.services.mozilla.com/D202441
2024-03-01 00:01:42 +00:00
Alexandre Poirot
8a75cbd395 Bug 1880809 - [devtools] Remove getSourceQueryString in favor of displayURL.search. r=devtools-reviewers,nchevobbe
We were recomputing the query string many times from many places whereas
it was already available off hand on displayURL object.

Differential Revision: https://phabricator.services.mozilla.com/D202440
2024-03-01 00:01:42 +00:00
Gregory Pappas
1dfbfcfd07 Bug 1878401 - part 7 - Pass BrowsingContext to nsIFilePicker::Init in tests r=extension-reviewers,settings-reviewers,credential-management-reviewers,anti-tracking-reviewers,devtools-reviewers,sgalich,pbz,nchevobbe,zombie,migration-reviewers,mconley
Depends on D200551

Differential Revision: https://phabricator.services.mozilla.com/D200552
2024-02-28 21:29:39 +00:00
Sandor Molnar
3951121cc6 Backed out 8 changesets (bug 1878401, bug 1879041) for causing build bustages on widget/nsBaseFilePicker.cpp CLOSED TREE
Backed out changeset 2e2b8df3bdd6 (bug 1879041)
Backed out changeset 6d6952f9df2c (bug 1878401)
Backed out changeset 30b5bb590d3e (bug 1878401)
Backed out changeset 9a4b830334b9 (bug 1878401)
Backed out changeset 3c3d67f1fcb7 (bug 1878401)
Backed out changeset c83ba4026822 (bug 1878401)
Backed out changeset 6bcb670ce475 (bug 1878401)
Backed out changeset f263b196df96 (bug 1878401)
2024-02-28 17:56:48 +02:00
Gregory Pappas
8a677e7f39 Bug 1878401 - part 7 - Pass BrowsingContext to nsIFilePicker::Init in tests r=extension-reviewers,settings-reviewers,credential-management-reviewers,anti-tracking-reviewers,devtools-reviewers,sgalich,pbz,nchevobbe,zombie,migration-reviewers,mconley
Depends on D200551

Differential Revision: https://phabricator.services.mozilla.com/D200552
2024-02-28 15:07:46 +00:00
Mark Banner
c9b5df99c1 Bug 1881266 - Enable ESLint recommended rule no-constant-condition globally, warning for existing cases. r=mossop,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202319
2024-02-26 11:35:41 +00:00
Mark Banner
6a15dea4e8 Bug 1881573 - Drop use of ESLint rule max-depth from newtab/asrouter/aboutwelcome. r=pdahiya,thecount,Gijs,devtools-reviewers,omc-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202474
2024-02-24 10:04:46 +00:00