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

153 Коммитов

Автор SHA1 Сообщение Дата
Julian Descottes e9bb161639 Bug 1642295 - Fold clearCachedMessage from ConsoleServiceListener into WebConsoleActor r=nchevobbe
Depends on D86961

Differential Revision: https://phabricator.services.mozilla.com/D86962
2020-08-19 14:08:37 +00:00
Kris Maglione 3af8c4138c Bug 1651519: Remove nsIDOMWindowUtils::currentInnerWindowID. r=nika,remote-protocol-reviewers,webcompat-reviewers,whimboo
It has some properties which make it footgunny, especially in the face of
Fission. Callers should use WindowGlobalChild.innerWindowId instead.

Differential Revision: https://phabricator.services.mozilla.com/D82801
2020-08-17 20:20:50 +00:00
Nicolas Chevobbe 7ee8cd576d Bug 1657389 - Rename target actor mock 'window' property to 'workerGlobal'. r=ochameau.
Not having the window property anymore, we have to change the `window` getter
in WebConsoleActor to retrieve `workerGlobal`. And since the getter name wasn't
reflecting what it was holding (it can be a window, a worker global or a sandbox),
we rename it to `global` (and `evalWindow` to `evalGlobal`).

We remove the `globalDebugObject` getter on the thread actor that wasn't used
anywhere in the code.

Differential Revision: https://phabricator.services.mozilla.com/D86035
2020-08-06 14:05:07 +00:00
Daisuke Akatsuka 19143855ba Bug 1644195: Make document-listener not depend on console actor to reuse in another place. r=jdescottes,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D83899
2020-07-28 07:56:40 +00:00
Dorel Luca 990d081d9f Backed out 2 changesets (bug 1651519) for WPT failures in webdriver/tests/switch_to_frame/switch.py. CLOSED TREE
Backed out changeset 7b973a0e7be9 (bug 1651519)
Backed out changeset 55e9184c5617 (bug 1651519)
2020-07-22 02:47:34 +03:00
Kris Maglione e7d942c77f Bug 1651519: Remove nsIDOMWindowUtils::currentInnerWindowID. r=nika,remote-protocol-reviewers,webcompat-reviewers,whimboo
It has some properties which make it footgunny, especially in the face of
Fission. Callers should use WindowGlobalChild.innerWindowId instead.

Differential Revision: https://phabricator.services.mozilla.com/D82801
2020-07-21 19:02:27 +00:00
Dorel Luca d91c6dc40b Backed out 2 changesets (bug 1651519) for wpt failures in webdriver/tests/switch_to_frame/switch.py. CLOSED TREE
Backed out changeset 52317abc5c68 (bug 1651519)
Backed out changeset 45448dca59a4 (bug 1651519)
2020-07-21 21:55:57 +03:00
Kris Maglione 9c2c147159 Bug 1651519: Remove nsIDOMWindowUtils::currentInnerWindowID. r=nika,remote-protocol-reviewers,webcompat-reviewers,whimboo
It has some properties which make it footgunny, especially in the face of
Fission. Callers should use WindowGlobalChild.innerWindowId instead.

Differential Revision: https://phabricator.services.mozilla.com/D82801
2020-07-21 16:59:28 +00:00
Kris Maglione 9d78661f88 Bug 1649221: Update ChromeUtils.generateQI callers to pass strings. r=mccr8,remote-protocol-reviewers,marionette-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,preferences-reviewers,agi,whimboo,Bebe,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D81594
2020-07-10 23:58:28 +00:00
Julian Descottes a99306e1b0 Bug 1650453 - Remove rejected words violations in devtools source code files r=nchevobbe
Depends on D82568

Differential Revision: https://phabricator.services.mozilla.com/D82212
2020-07-07 17:10:13 +00:00
Samarjeet 622594643a Bug 1546394 Adds :block <url> command similar to netmonitor r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D69803
2020-06-27 09:22:23 +00:00
Nicolas Chevobbe d5ffb31381 Bug 1623283 - Rename Pool#actor into getActorByID. r=jdescottes.
We take this opportunity to remove Pool.get as well,
which was doing exactly the same thing as Pool.actor

This highlighted a couple issues in Reps:
- LongString were relying on the isGrip function, which was only checking that
  the actor property was truthy. So it was matching LongStringFront which had
  the actor method. This is modified by using the isLongString helper instead.
- The Object rep was building all the reps for the object properties, even in
  TINY mode, where the result was only used to check the length. In the Accessibility
  panel, it can happen that an plain object containing front properties is passed
  to Rep. It was fine before because this was short-circuited by the Accessor rep
  which was only checking the truthiness of a `get` property. With `get` being
  removed, the default Rep was used, which is Object, and we were hitting a
  recursion loop, as some of the properties of fronts are cycle references.
  There should be a fix in the Accessibility panel to _not_ pass fronts, but we
  also "fix" it from here by simply not building sub-properties for the object
  when we're in TINY mode.

Differential Revision: https://phabricator.services.mozilla.com/D81971
2020-07-02 15:07:12 +00:00
Logan Smyth bc1239373b Bug 1637883 - Bail on eager eval for same-compartment windows. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D81382
2020-06-29 05:17:59 +00:00
Tooru Fujisawa 74dfbb2d11 Bug 1647026 - Disallow Array.prototype.fill in eager evaluation. r=loganfsmyth
Differential Revision: https://phabricator.services.mozilla.com/D80373
2020-06-20 18:59:52 +00:00
Nicolas Chevobbe f77c6d3593 Bug 1644966 - Change parameter of ContentProcessListener to a function. r=jdescottes.
It used to take an object with only 1 property, a function. The way it was
called in the webconsole actor made it harder to follow than it actually need.
We take that as an opportunity to convert the function to a class.

Differential Revision: https://phabricator.services.mozilla.com/D79294
2020-06-12 14:16:41 +00:00
Nicolas Chevobbe 2afd39c3b3 Bug 1644966 - Change second parameter of ConsoleAPIListener to a function. r=jdescottes.
It used to take an object with only 1 property, a function. The way it was
called in the webconsole actor made it harder to follow than it actually need.
We take that as an opportunity to convert the function to a class.

Differential Revision: https://phabricator.services.mozilla.com/D79252
2020-06-12 10:09:29 +00:00
Nicolas Chevobbe 4f8171b1e1 Bug 1644966 - Change second parameter of ConsoleServiceListener to a function. r=jdescottes.
It used to take an object with only 1 property, a function. The way it was
called in the webconsole actor made it harder to follow than it actually need.
We take that as an opportunity to convert the function to a class.

Differential Revision: https://phabricator.services.mozilla.com/D79249
2020-06-12 10:08:51 +00:00
Alexandre Poirot d6c2c33b24 Bug 1620243 - Watch console messages resources from the server side. r=nchevobbe,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D77441
2020-06-09 18:22:45 +00:00
Nicolas Chevobbe 34d39dc550 Bug 1641494 - Don't eagerly evaluate commands. r=Honza.
Depends on D77268

Differential Revision: https://phabricator.services.mozilla.com/D77269
2020-06-01 11:20:02 +00:00
Nicolas Chevobbe e84ce16407 Bug 1578174 - Use target and window from which a CSS warning was emitted to get the list of impacted elements. r=rcaliman,ochameau.
In order to retrieve the list of impacted element for a given CSS warning,
we are evaluating a document.querySelector expression,
using the cssSelector we get from the error itself.

But if the warning message comes from an iframe, we are not retrieving the
impacted elements, only items from the top-level document.

By storing the target actor id a message is emitted from directly in the message
itself, we can retrieve the target front, and use it to do the evaluation against
the right target.

This is not enough though, as non-remote frame don't have a dedicated target,
and we'll be back at square one, using the top-level document to do the evaluation.
In order to fix that, we're passing the innerWindowID to the evaluateJSAsync method,
so it can be used on the server to retrieve the window instance we need.

A test is added to ensure this feature works as expected for iframes, and it
passes with or without fission enabled.

Differential Revision: https://phabricator.services.mozilla.com/D75811
2020-05-26 15:50:57 +00:00
Csoregi Natalia 08fa2d05ed Backed out 2 changesets (bug 1546394) for devtools failures with getBlockedUrls. CLOSED TREE
Backed out changeset 0365ee129bc0 (bug 1546394)
Backed out changeset 1b05fad0314a (bug 1546394)
2020-05-18 13:33:42 +03:00
Samarjeet bf742a9699 Bug 1546394 Adds :block <url> command similar to netmonitor r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D69803
2020-05-15 10:58:38 +00:00
Daisuke Akatsuka d816588542 Bug 1625942: Introduce dom-loading event. r=ochameau,Honza
Depends on D69329

Differential Revision: https://phabricator.services.mozilla.com/D71505
2020-04-28 15:58:35 +00:00
Oriol Brufau 35a5b6c057 Bug 1631288 - Support %TypedArray%.from and %TypedArray%.of in eager evaluation. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D71667
2020-04-22 00:21:41 +00:00
Emily McDonough 9c69d6e813 Bug 1631644 - Add Element::HasGridFragments() and use it in appropriate locations in devtools r=bradwerth,emilio
This is cheaper than calling Element::GetGridFragments as it does not need to
to construct an entire array of results. Most uses of GetGridFragments in the
devtools are only testing for the existence of grid fragments, and can be
changed to this cheaper method instead.

Differential Revision: https://phabricator.services.mozilla.com/D71674
2020-04-21 18:46:35 +00:00
Oriol Brufau dd9d157546 Bug 1631277 - Allow 'instanceof' in eager evaluation. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D71477
2020-04-20 14:29:24 +00:00
Daniel Varga e99eb8477c Backed out 2 changesets (bug 1625942) for causing devtools failures at devtools/client/netmonitor/test/browser_net_reload-markers.js
CLOSED TREE

Backed out changeset 4255bd054e34 (bug 1625942)
Backed out changeset 743e1ce65e06 (bug 1625942)
2020-04-17 13:39:11 +03:00
Daisuke Akatsuka 8253c44dc4 Bug 1625942: Introduce ResourceWatcher into network monitor to fetch DocumentEvents. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D69329
2020-04-17 08:13:23 +00:00
Nicolas Chevobbe b04657a9c3 Bug 1616897 - Remove WebReplay-related functions/variables/css rules in devtools. r=jlast.
Differential Revision: https://phabricator.services.mozilla.com/D68514

--HG--
extra : moz-landing-system : lando
2020-03-27 15:10:53 +00:00
Jason Laster 5f29a6d696 Bug 1622996 - Refactor devtools codebase to use optional chaining (automated changes). r=jdescottes
Depends on D67084

Differential Revision: https://phabricator.services.mozilla.com/D67537

--HG--
extra : moz-landing-system : lando
2020-03-19 21:13:38 +00:00
Logan Smyth 482933844f Bug 1621572 - Only run evaling-debugger hooks during eager-eval. r=arai,nchevobbe
The primary issue here is that the intended usecase for `onNativeCall` is to
allow aborting execution in cases where we certain native functions are called.
Given that intended usecase, the issue here is that execution of Debugger
hooks themselves may trigger native functions or other cases where execution
will be terminated.

To avoid this issue, we've decided that the presence of an onNativeCall hook
should cause all Debugger hooks to be ignored other than those associated
with the Debugger object that is performing the evaluation.

In reality, we may want to make this even stricter in the future by
moving the implementation of "eager eval" to C++, making `onNativeCall` a
callback passed to the Debugger's eval-like APIs, and then disallowing _all_
hook execution during eager evaluation, but that would be a much larger task.

Differential Revision: https://phabricator.services.mozilla.com/D67110

--HG--
extra : moz-landing-system : lando
2020-03-18 13:06:26 +00:00
Nicolas Chevobbe f45a693f18 Bug 1623089 - Remove unnecessary WebConsoleActor _pool property. r=jdescottes.
The WebConsoleActor extends the Actor class, which extends the
Pool class. This means we don't need to create an extra Pool
to hold actors created by the WebConsoleActor.
We take this as an opportunity to remove the getActorFromID method,
which was only an alias for Pool#actor.

Depends on D66780

Differential Revision: https://phabricator.services.mozilla.com/D67290

--HG--
extra : moz-landing-system : lando
2020-03-18 11:01:14 +00:00
Ed Lee acb960676c Bug 1620556 - Automatic code fixes for Prettier 1.19.1 upgrade. r=Standard8,remote-protocol-reviewers,marionette-reviewers,webcompat-reviewers,perftest-reviewers,sparky,whimboo,denschub
Differential Revision: https://phabricator.services.mozilla.com/D66128

--HG--
extra : moz-landing-system : lando
2020-03-13 23:38:52 +00:00
Logan Smyth 92625fb2ab Bug 1620087 - Part 3: Treat all realms as debuggees to avoid unexpected sideeffects. r=nchevobbe
Treating as many realms as we can as debuggee makes us much less likely to
accidentally cause side-effects during eager-evaluation of code in the console.

Differential Revision: https://phabricator.services.mozilla.com/D65445

--HG--
extra : source : 9e09d30270d6cc660fabb406e132e2e09db870a5
2020-03-05 10:02:09 +00:00
Logan Smyth 41403cc444 Bug 1620087 - Part 2: Exceptions during eager whitelist validation should terminate execution. r=nchevobbe
I've run into this a couple times now, where as I'm tweaking things, I
accidentally introduce something that throws. The code as it was defaulted
to allowing calls to any native function that throws, which seems like a
bad idea, so this now defaults to termination when an error is encountered.

Depends on D65466

Differential Revision: https://phabricator.services.mozilla.com/D65467

--HG--
extra : source : a6efc9fb5e12dcda1254cb2773a4b3234a3944ba
2020-03-05 10:01:56 +00:00
Logan Smyth e5442c2205 Bug 1620087 - Part 1: Split the ECMAScript eager whitelist into its own file. r=nchevobbe
Splitting this list into its own file reduces the chances of accidentally
referencing incorrect globals.

The implementation's original placement in eval-with-debugger for instance
was accidentally pulling Reflect from resource://gre/modules/reflect.jsm
because that file also makes use of `Reflect.parse`. Rather than try to
keep it in that file and rename things, placing the list in its own
lazy-loaded file seems like the easiest and most future-proof approach.

Differential Revision: https://phabricator.services.mozilla.com/D65466

--HG--
extra : source : 62d4008a089add58a8688af4220a07134d3a05ca
2020-03-05 10:01:54 +00:00
Ciure Andrei 1ed499ddd6 Backed out 3 changesets (bug 1620087) for causing browser/browser_console_eager_eval.js failures CLOSED TREE
Backed out changeset 9e09d30270d6 (bug 1620087)
Backed out changeset a6efc9fb5e12 (bug 1620087)
Backed out changeset 62d4008a089a (bug 1620087)

--HG--
extra : histedit_source : 32afafc710e62c65de06a952217017e2707e954b
2020-03-05 13:08:02 +02:00
Logan Smyth 2d6c0ea1a7 Bug 1620087 - Part 3: Treat all realms as debuggees to avoid unexpected sideeffects. r=nchevobbe
Treating as many realms as we can as debuggee makes us much less likely to
accidentally cause side-effects during eager-evaluation of code in the console.

Differential Revision: https://phabricator.services.mozilla.com/D65445

--HG--
extra : moz-landing-system : lando
2020-03-05 10:02:09 +00:00
Logan Smyth 11a9bcf86d Bug 1620087 - Part 2: Exceptions during eager whitelist validation should terminate execution. r=nchevobbe
I've run into this a couple times now, where as I'm tweaking things, I
accidentally introduce something that throws. The code as it was defaulted
to allowing calls to any native function that throws, which seems like a
bad idea, so this now defaults to termination when an error is encountered.

Depends on D65466

Differential Revision: https://phabricator.services.mozilla.com/D65467

--HG--
extra : moz-landing-system : lando
2020-03-05 10:01:56 +00:00
Logan Smyth 2969f7a82b Bug 1620087 - Part 1: Split the ECMAScript eager whitelist into its own file. r=nchevobbe
Splitting this list into its own file reduces the chances of accidentally
referencing incorrect globals.

The implementation's original placement in eval-with-debugger for instance
was accidentally pulling Reflect from resource://gre/modules/reflect.jsm
because that file also makes use of `Reflect.parse`. Rather than try to
keep it in that file and rename things, placing the list in its own
lazy-loaded file seems like the easiest and most future-proof approach.

Differential Revision: https://phabricator.services.mozilla.com/D65466

--HG--
extra : moz-landing-system : lando
2020-03-05 10:01:54 +00:00
Nicolas Chevobbe f2f6b15222 Bug 1616721 - Block messages triggered by eager evaluation. r=loganfsmyth.
This patch is in 2 folds:
- The first one sets a specific url option in evalWithDebugger when an eager evaluation is requested.
- Then in console-service, we block any message that has this specific sourceName, as it indicates it was triggered by the eager evaluation.

A test is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D63663

--HG--
extra : moz-landing-system : lando
2020-02-26 11:50:45 +00:00
Logan Smyth cde4370d90 Bug 1617666 - Use a separate Debugger to improve performance of eval. r=jlast
The SpiderMonkey Debugger API maintains a flag per-debuggee that tracks whether
the SpiderMonkey should notify the debugger when new frames are entered, and
whether the JIT scripts associated with the debuggee realm have been compiled
with debug instrumentation. To avoid constantly needing to clear and regenerate
JIT scripts, the flag is permanently enabled once "onEnterFrame" has been used
with a given Debugger instance, and when the flag is enabled, there is a
runtime performance cost.

This runtime cost is what is causing the performance regression here, so to
ensure that the flag is cleared at the end of a given instant-eval, we only
set "onEnterFrame" on a new temporary Debugger instance, instead of setting
it on th existing persistent Debugger instance.

Differential Revision: https://phabricator.services.mozilla.com/D64912

--HG--
extra : moz-landing-system : lando
2020-03-02 22:55:28 +00:00
Surya Shankar 8a542e1a3b Bug 1584087 - Rename console-progress to mention it is about file activity. r=nchevobbe
renamed the console-progress.js/ConsoleProgressListener file and class to
console-file-activity.js/ConsoleFileActivityListener.

Differential Revision: https://phabricator.services.mozilla.com/D63672

--HG--
rename : devtools/server/actors/webconsole/listeners/console-progress.js => devtools/server/actors/webconsole/listeners/console-file-activity.js
extra : moz-landing-system : lando
2020-02-24 10:43:50 +00:00
Logan Smyth 90a500c767 Bug 1615939 - Drill through bound functions when checking function whitelist. r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D63306

--HG--
extra : moz-landing-system : lando
2020-02-19 16:38:18 +00:00
Logan Smyth ca3bbbc374 Bug 1609426 - Part 4: Allow native DOM bindings during eager eval. r=jlast,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D61966

--HG--
extra : moz-landing-system : lando
2020-02-18 17:50:00 +00:00
Logan Smyth 77131a2fc7 Bug 1609426 - Part 3: Automatically generate the list of pure functions. r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D61965

--HG--
extra : moz-landing-system : lando
2020-02-18 17:51:09 +00:00
Oriol Brufau f2494b795b Bug 1615861 - Support calling Proxy and Reflect methods when doing eager evaluations. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D63008

--HG--
extra : moz-landing-system : lando
2020-02-17 15:12:01 +00:00
Nicolas Chevobbe bf5973a454 Bug 1613845 - Remove print helper. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D61989

--HG--
extra : moz-landing-system : lando
2020-02-07 14:12:27 +00:00
Nicolas Chevobbe 508f06dae3 Bug 1613843 - Remove pprint helper. r=jdescottes.
This alsmo removes WebConsoleUtils.getPropertyDescriptor which
was only used in the pprint helper.

Differential Revision: https://phabricator.services.mozilla.com/D61985

--HG--
extra : moz-landing-system : lando
2020-02-07 14:09:49 +00:00
Logan Smyth e3a676c7fc Bug 1610682 - Time out of eager evaluation after 100ms. r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D61775

--HG--
extra : moz-landing-system : lando
2020-02-06 23:39:55 +00:00