Commit Graph
22 Commits
Author SHA1 Message Date
Mathias Bynens f06e8c0758 Enable no-else-return lint rule with autofix
This rule matches the Chromium-wide coding style.

Bug: chromium:1057042

Change-Id: I21ad946227ca7344146abace1d2f6146b3a6c207
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2078924
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-28 14:17:07 +00:00
Simon Zünd 1facecf39e [cleanup] Replace {pushAll} helper with {push} plus spread operator
Change-Id: I5c91ff89ff69090db8a3cfaf326a5308d23d6ca7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2003312
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-01-16 10:23:34 +00:00
Tim van der Lippe 647e33b2a1 Reland "Implement lazy loading of modules"
This reverts commit cc75dee3ba.

Reason for revert: Race-condition fixed in devtools-compatibility.js

Original change's description:
> Revert "Implement lazy loading of modules"
> 
> This reverts commit 7c08ccfd54.
> 
> Reason for revert:
> 
> Breaks browser_tests. Steps to reproduce:
> - Build Chromium's browser_tests target
> - Run `xvfb-run -s "-screen 0 1024x768x24" out/Default/browser_tests --gtest_filter=DevToolsExtensionTest.TestDevToolsExtensionAPI`
> - Observe this failure: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8897915672067501312/+/steps/browser_tests__with_patch_/0/logs/Deterministic_failure:_DevToolsExtensionTest.TestDevToolsExtensionAPI__status_FAILURE_/0
> 
> Original change's description:
> > Implement lazy loading of modules
> > 
> > Any module that is not autostart and has `modules` specified in its `module.json`
> > will now have its entrypoint dynamically imported. Update the release build script
> > to output the `modules` array as well so that the Runtime can load it.
> > 
> > Add additional entrypoints to `platform` and `dom_extension` to be consistent
> > with the naming patterns of all other modules
> > 
> > Bug:1006759
> > Change-Id: If6d10a13a62354079e3f8ee49bee4ecdcffa6758
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893085
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> 
> TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org
> 
> Change-Id: I22e8a341e841a99df0df9808a419cc070dd81bea
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1006759
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893087
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1006759
Change-Id: Id69542e883fc4b852a79e83373773de256976f83
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897686
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-04 19:25:35 +00:00
Adithya Srinivasan 7a133d2629 Portals: Keep DevTools open across activation
To implement this, we reattach the DevToolsUIBindings for the current
DevToolsWindow to the RenderFrameDevToolsAgentHost for the activated
WebContents and reset the main connection in the frontend to reconnect
with and enable the new agents.

Bug: 992887
Change-Id: I0ca4e6cc7a6c633680bfd03d574a4030ab65d7b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1788122
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Lucas Gadani <lfg@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703973}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5d50d1e0bf22d0474cfc31f63b867706a3e7590f
2019-10-09 00:27:48 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Mathias Bynens ff0f14f77f [devtools] Clean up utilities
This patch simplifies some utility methods by applying the following
changes:

1) `type=text/css` is the implicit default for <style> elements and for
    <link rel=stylesheet>. Thus, we should omit it in those cases.
    This additionally reduces visual clutter in various places,
    including the elements pane when inspecting DevTools using DevTools.

2) Prefer `const` over `let` even in dynamically generated scripts,
   matching Google's JS style guide.

3) Simplify `leadZero` by leveraging `String.prototype.padStart`, which
   shipped in Chrome 51.

BUG=v8:9396

Change-Id: I50d0b88ff9c9c2791a194d2f50445e4a561e3a23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803929
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697104}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: afee7cddcb990475607d0bfe9d8f2c0afc899e5e
2019-09-17 05:59:36 +00:00
Tim van der Lippe ffa7862d4e Update Closure compiler to v20190729
The new compiler caught a lot of pre-existing issues in the codebase.
Sadly, the old compiler version was not smart enough to understand the
new changes. Therefore, the changes have be included in the same CL as
the compiler update.

Most of the changes are related to better handling of prototype and
class inheritance, as well as handling of null/undefined tracking.

Change-Id: I3941a3a240a4d09c4945e1e20d2521090ef837c9
Bug: 991710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762081
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca93474213278e32e36d6ace1474c56884030757
2019-09-16 12:07:12 +00:00
Connor Clark ca8905e371 DevTools: Use multi-client for Lighthouse
This resolves the issue where device emulation doesn't survive the DevTools - Lighthouse connection
handoff.

It also allows for local overrides, blocked urls, and other things DevTools sets up to be used
during an audit.

Bug: 991906
Change-Id: I8a0b982e7b77f923219943feb12758b203c701a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1743411
Commit-Queue: Connor Clark <cjamcl@google.com>
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Paul Irish <paulirish@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#690008}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fa34256fe9a6a4cab1ebd737b451e7fd45a60d8f
2019-08-23 18:35:10 +00:00
Jeff Fisher ac799a524f DevTools: Address timing issue during load
During frontend load, there are a couple async points after
DOMContentLoaded before the UI can finish initializing. The first
is waiting for all modules to load. The second is waiting for
preferences to be retrieved.

The event for DevTools extensions was being fired on window
load, but it was possible for the above async work to take too long
and the event listener would not be subscribed in time.

This patch addresses this race condition by caching the event info
inside devtools_compatibility and using a callback instead of relying
on Extensions.ExtensionsServer to be constructed before window load.

Bug: 973701
Change-Id: I638a6915f7b7c37a32cebe3d876cbca4f94e9f49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1658433
Commit-Queue: Jeff Fisher <jeffish@microsoft.com>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#672273}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 185ff99913e08916b261ef4a37c40d2df9860fb4
2019-06-25 21:47:06 +00:00
James Lissiak e21c97bd10 DevTools: Adding new recordUserMetricsAction function for UMA
This patch adds a new dispatcher function to the devtools embedder
which allows the front_end javascript to call into
InspectorFrontendHost.recordUserMetricsAction() to record a user
metrics action.

The implementation is similar to the recordPerformanceHistogram()
function that we added recently, in that it uses the dynamic version of
the UMA helper. This allows the string name of the action to be provided
directly from the javascript without needing a hard-coded native value.

The change also updates the extract_actions.py script so that the
devtools files can be correctly parsed for new UMA calls. Any new ones
will then be correctly added to the actions.xml file by the script.

This change makes it simple to add new UMA calls into the devtools
frontend code so that we can gather actionable, order based telemetry
for new features.

Change-Id: Iaa0882f1862129a10f178df0a71f749e2995bc40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584921
Commit-Queue: James Lissiak <jalissia@microsoft.com>
Reviewed-by: Pavel Feldman OOO <pfeldman@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#654902}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: adb8ed7c36a18718ba165917c0188b7c0e625a7f
2019-04-29 17:36:43 +00:00
Junyi Xiao 89142cffe3 DevTools: add a shortcut to toggle tab indentation for CodeMirror editor
Accessibility testing revealed that there are tab traps in all of the text editors including read only ones. Once keyboard users tab into the editor, they cannot tab out the editor.

This change adds a shortcut to disable/re-enable tab for indentation, which allows keyboard users continue to use tab to navigate to next UI component.

Settings Shortcuts page screenshot: https://imgur.com/a/qeOjGoB

Change-Id: I026a5a9c47407634a78c2ccf1a0bc532baa39e07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545200
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Junyi Xiao <juxiao@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#649901}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 27ff38b767bc1659a596830b864acf60850e6bd0
2019-04-11 16:01:38 +00:00
James Lissiak d2f1a2ff9f DevTools: Adding new performance histograms for launch of top 4 tools
This change adds 4 new performance histograms for the DevTools using the
prefix 'DevTools.Launch':
- DevTools.Launch.Console
- DevTools.Launch.Elements
- DevTools.Launch.Network
- DevTools.Launch.Sources

These histograms measure the time between the DevTools window being
shown during 'DevToolsWindow::ToggleDevToolsWindow' and a point in each
tool that corresponds to the 'ready' state as seen by a user. These end
points are unique to each tool but are as follows:
- Console: At the end of the ConsolePrompt constructor
- Elements: At the end of _updateMetrics when the styles panel has
  been populated for the initially selected node
- Network: After the panel is shown
- Sources: After the NetworkNavigatorView has been loaded

These tools were chosen as they represent the most popular in terms of
usage and will allow us to identify any significant performance impact
in the time taken to launch the DevTools when these panels open by
default.

To see time captured by the histograms in terms of a perf trace for
each tool please take a look at the following screenshots:
https://imgur.com/a/rcAgQ8h

In the traces you can see that the end marker for each load is at the
end of the trace near first meaningful paint, and just as the user
will see the content of the tool render fully.

To accomplish the histograms, a new native function has been added to
the DevTools ui bindings/embedder classes called
'recordPerformanceHistogram'. Along with the plumbing and a new helper
function in the frontend javascript Host.UserMetrics file called
'panelLoaded'

When the frontend javascript loads, it will store the initial panel to
be loaded from the preferences. Once that panel has been created and
the appropriate loaded marker has been hit, the duration of the launch
will be calculated using performance.now(). That duration is then sent
to the native code which will fire the appropriate histogram via the
'UMA_HISTOGRAM_TIMES' macros.

The mechanism is similar to the existing one used for enumerated
histograms and can be expanded to fire additional performance histograms
in the future.

Also added a new test for user-metrics to ensure that the panelLoaded
function will correctly record the histograms.

Change-Id: Ib9f0bf80c651231d6d2e308bee36c1a1223f04db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506388
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: James Lissiak <jalissia@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#644407}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 296f6b12650bd5e38eaf1fe0987c46910fe2d6eb
2019-03-26 17:36:51 +00:00
Joel Einbinder 09f4874fa1 DevTools: Parse the remote version better for debugging Android devices
Bug: 935942
Change-Id: Ie9e5c340b5b036a7fb9588b1e0c6518478f6317f
Reviewed-on: https://chromium-review.googlesource.com/c/1492932
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#636235}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 751f792b02c40bae86b2e4de4c69bc0d3e2fd12b
2019-02-28 01:34:42 +00:00
Pavel Feldman 33b4091e40 DevTools: migrate to the light selection color to achieve 4.5+ contrast ratio.
Bug: 850500
Change-Id: Iccf9ca5fe088aa09d46dc4dd3344be79f28013a8
Reviewed-on: https://chromium-review.googlesource.com/c/1388027
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#618701}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6b6debfc317059bbe69de528507b9b397333a612
2018-12-22 01:08:02 +00:00
Pavel Feldman 876d718660 DevTools: mimic DOMTokenList.toggle override in DOMExtension
Change-Id: If67b9b070d6ad59a68a54fe99ff0a601da4b4e1d
Reviewed-on: https://chromium-review.googlesource.com/c/1354780
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#616514}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d19bf8249bbbdd524c5a074b32289631b4aff21b
2018-12-14 00:11:05 +00:00
Joel Einbinder b948ebcbc9 DevTools: Polyfill Custom Elements V0 for old frontends
Bug: 685385
Change-Id: I1adae3ac86a2af361b1253f7e723aa86a7ce397e
Reviewed-on: https://chromium-review.googlesource.com/c/1371086
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#615780}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 64e9bfb30b51952e956210ce1c60a6b69e2b405f
2018-12-12 02:01:12 +00:00
Joel Einbinder 82b1d8e832 DevTools: Shadow DOM v0 polyfill
This polyfills Shadow DOM v0 on top of Shadow DOM v1 for old devtools
front ends.

Bug: 685385
Change-Id: Ia2a79a86012cbec2fc7cff3cb36fe4c9b631a381
Reviewed-on: https://chromium-review.googlesource.com/c/1366325
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#614893}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d828088b0546192c7cb08fd8404ead6422e39cdf
2018-12-08 01:01:37 +00:00
Christian Biesinger 2d1b2e9c64 Reland "[css-flex] Update to newer spec about definite flex item sizes"
This reverts commit 82ef33772f758883cda6379610b24f27e7ff3bbe.

Implements this change:
https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8

external/wpt/css/css-flexbox/percentage-heights-003.html ostensibly tests
this, but I don't think the test is correct (and we don't pass it)

To fix the regression from the original change, I updated the devtools code
to specify a flex-basis of auto. It previously defaulted to 0%, which
used to be resolved to auto, but with this change resolves to 0px,
which is not what the code wants.

TESTED=css3/flexbox/definite-main-size.html

Bug: 784059,900459
Change-Id: I773877f34b281dd6bfe4ac02b9aad90451c3acf9
Reviewed-on: https://chromium-review.googlesource.com/c/1247184
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#605553}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d519ce9b1818139c082ff339c7c5d3af18b1baa7
2018-11-06 01:18:25 +00:00
Joel Einbinder 3190478a12 DevTools: Correctly return the major version in devtools_compatibility
Bug: 898245
Change-Id: I591cecc162cb86d5925ec67b4bbe6b12cd72a0c2
Reviewed-on: https://chromium-review.googlesource.com/c/1313830
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#605045}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 20f041d246f785b4cc4713bb6d58db4a0952c5e2
2018-11-02 20:52:27 +00:00
Joel Einbinder f55cc94aa1 DevTools: Selectively apply devtools_compatibility.js for remote version
This patch uses the remoteVersion of the devtools being run to apply
only the fixes that are needed.

Additionally, use of the /deep/ selector is swapped out for injecting
a stylesheet in every shadow root.

Bug: 898245
Change-Id: I311ab48d88434d821fedb279d81b2ab9a7f8c94d
Reviewed-on: https://chromium-review.googlesource.com/c/1299914
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#603733}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 89ed1da2c8dde2a5c415fb5688c05b7bcfc7cf94
2018-10-30 01:59:53 +00:00
Pavel Feldman f1a36ee480 DevTools: allow saving files in the hosted mode.
Change-Id: I34db4fd1972bc42289f1f88031057ec7dfd4e5f8
Reviewed-on: https://chromium-review.googlesource.com/1154204
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#578918}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 49abc1fa2b67d602b351e8fa488d0424efa304de
2018-07-28 16:10:25 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00