Bug 67609 - Web Inspector: re-implement RawSourceCode.
Summary: Web Inspector: re-implement RawSourceCode.
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: 67635 67636
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-05 10:19 PDT by Pavel Podivilov
Modified: 2011-09-06 08:25 PDT (History)
10 users (show)

See Also:


Attachments
Patch (24.72 KB, patch)
2011-09-05 10:24 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-09-05 10:19:27 PDT
Web Inspector: re-implement RawSourceCode.

RawSourceCode content and source mapping loading logic is too complex, re-implement it using simpler semantics:
1) Initially, RawSourceCode doesn't have any content or mapping because content loading and
formatting operations are asynchronous, it only has scripts metadata. We don't update UI right
after RawSourceCode creation until full RawSourceCode representation is ready (content + mapping).
2) When RawSourceCode representation is ready (e.g. resource is finished, or content is formatted 
if in pretty-print mode) we dispatch SourceMappingUpdated event to notify the listeners that
source code should be shown to user and raw locations should be converted to ui locations
(to show breakpoins, messages, call frames etc in UI). At this moment, all source file's content
is ready for loading and source mapping is available.
3) Later, RawSourceCode representation may change again, e.g. if pretty-print mode is toggled, or
blocked resource is finished etc., in that case SourceMappingUpdated is dispatched again to update
source code, links and decorations in UI.
Comment 1 Pavel Podivilov 2011-09-05 10:24:08 PDT
Created attachment 106345 [details]
Patch
Comment 2 Yury Semikhatsky 2011-09-06 01:34:47 PDT
Comment on attachment 106345 [details]
Patch

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

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:178
> +            var eventData = { sourceCode: uiSourceCode, oldSourceCode: oldUISourceCode };

sourceCode -> uiSourceCode

> Source/WebCore/inspector/front-end/SourceFile.js:155
> +        if (this._locked) {

_locked -> _updatingSourceMapping ?
Comment 3 Pavel Podivilov 2011-09-06 02:34:07 PDT
Committed r94560: <http://trac.webkit.org/changeset/94560>
Comment 4 Pavel Podivilov 2011-09-06 08:25:10 PDT
Committed r94571: <http://trac.webkit.org/changeset/94571>