Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Issue 2668613002: [inspector] added Debugger.moduleRequested notification

Created:
3 years, 10 months ago by kozy
Modified:
3 years, 5 months ago
Reviewers:
neis, adamk, Yang
CC:
v8-reviews_googlegroups.com, Yang, devtools-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[inspector] added Debugger.moduleRequested notification This notification is fired when module requests another nodule during instantiation. This event is needed by DevTools frontend as minimal information exposed by protocol to implement: "Go to import", module dependency graph and to help users with understanding import errors. One-pager: https://docs.google.com/document/d/1wfMHzSv6mr0-NdauFfhR65ebH821_HJCkERJKb1ouUc/edit# BUG=v8:1569 R=dgozman@chromium.org,adamk@chromium.org

Patch Set 1 #

Patch Set 2 : report existing resolved module on Debugger.enable #

Total comments: 4

Patch Set 3 : addressed comments #

Total comments: 9

Patch Set 4 : addressed comments #

Patch Set 5 : added missing test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -1 line) Patch
M src/api.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M src/debug/debug.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/debug/debug.cc View 1 2 3 1 chunk +31 lines, -0 lines 0 comments Download
M src/debug/debug-interface.h View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/inspector/js_protocol.json View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
M src/inspector/v8-debugger.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M src/inspector/v8-debugger.cc View 1 2 3 2 chunks +15 lines, -0 lines 0 comments Download
M src/inspector/v8-debugger-agent-impl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/inspector/v8-debugger-agent-impl.cc View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 2 chunks +5 lines, -1 line 0 comments Download
M src/objects.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M src/objects-debug.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-printer.cc View 1 chunk +1 line, -0 lines 0 comments Download
A test/inspector/debugger/es6-module-requested.js View 1 2 3 4 1 chunk +48 lines, -0 lines 0 comments Download
A test/inspector/debugger/es6-module-requested-expected.txt View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 14 (7 generated)
kozy
FYI: PoC how we can implement moduleResolved notification. I'll write in details about other options ...
3 years, 10 months ago (2017-01-31 01:58:24 UTC) #2
Yang
https://codereview.chromium.org/2668613002/diff/20001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/2668613002/diff/20001/src/objects.h#newcode6749 src/objects.h:6749: DECL_ACCESSORS(module, Object) This field is so we can iterate ...
3 years, 10 months ago (2017-01-31 07:53:01 UTC) #4
adamk
+neis
3 years, 10 months ago (2017-01-31 18:15:14 UTC) #6
kozy
addressed comments and ready for review. https://codereview.chromium.org/2668613002/diff/20001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/2668613002/diff/20001/src/objects.h#newcode6749 src/objects.h:6749: DECL_ACCESSORS(module, Object) On ...
3 years, 10 months ago (2017-01-31 22:14:47 UTC) #8
neis
Hi, some comments below. Could you say a few words on the motivation for this ...
3 years, 10 months ago (2017-02-01 13:38:56 UTC) #9
kozy
Addressed all comments, added better description. Please take another look. https://codereview.chromium.org/2668613002/diff/40001/src/debug/debug-interface.h File src/debug/debug-interface.h (right): https://codereview.chromium.org/2668613002/diff/40001/src/debug/debug-interface.h#newcode149 ...
3 years, 10 months ago (2017-02-01 16:39:25 UTC) #12
neis
3 years, 10 months ago (2017-02-06 09:20:33 UTC) #13
Thanks, lgtm.

https://codereview.chromium.org/2668613002/diff/40001/src/inspector/js_protoc...
File src/inspector/js_protocol.json (right):

https://codereview.chromium.org/2668613002/diff/40001/src/inspector/js_protoc...
src/inspector/js_protocol.json:726: "description": "Fired when one module
successfully import another."
On 2017/02/01 16:39:25, kozy wrote:
> On 2017/02/01 13:38:55, neis wrote:
> > s/import/imports/
> > 
> > I find this description a little unclear. "Successfully" imported to me
would
> > imply e.g. that all the variables that the importing module requests from
the
> > imported module can be resolved, but you're calling the handler before that
is
> > determined (in fact even before the imported module itself has been
> > instantiated).
> 
> I renamed this notification to moduleRequested. We mostly need it to implement
> go to import, dependency graph and to help users with understanding of import
> errors.
> Could you suggest better instrumentation point to get enough information as
> earlier as possible?

If you want to get information as early as possible, this seems like a
reasonable place.

Powered by Google App Engine
This is Rietveld 408576698