Bug 105261

Summary: Web Inspector: show cached images under MemoryCache -> Images section
Product: WebKit Reporter: Yury Semikhatsky <yurys>
Component: Web Inspector (Deprecated)Assignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, benjamin, japhet, junov, keishi, loislo, ojan.autocc, pfeldman, pmuellr, senorblanco, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Yury Semikhatsky
Reported 2012-12-18 00:00:08 PST
Native memory profiler should show specific CachedImages with their sizes under Memory cache resources: Image section so that user can figure out which images make up the cache.
Attachments
Patch (22.54 KB, patch)
2012-12-18 00:03 PST, Yury Semikhatsky
no flags
Patch (23.80 KB, patch)
2012-12-18 02:26 PST, Yury Semikhatsky
no flags
Yury Semikhatsky
Comment 1 2012-12-18 00:03:55 PST
Alexei Filippov
Comment 2 2012-12-18 01:10:09 PST
Comment on attachment 179891 [details] Patch lgtm
Alexei Filippov
Comment 3 2012-12-18 02:08:50 PST
Comment on attachment 179891 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=179891&action=review > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:272 > + _addChildrenFromGraph: function(memoryBlock) Missing function annotations here and below. > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:294 > + for (var i = 0; i < edges.length; i++) { > + var target = edges[i].target(); > + if (target.className() === "CachedImage") { Perhaps a helper iterator function forAllChildrenOfClass? > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:302 > + if (image.className() === "BitmapImage") { What about other classes? Later? > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:439 > + return this.targetsOfAllEdges(edgeName)[0]; Pure functional code doesn't work well in JS. ;-) This one doesn't seem too effective. Add a TODO/FIXME?
Yury Semikhatsky
Comment 4 2012-12-18 02:26:06 PST
(In reply to comment #3) > (From update of attachment 179891 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=179891&action=review > > > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:272 > > + _addChildrenFromGraph: function(memoryBlock) > > Missing function annotations here and below. > Fixed. > > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:294 > > + for (var i = 0; i < edges.length; i++) { > > + var target = edges[i].target(); > > + if (target.className() === "CachedImage") { > > Perhaps a helper iterator function forAllChildrenOfClass? > I'd change that when we have another client for the code to better understand which API we need. > > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:302 > > + if (image.className() === "BitmapImage") { > > What about other classes? Later? > Yes, it is a first step. Show just referenced pixel buffer which we know may be quite big. If you feel that we should show some other objects please speak up. > > Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js:439 > > + return this.targetsOfAllEdges(edgeName)[0]; > > Pure functional code doesn't work well in JS. ;-) > This one doesn't seem too effective. Add a TODO/FIXME? We can optimize this code when we find it inefficient for the current use case it seems to be good enough.
Yury Semikhatsky
Comment 5 2012-12-18 02:26:49 PST
WebKit Review Bot
Comment 6 2012-12-18 03:47:11 PST
Comment on attachment 179910 [details] Patch Clearing flags on attachment: 179910 Committed r138005: <http://trac.webkit.org/changeset/138005>
WebKit Review Bot
Comment 7 2012-12-18 03:47:15 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.