Bug 34332 - Web Inspector: Lazy-load resource contents in the Resources panel
Summary: Web Inspector: Lazy-load resource contents in the Resources panel
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: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-29 08:18 PST by Alexander Pavlov (apavlov)
Modified: 2010-02-01 14:03 PST (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed solution (9.65 KB, patch)
2010-01-29 10:13 PST, Alexander Pavlov (apavlov)
pfeldman: review-
timothy: commit-queue-
Details | Formatted Diff | Diff
[PATCH] A simplified solution (2.16 KB, patch)
2010-02-01 03:14 PST, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2010-01-29 08:18:24 PST
Recently, the resource data pane in the Resources panel was split into 2 tabs, one with the resource metainfo, the other with the resource contents. However, when a resource is selected and its metainfo tab is displayed, the resource contents retrieval starts. Once the contents of a long textual resource are retrieved, their handling takes some time and hangs the UI. Instead, such resource contents should be loaded only when the Contents tab is selected.
Comment 1 Joseph Pecoraro 2010-01-29 08:36:34 PST
Nice idea. Would this cause any problems with searching on the Resources tab?
Comment 2 Alexander Pavlov (apavlov) 2010-01-29 10:12:25 PST
(In reply to comment #1)
> Nice idea. Would this cause any problems with searching on the Resources tab?

Good catch - I forgot about externally opening resources in the Scripts and Resources panels. When the search is performed, all resource contents should be retrieved. Now the solution should be good to review.
Comment 3 Alexander Pavlov (apavlov) 2010-01-29 10:13:09 PST
Created attachment 47720 [details]
[PATCH] Proposed solution
Comment 4 Timothy Hatcher 2010-01-29 17:52:38 PST
Comment on attachment 47720 [details]
[PATCH] Proposed solution

> +    ensureResourceLoaded: function()

ensureResourceIsLoaded would be a better name.

> +        if (resource._resourcesView && "setLazyLoad" in resource._resourcesView)
> +            resource._resourcesView.setLazyLoad(lazyLoad);

Why not just set the property directly? When would the setLazyLoad function not exist? Use a setter instead of a function, or just set the property directly.

Fix these before landing.
Comment 5 Pavel Feldman 2010-01-31 04:41:39 PST
Comment on attachment 47720 [details]
[PATCH] Proposed solution

It is not clear to me why these changes are necessary. Why not to simply remove setupSourceFrameIfNeeded from the SourceView::show and call it as an abstract function from within ResourceView upon tab switch?
Patch also seems to be wrong in a way that it does not load resource if lazy load is set to 'false'.
Comment 6 Alexander Pavlov (apavlov) 2010-02-01 03:14:38 PST
Created attachment 47827 [details]
[PATCH] A simplified solution
Comment 7 WebKit Commit Bot 2010-02-01 14:03:05 PST
Comment on attachment 47827 [details]
[PATCH] A simplified solution

Clearing flags on attachment: 47827

Committed r54148: <http://trac.webkit.org/changeset/54148>
Comment 8 WebKit Commit Bot 2010-02-01 14:03:13 PST
All reviewed patches have been landed.  Closing bug.