Bug 56931 - Web Inspector: fix breakpoints positions in formatted scripts.
Summary: Web Inspector: fix breakpoints positions in formatted scripts.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Podivilov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-23 09:41 PDT by Pavel Podivilov
Modified: 2011-03-28 05:00 PDT (History)
10 users (show)

See Also:


Attachments
Patch. (17.85 KB, patch)
2011-03-23 09:41 PDT, Pavel Podivilov
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Podivilov 2011-03-23 09:41:07 PDT
Web Inspector: fix breakpoints positions in formatted scripts.

Add async requestMapping method to SourceFile interface as required for populating breakpoints sidebar pane when in "format all scripts" mode.
Comment 1 Pavel Podivilov 2011-03-23 09:41:38 PDT
Created attachment 86629 [details]
Patch.
Comment 2 Yury Semikhatsky 2011-03-25 05:34:06 PDT
Comment on attachment 86629 [details]
Patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=86629&action=review

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:276
> +        function loadSnippet(callback)

Can you turn it into a method on the PresentationBreakpoint? We don't usually set closures as object methods.

> Source/WebCore/inspector/front-end/SourceFile.js:65
> +    requestMapping: function(callback)

It's not clear from the method name what kind of mapping is requested, consider renaming it to requestPosistionMapping or requestSourceMapping.

Also why is this a request and not a synchronous getter?

> Source/WebCore/inspector/front-end/SourceFile.js:190
> +    this._scripts = scripts;

You lean on the fact that the scripts are sorted, can you use a name reflecting this?
Comment 3 Pavel Podivilov 2011-03-28 04:57:55 PDT
Committed r82103: <http://trac.webkit.org/changeset/82103>
Comment 4 Pavel Podivilov 2011-03-28 05:00:42 PDT
(In reply to comment #2)
> (From update of attachment 86629 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=86629&action=review
> 
> > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:276
> > +        function loadSnippet(callback)
> 
> Can you turn it into a method on the PresentationBreakpoint? We don't usually set closures as object methods.

Done.

> 
> > Source/WebCore/inspector/front-end/SourceFile.js:65
> > +    requestMapping: function(callback)
> 
> It's not clear from the method name what kind of mapping is requested, consider renaming it to requestPosistionMapping or requestSourceMapping.

Done.

> 
> Also why is this a request and not a synchronous getter?

When we are in formatted scripts mode, we need to format the script to obtain source mapping which is done asynchronously.

> 
> > Source/WebCore/inspector/front-end/SourceFile.js:190
> > +    this._scripts = scripts;
> 
> You lean on the fact that the scripts are sorted, can you use a name reflecting this?

Done.