Bug 51738

Summary: Web Inspector: refactoring: encapsulate lazy initialization of SourceFrame
Product: WebKit Reporter: Pavel Podivilov <podivilov>
Component: Web Inspector (Deprecated)Assignee: Pavel Podivilov <podivilov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch.
pfeldman: review-
Patch.
pfeldman: review-
Comments addressed.
none
Rebase. pfeldman: review+

Pavel Podivilov
Reported 2010-12-30 02:38:02 PST
Web Inspector: refactoring: encapsulate lazy initialization of SourceFrame
Attachments
Patch. (25.15 KB, patch)
2010-12-30 02:38 PST, Pavel Podivilov
pfeldman: review-
Patch. (18.06 KB, patch)
2010-12-30 09:13 PST, Pavel Podivilov
pfeldman: review-
Comments addressed. (17.73 KB, patch)
2010-12-31 05:19 PST, Pavel Podivilov
no flags
Rebase. (18.89 KB, patch)
2011-01-11 06:52 PST, Pavel Podivilov
pfeldman: review+
Pavel Podivilov
Comment 1 2010-12-30 02:38:45 PST
Pavel Podivilov
Comment 2 2010-12-30 02:39:17 PST
Comment on attachment 77667 [details] Patch. Extract content loading logic from SourceView and ScriptView to ContentProvider implementations. Pass ContentProvider in SourceFrame constructor to allow SourceFrame manage it's lazy initialization.
Pavel Feldman
Comment 3 2010-12-30 06:09:50 PST
Comment on attachment 77667 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=77667&action=review Could you please split this into smaller patches? It is really hard to follow the changes here and I feel there are bugs introduced. > WebCore/inspector/front-end/ScriptView.js:34 > + this.sourceFrame.addScript(script.sourceID, script.startingLine); I did not know SourceFrame is sourceID aware. It probably should not be. > WebCore/inspector/front-end/SourceFrame.js:869 > +WebInspector.ContentProvider = function() SourceFrameContentProvider ? > WebCore/inspector/front-end/SourceFrame.js:914 > +WebInspector.ResourceContentProvider = function(resource) I thought the whole point of content provider was to isolate SourceFrame from Script / Resource. Now I see explicit resource usage in SourceFrame.js. This seems wrong.
Pavel Podivilov
Comment 4 2010-12-30 09:13:41 PST
Pavel Podivilov
Comment 5 2010-12-30 09:13:56 PST
Comment on attachment 77685 [details] Patch. All comments addressed.
Pavel Feldman
Comment 6 2010-12-31 04:13:09 PST
Comment on attachment 77685 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=77685&action=review > WebCore/inspector/front-end/SourceFrame.js:835 > + var sourceIDToStartingLineMap = this._contentProvider.sourceIDToStartingLineMap(); You will be able to use short for syntax if you make properties on Array's prototype non-enumerable: Object.defineProperty(Array.prototype, "remove", { value: function() { ... }}); By default it'll create non-writable, non-enumerable, non-configurable property. > WebCore/inspector/front-end/SourceFrame.js:874 > + sourceIDToStartingLineMap: function() This is a very strange content provider. I'd suggest to provide Scripts array here: you can then get both ids and starting lines from the scripts.
Pavel Podivilov
Comment 7 2010-12-31 05:19:09 PST
Created attachment 77716 [details] Comments addressed.
Pavel Podivilov
Comment 8 2011-01-11 06:52:36 PST
Created attachment 78525 [details] Rebase.
Pavel Podivilov
Comment 9 2011-01-17 06:14:16 PST
Note You need to log in before you can comment on or make changes to this bug.