Граф коммитов

297 Коммитов

Автор SHA1 Сообщение Дата
Alexandre Poirot 23691e0542 Bug 1793396 - [devtools] Use absolute URLs in all usages of loader.lazyRequireGetter. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158489
2022-10-03 18:57:13 +00:00
Alexandre Poirot 821cf2500c Bug 1792849 - [devtools] Use absolute URLs to import modules in devtools/server. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158487
2022-10-03 18:57:12 +00:00
Alexandre Poirot 8c0ef6b298 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 7f9229d43d 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 c83937cb5a 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
Mark Banner a6855db57e 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
Alexandre Poirot 716e6a68c2 Bug 1761975 - [devtools] Hide ExtensionContent.jsm when debugging page with WebExt content scripts. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D148837
2022-06-15 17:10:16 +00:00
criss 85072ad6a8 Backed out 2 changesets (bug 1761975, bug 1767708) for causing Xpcshell failures on test_blackboxing-02.js. CLOSED TREE
Backed out changeset d2fc50df9355 (bug 1767708)
Backed out changeset bdb40c0a7307 (bug 1761975)
2022-06-15 15:50:17 +03:00
Alexandre Poirot 54c38d1475 Bug 1761975 - [devtools] Hide ExtensionContent.jsm when debugging page with WebExt content scripts. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D148837
2022-06-15 10:10:13 +00:00
Yury Delendik b8128f1562 Bug 1719615 - Add observeWasm in addition to observeAsmJS. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D123626
2022-03-24 21:03:41 +00:00
Tooru Fujisawa 9b2ab215bf Bug 1755406 - Part 1: Remove isHiddenSource. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D138760
2022-02-16 00:12:58 +00:00
Alexandre Poirot fff697ff74 Bug 1751203 - [devtools] Drop WebExtensionTargetActor.allowSource. r=jdescottes
As we are already filtering the JS Globals via _shouldAddNewGlobalAsDebuggee,
there is no need to filter out the JS Sources.
We do want all the sources for all the WebExtension globals.

Differential Revision: https://phabricator.services.mozilla.com/D136507
2022-01-28 13:54:27 +00:00
Nicolas Chevobbe 260704f2d1 Bug 1748589 - [devtools] Fix event listener breakpoints toggling. r=bomsy.
In target-actor-mixin, we were calling `setActiveEventBreakpoints` only with the
new events we were receiving, which mean if the user was clicking a first event in
the UI, and then a second one, only the second one would have a functioning event breakpoint.
Also, we were not handling removing event breakpoints at all.
We're adding `(add|remove)EventBreakpoints` to the thread actor so it's easier
to update the list of event breakpoints.

The existing event breakpoints test is modified to ensure we don't regress such behaviour.

The call to `setEventListenerBreakpoints` is moved before dispatch the `UPDATE_EVENT_LISTENERS`
action so we can properly wait for the breakpoint to be set in tests.

Differential Revision: https://phabricator.services.mozilla.com/D135216
2022-01-10 14:10:23 +00:00
Alexandre Poirot e6ef16a3bd Bug 1743044 - [devtools] Avoid instantiating duplicated Debugger.Source/SourceActor for inline scripts. r=bomsy CLOSED TREE
Regression from bug 1643540.
Debugger.findSourceURLs is recording all sources except the one having an `introductionScript` defined.
i.e. the one being added dynamically and not part of the original HTML content (at least that the expectation of findSourceURLs)
It is important to use the same filtering in ThreadActor, otherwise we may not populate `urlMap`
correctly and call resurrectSource for sources that were recorded by findSourceURLs.
This would introduce duplicated Debugger.Source and SourceActor for the same URL.

Differential Revision: https://phabricator.services.mozilla.com/D132218
2021-12-06 16:54:29 +00:00
Noemi Erli d99b4a414c Backed out 2 changesets (bug 1743044) for causing failures in browser_resources_sources.js
Backed out changeset dd0d0dabb482 (bug 1743044)
Backed out changeset 1ec7edd8a8e6 (bug 1743044)
2021-12-06 19:36:51 +02:00
Alexandre Poirot ed3fd8a0d8 Bug 1743044 - [devtools] Avoid instantiating duplicated Debugger.Source/SourceActor for inline scripts. r=bomsy
Regression from bug 1643540.
Debugger.findSourceURLs is recording all sources except the one having an `introductionScript` defined.
i.e. the one being added dynamically and not part of the original HTML content (at least that the expectation of findSourceURLs)
It is important to use the same filtering in ThreadActor, otherwise we may not populate `urlMap`
correctly and call resurrectSource for sources that were recorded by findSourceURLs.
This would introduce duplicated Debugger.Source and SourceActor for the same URL.

Differential Revision: https://phabricator.services.mozilla.com/D132218
2021-12-06 16:54:29 +00:00
nchevobbe be70bb4001 Bug 1580394 - [devtools] Don't wait for document to be ready to show PausesDebuggerOverlay. r=ochameau.
We're using the new `force` parameter for `insertAnonymousContent` to force creating a container
for the anonymous content, and we add a new option to the CanvasAnonymousHelper so highlighter
can choose to not wait for the dom to load.
For now we only use it for the paused debugger overlay as the other highlighters might need
an inspector front, which may require the dom to be ready.
We enable the assertions in  browser_dbg-paused-overlay-loading.js to check that the
highlighter is visible.
This required a few changes in the highlighter test actor.
First, it was waiting for an inspector front in its initialize method, which was
waiting indefinitely in our test as the document is paused. As this was only done
to retrieve the inspector actorID, we simply remove it and retrieve the actorID
through the connection and the target form when it's needed (for the eye dropper).
Secondly, the isPausedDebuggerOverlayVisible method was returning true even when
the highlighter wasn't displayed, so we check a few additional attributes.

Depends on D132034

Differential Revision: https://phabricator.services.mozilla.com/D132116
2021-12-02 08:39:23 +00:00
Nicolas Chevobbe 459fde3136 Bug 1742541 - [devtools] Don't try to show PausedDebuggerOverlay if document isn't ready. r=ochameau.
At the moment, the overlay can't be displayed if the DOM isn't loaded,
and we were waiting for that state before trying to show the overlay.
But we can't move forward in the document loading process until we resume,
which mean we could end up in weird state with the overlay, where the
page wasn't paused anymore, but we'd display it.
In this patch, we simply bail out if the document isn't ready.

Differential Revision: https://phabricator.services.mozilla.com/D131884
2021-11-25 06:24:12 +00:00
Cosmin Sabou f8f59c4e24 Backed out 2 changesets (bug 1742332, bug 1742541) for causing assertion failures on htmlparser/nsExpatDriver.cpp. CLOSED TREE
Backed out changeset 333fa37b4df2 (bug 1742332)
Backed out changeset 762649eb6709 (bug 1742541)
2021-11-25 11:26:14 +02:00
Nicolas Chevobbe 50f18c0c83 Bug 1742541 - [devtools] Don't try to show PausedDebuggerOverlay if document isn't ready. r=ochameau.
At the moment, the overlay can't be displayed if the DOM isn't loaded,
and we were waiting for that state before trying to show the overlay.
But we can't move forward in the document loading process until we resume,
which mean we could end up in weird state with the overlay, where the
page wasn't paused anymore, but we'd display it.
In this patch, we simply bail out if the document isn't ready.

Differential Revision: https://phabricator.services.mozilla.com/D131884
2021-11-25 06:24:12 +00:00
Cristian Tuns ac7a567f03 Backed out 4 changesets (bug 1741808, bug 1742541, bug 1605330, bug 1742332) for causing damp failures. CLOSED TREE
Backed out changeset fe65ddb40037 (bug 1605330)
Backed out changeset d5c4c10f70d9 (bug 1742332)
Backed out changeset 9f637151059d (bug 1741808)
Backed out changeset bd54eacb2d7c (bug 1742541)
2021-11-24 06:43:20 -05:00
Nicolas Chevobbe a0e98abae5 Bug 1742541 - [devtools] Don't try to show PausedDebuggerOverlay if document isn't ready. r=ochameau.
At the moment, the overlay can't be displayed if the DOM isn't loaded,
and we were waiting for that state before trying to show the overlay.
But we can't move forward in the document loading process until we resume,
which mean we could end up in weird state with the overlay, where the
page wasn't paused anymore, but we'd display it.
In this patch, we simply bail out if the document isn't ready.

Differential Revision: https://phabricator.services.mozilla.com/D131884
2021-11-23 18:56:54 +00:00
Alexandre Poirot 0aae4b0803 Bug 1717005 - [devtools] Simplify nested event loop management. r=jdescottes,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D118174
2021-07-12 21:04:56 +00:00
Alexandre Poirot e260f44463 Bug 1717005 - [devtools] Stop using unsafeSynchronize. r=jdescottes,bomsy
I don't think it was any useful to block synchronously on the call to `doResume`.
In the past it used to send an event to the client synchronously,
it may have been important back then.

test_nesting-03.js is still covering nested event loop by using two clients.

Differential Revision: https://phabricator.services.mozilla.com/D118173
2021-07-12 21:04:55 +00:00
Julian Descottes 30c134da37 Bug 1717861 - [devtools] Remove willInterrupt event from ThreadActor r=ochameau,devtools-backward-compat-reviewers
Depends on D118607

Differential Revision: https://phabricator.services.mozilla.com/D118875
2021-07-05 15:58:46 +00:00
Julian Descottes d71a5c5014 Bug 1717861 - [devtools] Remove poppedFrames from ThreadActor paused event r=ochameau,devtools-backward-compat-reviewers
Depends on D118471

Differential Revision: https://phabricator.services.mozilla.com/D118607
2021-07-05 15:58:46 +00:00
Julian Descottes 5b41578583 Bug 1717584 - [devtools] Do not reuse destroyed frame actors in Thread actor r=ochameau
Depends on D118470

The ThreadActor is storing frame actors in a local map, on top of the regular pools managed by the framework.
If a frame corresponding to an already destroyed actor needs to be handled and returned again by the thread actor, it should create a completely new Actor instead of attempting to reuse an already destroyed object.

Differential Revision: https://phabricator.services.mozilla.com/D118471
2021-06-23 15:28:34 +00:00
Alexandre Poirot 6b61530950 Bug 1681698 - [devtools] Bootstrap the thread actor early, when the target actor instantiates r=jdescottes,nchevobbe,devtools-backward-compat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D99356
2021-02-15 17:08:21 +00:00
Butkovits Atila caa6d11ebe Backed out 2 changesets (bug 1681698, bug 1681699) for causing failure on browser_browser_resources_console_messages.js. CLOSED TREE
Backed out changeset cf75ed5213a0 (bug 1681698)
Backed out changeset 283763c17ed7 (bug 1681699)
2021-02-11 20:18:10 +02:00
Alexandre Poirot 11d4a4a1ff Bug 1681698 - [devtools] Bootstrap the thread actor early, when the target actor instantiates r=jdescottes,nchevobbe,devtools-backward-compat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D99356
2021-02-11 15:23:58 +00:00
Alexandre Poirot 9fe04a85c9 Bug 1683139 - [devtools] Avoid setting the same breakpoint more than once. r=nchevobbe,jdescottes,devtools-backward-compat-reviewers
This was causing _priorPause to be reset unexpectedly,
leading to lastPausedPacket being null and missing "paused" THREAD_STATE resource.

Differential Revision: https://phabricator.services.mozilla.com/D103068
2021-02-02 12:16:11 +00:00
Alexandre Poirot 9554affa8a Bug 1683139 - [devtools] Implement breakpoint resource on server side via the watcher actor. r=nchevobbe,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D100046
2021-02-02 10:33:42 +00:00
Alexandre Poirot 2fa4a4364b Bug 1685493 - Ensure breaking in xpcshell test, even if first line isn't breakable. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D101019
2021-01-19 11:01:54 +00:00
Alexandre Poirot cae099948e Bug 1686564 - [devtools] Register onExceptionUnwind only once. r=nchevobbe
Stop unregistering onExceptionUnwind on navigation (will-navigate) and pauses.
So that we no longer have to re-register it on window-ready and resume.
Instead, only check that we aren't paused when processing an exception.
Regarding navigation, I don't think we want to ignore any exception during the process of navigating to another page.
I would rather say we want to catch anything that happen during this process!

Differential Revision: https://phabricator.services.mozilla.com/D101651
2021-01-14 08:28:18 +00:00
Alexandre Poirot b326fcddff Bug 1686480 - [devtools] Make ThreadActor.pauseOnExceptions just a wrapper to reconfigure method. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D101650
2021-01-14 07:51:33 +00:00
Alexandre Poirot b95dbbd583 Bug 1686480 - [devtools] Allow all options currently passed to ThreadActor.attach to be passed via ThreadActor.reconfigure. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D101471
2021-01-14 07:54:01 +00:00
Alexandre Poirot 04a5a9ecf9 Bug 1686480 - [devtools] A few naive cleanups in ThreadActor. r=nchevobbe
Bind onExceptionUnwind only once, remove unused _scripts attribute, create _debuggerSourcesSeen from constructor.

Differential Revision: https://phabricator.services.mozilla.com/D101470
2021-01-14 07:50:56 +00:00
Alexandre Poirot dae4c7eb6f Bug 1682780 - [devtools] Used contants to define ThreadActor `state` attribute. r=jdescottes,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D100986
2021-01-07 13:36:11 +00:00
Alexandre Poirot 31c22e4866 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
Alexandre Poirot 3f9e98f591 Bug 1682780 - [devtools] Avoid pausing on thread actor's attach request. r=nchevobbe,jdescottes
We always used to pause when "attaching" the thread actor.
We ought to call ThreadActor's attach method first before using it.
And this method do various things:
  * Initialize the Debugger API, enable it, register various listeners, so that breakpoint can work,
  * Pause the current thread by starting a nested event loop
So that we also ought to resume the thread, by calling ThreadActor's resume right after attach.
Otherwise the page would be paused as soon as we open the DevTools.
Which sounds like something we might have wanted a very long time ago.
But sounds like pure legacy behavior from today's perspective.

Differential Revision: https://phabricator.services.mozilla.com/D99919
2021-01-07 15:02:11 +00:00
Nicolas Chevobbe d15f816596 Bug 1682848 - [devtools] Fix error when pausing in a content process script in the Browser Toolbox. r=bomsy.
When pausing in a content process script in the Browser Toolbox (e.g. somewhere
in devtools/server), we tried to display the PausedDebuggerOverlay, which was
causing an error to be displayed in the CanvasFrameAnonymousContentHelper, as
we didn't have access to a documentElement property it needed.

This happens because the _canShowOverlay method in the thread actor was only
checking for the presence of a window property on the target actor.
Unfortunately, the ContentProcessTargetActor does expose a window getter, which
is a Sandbox, and thus doesn't have a document.

This patch modifies the _canShowOverlay function to check that we do have access
to a documentElement.

Differential Revision: https://phabricator.services.mozilla.com/D99899
2020-12-17 08:02:40 +00:00
Alexandre Poirot 9717df61b3 Bug 1644188 - [devtools] Implement server side JS sources. r=jdescottes,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D87504
2020-12-08 13:11:59 +00:00
Julian Descottes a0e3b72bea 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
Nicolas Chevobbe 453481a6fe Bug 1678636 - [devtools] Prevent paused overlay to be shown after resuming. r=ladybenko.
Before showing the pause overlay, we wait for the page to be fully loaded.
This introduced some delay, and at the moment we were showing the overlay, the
debugger could not be paused anymore.
This patch adds another check to ensure the debugger is paused, as well as a
test to avoid regression."

Differential Revision: https://phabricator.services.mozilla.com/D97778
2020-12-01 09:17:17 +00:00
Nicolas Chevobbe 41f54d06bf Bug 1678638 - [devtools] Remove unused node parameter from PausedDebuggerOverlay#show. r=ladybenko.
This was probably here to match other highlighters, but
we're not using it at all so let's remove it.

Differential Revision: https://phabricator.services.mozilla.com/D97777
2020-12-01 09:17:09 +00:00
Nicolas Chevobbe 00e272dd2d Bug 1678258 - [devtools] Fix debugger paused overlay buttons. r=rcaliman.
In Bug 1673328, the signature of the resume function was modified,
but we missed that the function was called from the paused overlay,
which means we didn't pass the correct signature anymore, and buttons
of the paused overlay weren't working at all.
This patch fixes the callsite and adds a mochitest where we go
through a simple case of pausing and then stepping and resuming
by clicking on the overlay buttons.
Since the pause overlay is different from the other highlighters
for which we already had test helpers, we needed to add dedicated
test helpers for the pause overlay, in the test actor.

Differential Revision: https://phabricator.services.mozilla.com/D97757
2020-11-26 15:06:06 +00:00
Nicolas Chevobbe 220bf52237 Bug 1675450 - [devtools] Remove unused ObjectActor.definitionSite. r=ochameau,devtools-backward-compat-reviewers.
The function wasn't used, except in a test that this patch removes.
Since it was also the only use of the getSourcesManager hook, we're able to
remove it as well.

Differential Revision: https://phabricator.services.mozilla.com/D95989
2020-11-09 09:50:26 +00:00
Nicolas Chevobbe 4269e69069 Bug 1674417 - [devtools] Rename SourcesManager instances. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D95333
2020-11-05 08:54:54 +00:00
Alexandre Poirot 1cca051c93 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
Alexandre Poirot ce474dc715 Bug 1673328 - [devtools] Rename TabSources to SourcesManager. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D95042
2020-10-29 19:00:26 +00:00